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.
 
 
 
 
 
 

72 lines
2.0 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 CPPCMS_SESSION_DUAL_H
  9. #define CPPCMS_SESSION_DUAL_H
  10. #include <cppcms/session_api.h>
  11. #include <cppcms/defs.h>
  12. #include <booster/hold_ptr.h>
  13. #include <booster/shared_ptr.h>
  14. #include <booster/auto_ptr_inc.h>
  15. namespace cppcms {
  16. namespace sessions {
  17. class session_storage;
  18. class session_sid;
  19. class session_cookies;
  20. class encryptor;
  21. ///
  22. /// \brief Client and Server side storage implementation of session_api
  23. ///
  24. class CPPCMS_API session_dual : public session_api {
  25. public:
  26. ///
  27. /// Create a new object using encryptor \a enc and session_storage \a storage.
  28. /// \a data_size_limit represents the maximal data size that can be stored on client side, if the data size is bigger then that
  29. /// the session data will be stored on server
  30. ///
  31. session_dual( std::auto_ptr<encryptor> enc,
  32. booster::shared_ptr<session_storage> storage,
  33. size_t data_size_limit);
  34. ///
  35. /// Destroy the object: release pointer to \a storage and delete an encryptor it was created with.
  36. ///
  37. virtual ~session_dual();
  38. ///
  39. /// See session_api::save
  40. ///
  41. virtual void save(session_interface &,std::string const &data,time_t timeout,bool new_session,bool on_server);
  42. ///
  43. /// See session_api::load
  44. ///
  45. virtual bool load(session_interface &,std::string &data,time_t &timeout);
  46. ///
  47. /// See session_api::clear
  48. ///
  49. virtual void clear(session_interface &);
  50. ///
  51. /// see session_api::is_blocking
  52. ///
  53. virtual bool is_blocking();
  54. private:
  55. struct _data;
  56. booster::hold_ptr<_data> d;
  57. booster::shared_ptr<session_cookies> client_;
  58. booster::shared_ptr<session_sid> server_;
  59. size_t data_size_limit_;
  60. };
  61. } // sessions
  62. } // cppcms
  63. #endif