00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #ifndef SAGA_SESSION_HPP
00009 #define SAGA_SESSION_HPP
00010 
00011 
00012 #include <list>
00013 
00014 
00015 #include <saga/saga/util.hpp>
00016 #include <saga/saga/base.hpp>
00017 #include <saga/saga/object.hpp>
00018 
00019 
00020 #if defined(BOOST_MSVC)
00021 #pragma warning(push)
00022 #pragma warning(disable: 4251 4231 4275 4660)
00023 #endif
00024 
00026 namespace saga
00027 {
00029     namespace detail 
00030     {
00031         
00032         SAGA_EXPORT session        get_the_session ();
00033         #define SAGA_DEFAULT_SESSION detail::get_the_session ()
00034     }
00036 
00046   class SAGA_EXPORT session
00047     : public saga::object
00048   {
00049     protected: 
00051 
00052       TR1::shared_ptr<saga::impl::session> get_impl_sp (void) const;
00053       saga::impl::session* get_impl (void) const;
00054 
00055       friend class  saga::object; 
00056       friend struct impl::runtime;
00058 
00059     public:
00064       explicit session(bool default_session = false);
00065 
00071       explicit session(saga::object const& obj);
00072 
00077      ~session (void);
00078 
00083       session &operator= (saga::object const& o);
00084 
00090       void add_context(saga::context const& c);
00091 
00097       void remove_context(saga::context const& c);
00098 
00104       std::vector <saga::context> list_contexts() const;
00105       
00110       friend SAGA_EXPORT 
00111       bool operator== (session const& lhs, session const& rhs);
00112   };
00113 
00115 } 
00116 
00117 
00118 #if defined(BOOST_MSVC)
00119 #pragma warning(pop)
00120 #endif
00121 
00122 #endif // SAGA_SESSION_HPP
00123