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

- Search for |

# steerable.hpp

Go to the documentation of this file.

    00001 //  Copyright (c) 2005-2009 Hartmut Kaiser
    00002 //
    00003 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
    00004 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    00005
    00006 #ifndef SAGA_SAGA_DETAIL_STEERABLE_HPP
    00007 #define SAGA_SAGA_DETAIL_STEERABLE_HPP
    00008
    00009 // include stl
    00010 #include <vector>
    00011 #include <string>
    00012
    00013 // include dependent spec sections
    00014 #include <saga/saga/util.hpp>
    00015 #include <saga/saga/base.hpp>
    00016 #include <saga/saga/monitorable.hpp>
    00017 #include <saga/saga/detail/monitorable.hpp>
    00018
    00019 // For symbol import/export macros
    00020 #include <saga/saga-defs.hpp>
    00021
    00022 // suppress warnings about dependent classes not being exported from the dll
    00023 #if defined(BOOST_MSVC)
    00024 #pragma warning(push)
    00025 #pragma warning(disable : 4251 4231 4660)
    00026 #endif
    00027
    00029 // for modules not belonging to the engine attributes should not be exported
    00030 #if !defined (SAGA_CREATE_PREPROCESSED_FILES) && !defined(SAGA_EXPORT_STEERABLE)
    00031
    00032 # if defined(SAGA_ENGINE_EXPORTS) || defined(SAGA_STEERABLE_EXPORTS)
    00033 #   define SAGA_EXPORT_STEERABLE SAGA_SYMBOL_EXPORT
    00034 # elif !defined (SAGA_NO_EXPORT_STEERABLE) && !defined(BUILD_SAGA_LITE)
    00035 #   define SAGA_EXPORT_STEERABLE SAGA_SYMBOL_IMPORT
    00036 # else
    00037 #   define SAGA_EXPORT_STEERABLE /* empty */
    00038 # endif
    00039
    00040 #endif // !SAGA_CREATE_PREPROCESSED_FILES
    00041
    00043 namespace saga { namespace detail
    00044     {
    00049         template <typename Derived>
    00050         struct SAGA_EXPORT_STEERABLE steerable
    00051         {
    00053             Derived& derived()
    00054             { return static_cast<Derived&>(*this); }
    00055             Derived const& derived() const
    00056             { return static_cast<Derived const&>(*this); }
    00058
    00065             bool add_metric (saga::metric m);
    00066
    00073             void remove_metric (std::string name);
    00074
    00081             void fire_metric (std::string name);
    00082         };
    00083
    00085     }}   // namespace saga::detail
    00086
    00087 #if defined(BOOST_MSVC)
    00088 #pragma warning(pop)
    00089 #endif
    00090
    00091 #endif // SAGA_SAGA_DETAIL_STEERABLE_HPP
    00092