...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::log::dynamic_type_dispatcher — A dynamic type dispatcher.
// In header: <boost/log/utility/type_dispatch/dynamic_type_dispatcher.hpp> class dynamic_type_dispatcher : public type_dispatcher { public: // construct/copy/destruct dynamic_type_dispatcher(); dynamic_type_dispatcher(dynamic_type_dispatcher const &); dynamic_type_dispatcher & operator=(dynamic_type_dispatcher const &); // public member functions template<typename T, typename VisitorT> void register_type(VisitorT const &); dispatching_map::size_type registered_types_count() const; };
The type dispatcher can be used to pass objects of arbitrary types from one component to another. With regard to the library, the type dispatcher can be used to extract attribute values.
The dynamic type dispatcher can be initialized in run time and, therefore, can support different types, depending on runtime conditions. Each supported type is associated with a functional object that will be called when an object of the type is dispatched.
dynamic_type_dispatcher
public
construct/copy/destructdynamic_type_dispatcher();
Default constructor
dynamic_type_dispatcher(dynamic_type_dispatcher const & that);
Copy constructor
dynamic_type_dispatcher & operator=(dynamic_type_dispatcher const & that);
Copy assignment
dynamic_type_dispatcher
public member functionstemplate<typename T, typename VisitorT> void register_type(VisitorT const & visitor);
The method registers a new type
Parameters: |
|
dispatching_map::size_type registered_types_count() const;
The method returns the number of registered types