diff options
Diffstat (limited to 'project2/common/session.h')
-rw-r--r-- | project2/common/session.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/project2/common/session.h b/project2/common/session.h index ea72c54..6aba83c 100644 --- a/project2/common/session.h +++ b/project2/common/session.h @@ -5,6 +5,7 @@ #include <map> #include <glibmm/ustring.h> #include <boost/intrusive_ptr.hpp> +#include <boost/function.hpp> #include "intrusivePtrBase.h" #include "variables.h" #include "exceptions.h" @@ -14,21 +15,25 @@ class Session : public virtual IntrusivePtrBase { public: SimpleMessageException(VariableNotFound); typedef std::map<Glib::ustring, VariableType> Values; + typedef boost::function2<void, const Glib::ustring &, const VariableType &> SVH; Session(const UUID & id); - virtual ~Session() = 0; + virtual ~Session(); - virtual VariableType GetValue(const Glib::ustring & name) const = 0; - virtual Values GetValuesCopy() const = 0; - virtual void SetValue(const Glib::ustring & name, const VariableType & value) = 0; - virtual void ClearValue(const Glib::ustring & name) = 0; - virtual time_t ExpiryTime() const = 0; + VariableType GetValue(const Glib::ustring & name) const; + void ForeachValue(const SVH &) const; + void SetValue(const Glib::ustring & name, const VariableType & value); + void ClearValue(const Glib::ustring & name); + time_t ExpiryTime() const; const UUID ID; protected: - virtual void ExpiryTime(time_t) = 0; + void ExpiryTime(time_t); friend class SessionContainer; + + Values vars; + time_t expires; }; typedef boost::intrusive_ptr<Session> SessionPtr; |