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

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

#include <serialization/GetterSetter.h>

Public Types

typedef T value_type
 

Public Member Functions

 Getter (boost::function< value_type()> f)
 
value_type get () const
 apply the getter, e.g. int val = mygetter.get(); More...
 
 operator value_type () const
 cast operator to mimic cast behavior of underlying value type; applies the getter, e.g. More...
 
template<typename Reflector >
void reflect (Reflector &r)
 

Detailed Description

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

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

Getter objects usually are created using the appropriate getter() methods (see GetterSetter.h)

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

Getter<int> g = getter(myMethod); // create the getter
int val = g(); // call the getter

Getters are used by the Serialization framework.

See also
Serialization

Member Typedef Documentation

◆ value_type

typedef T value_type

Constructor & Destructor Documentation

◆ Getter()

Getter ( boost::function< value_type()>  f)
inline

Member Function Documentation

◆ get()

value_type get ( ) const
inline

apply the getter, e.g. int val = mygetter.get();

◆ operator value_type()

operator value_type ( ) const
inline

cast operator to mimic cast behavior of underlying value type; applies the getter, e.g.

int val = mygetter;

◆ reflect()

void reflect ( Reflector &  r)
inline

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