MIRA
Public Types | Public Member Functions | List of all members
Setter< T > Class Template Reference

Holds a boost::function object to a special setter function that must meet the signature "void method(T)". More...

#include <serialization/GetterSetter.h>

Public Types

typedef T value_type
 

Public Member Functions

 Setter (boost::function< void(const value_type &)> f)
 
void set (const value_type &value)
 apply the setter, e.g. mysetter.set(1234); More...
 
Setteroperator= (const value_type &value)
 mimic the assignment behavior of underlying type, e.g. mysetter = 1234; More...
 
template<typename Reflector >
void reflect (Reflector &r)
 

Detailed Description

template<typename T>
class mira::Setter< T >

Holds a boost::function object to a special setter function that must meet the signature "void method(T)".

Setter objects usually are created using the appropriate setter() methods (see GetterSetter.h).

To call the stored setter method you can use the setter object as a functor, e.g:

Setter<int> s = setter(myMethod); // create the setter
s(123); // call the setter

Setters are used by the Serialization framework.

See also
Serialization

Member Typedef Documentation

◆ value_type

typedef T value_type

Constructor & Destructor Documentation

◆ Setter()

Setter ( boost::function< void(const value_type &)>  f)
inline

Member Function Documentation

◆ set()

void set ( const value_type value)
inline

apply the setter, e.g. mysetter.set(1234);

◆ operator=()

Setter& operator= ( const value_type value)
inline

mimic the assignment behavior of underlying type, e.g. mysetter = 1234;

◆ reflect()

void reflect ( Reflector &  r)
inline

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