8 #ifndef CPPCMS_CACHE_INTERFACE_H 9 #define CPPCMS_CACHE_INTERFACE_H 14 #include <cppcms/defs.h> 15 #include <cppcms/serialization_classes.h> 16 #include <booster/noncopyable.h> 17 #include <booster/intrusive_ptr.h> 18 #include <booster/hold_ptr.h> 19 #include <cppcms/cstdint.h> 32 class cache_interface;
87 std::set<std::string> detach();
90 void add(std::string
const &t);
93 std::set<std::string> triggers_;
162 void rise(std::string
const &trigger);
168 void add_trigger(std::string
const &trigger);
188 bool stats(
unsigned &keys,
unsigned &triggers);
204 bool fetch_page(std::string
const &key);
217 void store_page(std::string
const &key,
int timeout=-1);
229 bool fetch_frame(std::string
const &key,std::string &result,
bool notriggers=
false);
242 void store_frame(std::string
const &key,
243 std::string
const &frame,
244 std::set<std::string>
const &triggers=std::set<std::string>(),
246 bool notriggers=
false);
257 void store_frame(std::string
const &key,
258 std::string
const &frame,
260 bool notriggers=
false);
272 template<
typename Serializable>
273 bool fetch_data(std::string
const &key,Serializable &data,
bool notriggers=
false)
276 if(!fetch(key,buffer,notriggers))
293 template<
typename Serializable>
294 void store_data(std::string
const &key,Serializable
const &data,
295 std::set<std::string>
const &triggers=std::set<std::string>(),
296 int timeout=-1,
bool notriggers=
false)
300 store(key,buffer,triggers,timeout,notriggers);
313 template<
typename Serializable>
314 void store_data(std::string
const &key,Serializable
const &data,
int timeout,
bool notriggers=
false)
316 store_data<Serializable>(key,data,std::set<std::string>(),timeout,notriggers);
327 void store( std::string
const &key,
328 std::string
const &data,
329 std::set<std::string>
const &triggers,
333 bool fetch( std::string
const &key,
340 std::set<std::string> triggers_;
341 std::set<triggers_recorder *> recorders_;
344 uint32_t page_compression_used_ : 1;
345 CPPCMS_UNUSED_MEMBER uint32_t reserved : 31;
void store_data(std::string const &key, Serializable const &data, std::set< std::string > const &triggers=std::set< std::string >(), int timeout=-1, bool notriggers=false)
Definition: cache_interface.h:294
bool fetch_data(std::string const &key, Serializable &data, bool notriggers=false)
Definition: cache_interface.h:273
This class represent the central event loop of the CppCMS applications.
Definition: service.h:62
This is the namespace where all CppCMS functionality is placed.
Definition: application.h:19
static void load(std::string const &serialized_object, Object &real_object)
context is a central class that holds all specific connection related information. It encapsulates CGI request and response, cache, session and locale information
Definition: http_context.h:47
void store_data(std::string const &key, Serializable const &data, int timeout, bool notriggers=false)
Definition: cache_interface.h:314
triggers_recorder is a class that allows you to record all triggers added in certain scope...
Definition: cache_interface.h:73
This class is the major gateway of the application to CppCMS caching abilities. Any access too cache ...
Definition: cache_interface.h:139
This class makes impossible to copy any class derived from this one.
Definition: noncopyable.h:15
static void save(Object const &real_object, std::string &serialized_object)