Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef SAGA_SESSION_HPP
00009 #define SAGA_SESSION_HPP
00010
00011
00012 #include <list>
00013 #include <set>
00014
00015
00016 #include <saga/saga/util.hpp>
00017 #include <saga/saga/base.hpp>
00018 #include <saga/saga/object.hpp>
00019 #include <saga/saga/detail/preferences.hpp>
00020
00021
00022 #if defined(BOOST_MSVC)
00023 #pragma warning(push)
00024 #pragma warning(disable: 4251 4231 4275 4660)
00025 #endif
00026
00028 namespace saga
00029 {
00031 namespace detail
00032 {
00033
00034 SAGA_EXPORT session& get_the_session();
00035 #define SAGA_DEFAULT_SESSION detail::get_the_session()
00036
00037
00038 session& get_instance();
00039 }
00041
00051 class SAGA_EXPORT session
00052 : public saga::object
00053 {
00054 protected:
00056
00057 TR1::shared_ptr<saga::impl::session> get_impl_sp (void) const;
00058 saga::impl::session* get_impl (void) const;
00059
00060 friend class saga::object;
00061 friend struct impl::runtime;
00062 friend session& detail::get_instance();
00064
00065
00066 explicit session(bool default_session);
00067
00068 public:
00073 explicit session();
00074
00080 explicit session(saga::object const& obj);
00081
00086 ~session (void);
00087
00092 session &operator= (saga::object const& o);
00093
00099 void add_context(saga::context const& c);
00100
00106 void remove_context(saga::context const& c);
00107
00113 std::vector <saga::context> list_contexts() const;
00114
00119 friend SAGA_EXPORT
00120 bool operator== (session const& lhs, session const& rhs);
00121
00124 void close (double timeout = 0.0);
00125 };
00126
00127 saga::session SAGA_EXPORT get_default_session();
00128
00130 }
00131
00132
00133 #if defined(BOOST_MSVC)
00134 #pragma warning(pop)
00135 #endif
00136
00137 #endif // SAGA_SESSION_HPP
00138