- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Search for |

# session.hpp

Go to the documentation of this file.

    00001 //  Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net)
    00002 //  Copyright (c) 2005-2009 Hartmut Kaiser
    00003 //  Copyright (c) 2007 Ole Weidner (oweidner@cct.lsu.edu)
    00004 //
    00005 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
    00006 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    00007
    00008 #ifndef SAGA_SESSION_HPP
    00009 #define SAGA_SESSION_HPP
    00010
    00011 // include stl
    00012 #include <list>
    00013 #include <set>
    00014
    00015 // include dependent spec sections
    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 // suppress warnings about dependent classes not being exported from the dll
    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         // the default session as singleton, and the no-session singleton
    00034         SAGA_EXPORT session& get_the_session();
    00035         #define SAGA_DEFAULT_SESSION detail::get_the_session()
    00036     }
    00038
    00048   class SAGA_EXPORT session
    00049     : public saga::object
    00050   {
    00051     protected:
    00053
    00054       TR1::shared_ptr<saga::impl::session> get_impl_sp (void) const;
    00055       saga::impl::session* get_impl (void) const;
    00056
    00057       friend class  saga::object; // needs to get impl
    00058       friend struct impl::runtime;
    00060
    00061     public:
    00066       explicit session(bool default_session = false);
    00067
    00073       explicit session(saga::object const& obj);
    00074
    00079      ~session (void);
    00080
    00085       session &operator= (saga::object const& o);
    00086
    00092       void add_context(saga::context const& c);
    00093
    00099       void remove_context(saga::context const& c);
    00100
    00106       std::vector <saga::context> list_contexts() const;
    00107
    00112       friend SAGA_EXPORT
    00113       bool operator== (session const& lhs, session const& rhs);
    00114   };
    00115
    00117 } // namespace saga
    00118
    00119 // re-enable warnings about dependent classes not being exported from the dll
    00120 #if defined(BOOST_MSVC)
    00121 #pragma warning(pop)
    00122 #endif
    00123
    00124 #endif // SAGA_SESSION_HPP
    00125