ChipMaster's trial hacks on C++CMS starting with v1.2.1. Not sure I'll follow on with the v2 since it looks to be breaking and mostly frivolous.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

56 lines
1.5 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
  4. //
  5. // See accompanying file COPYING.TXT file for licensing details.
  6. //
  7. ///////////////////////////////////////////////////////////////////////////////
  8. #ifndef TCP_CHACHE_H
  9. #define TCP_CHACHE_H
  10. #include "base_cache.h"
  11. #include <cppcms/cache_interface.h>
  12. #include <cppcms/session_storage.h>
  13. #include "tcp_connector.h"
  14. #include <string>
  15. namespace cppcms {
  16. namespace impl {
  17. class messenger;
  18. struct tcp_operation_header;
  19. class tcp_cache : public tcp_connector {
  20. public:
  21. tcp_cache( std::vector<std::string> const &ip_list,
  22. std::vector<int> const &port_list)
  23. :
  24. tcp_connector(ip_list,port_list)
  25. {
  26. }
  27. static const int up_to_date = -1;
  28. static const int not_found = 0;
  29. static const int found = 1;
  30. int fetch( std::string const &key,
  31. std::string &data,
  32. std::set<std::string> *triggers,
  33. time_t &timeout,
  34. uint64_t &generation,
  35. bool transfer_if_not_updated=false);
  36. void rise(std::string const &trigger);
  37. void clear();
  38. void stats(unsigned &keys,unsigned &triggers);
  39. void store( std::string const &key,
  40. std::string const &data,
  41. std::set<std::string> const &triggers,
  42. time_t timeout);
  43. ~tcp_cache();
  44. };
  45. } // impl
  46. } // cppcms
  47. #endif