Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::dynamic_type_dispatcher Class Reference

A dynamic type dispatcher. More...

#include <dynamic_type_dispatcher.hpp>

Inheritance diagram for boost::dynamic_type_dispatcher:
Collaboration diagram for boost::dynamic_type_dispatcher:

Public Member Functions

 dynamic_type_dispatcher ()
 Default constructor. More...
 
 dynamic_type_dispatcher (dynamic_type_dispatcher const &that)
 Copy constructor. More...
 
dynamic_type_dispatcheroperator= (dynamic_type_dispatcher const &that)
 Copy assignment. More...
 
template<typename T , typename VisitorT >
void register_type (VisitorT const &visitor)
 The method registers a new type. More...
 
dispatching_map::size_type registered_types_count () const
 The method returns the number of registered types. More...
 

Protected Types

typedef callback_base(* get_callback_impl_type )(type_dispatcher *, std::type_info const &)
 Pointer to the callback acquisition method. More...
 

Protected Member Functions

 BOOST_DEFAULTED_FUNCTION (type_dispatcher(type_dispatcher const &that),:m_get_callback_impl(that.m_get_callback_impl){}) public
 The method requests a callback for the value of type T. More...
 

Detailed Description

A dynamic type dispatcher.

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.

Member Typedef Documentation

typedef callback_base(* boost::type_dispatcher::get_callback_impl_type)(type_dispatcher *, std::type_info const &)
protectedinherited

Pointer to the callback acquisition method.

Constructor & Destructor Documentation

boost::dynamic_type_dispatcher::dynamic_type_dispatcher ( )
inline

Default constructor.

boost::dynamic_type_dispatcher::dynamic_type_dispatcher ( dynamic_type_dispatcher const &  that)
inline

Copy constructor.

Member Function Documentation

boost::type_dispatcher::BOOST_DEFAULTED_FUNCTION ( type_dispatcher(type_dispatcher const &that)  ,
:m_get_callback_impl(that.m_get_callback_impl){}   
)
inlineprotectedinherited

The method requests a callback for the value of type T.

Returns
The type-specific callback or an empty value, if the type is not supported
dynamic_type_dispatcher& boost::dynamic_type_dispatcher::operator= ( dynamic_type_dispatcher const &  that)
inline

Copy assignment.

template<typename T , typename VisitorT >
void boost::dynamic_type_dispatcher::register_type ( VisitorT const &  visitor)
inline

The method registers a new type.

Parameters
visitorFunction object that will be associated with the type T

References boost::cref(), boost::make_shared(), and boost::multiprecision::backends::p.

dispatching_map::size_type boost::dynamic_type_dispatcher::registered_types_count ( ) const
inline

The method returns the number of registered types.


The documentation for this class was generated from the following file: