Public Types | Public Member Functions | Static Public Member Functions | List of all members
graphics::PropertyTpl< T > Class Template Reference

#include <gepetto/viewer/node-property.h>

Inheritance diagram for graphics::PropertyTpl< T >:
[legend]
Collaboration diagram for graphics::PropertyTpl< T >:
[legend]

Public Types

typedef boost::function< void(const T &)> Setter_t
 
typedef boost::function< const T &(void)> Getter_t
 
typedef shared_ptr< PropertyTplPtr_t
 

Public Member Functions

std::string type ()
 
 PropertyTpl (const std::string &name, const Getter_t &g, const Setter_t &s)
 
bool set (const T &value)
 
bool get (T &value)
 
bool hasReadAccess () const
 
bool hasWriteAccess () const
 
- Public Member Functions inherited from graphics::Property
virtual bool set (const bool &v)
 
virtual bool set (const int &v)
 
virtual bool set (const float &v)
 
virtual bool set (const std::string &v)
 
virtual bool set (const unsigned long &v)
 
virtual bool set (const osgVector2 &v)
 
virtual bool set (const osgVector3 &v)
 
virtual bool set (const osgVector4 &v)
 
virtual bool set (const GLenum &v)
 
virtual bool get (bool &v)
 
virtual bool get (int &v)
 
virtual bool get (float &v)
 
virtual bool get (std::string &v)
 
virtual bool get (unsigned long &v)
 
virtual bool get (osgVector2 &v)
 
virtual bool get (osgVector3 &v)
 
virtual bool get (osgVector4 &v)
 
virtual bool get (GLenum &v)
 
const std::string & name () const
 

Static Public Member Functions

static Ptr_t create (const std::string &name, const Getter_t &g, const Setter_t &s)
 
template<typename Obj >
static Getter_t getterFromMemberFunction (Obj *obj, const T &(Obj::*mem_func)() const)
 
template<typename Obj >
static Getter_t getterFromMemberFunction (Obj *obj, T(Obj::*mem_func)() const)
 
template<typename Obj >
static Setter_t setterFromMemberFunction (Obj *obj, void(Obj::*mem_func)(const T &))
 
template<typename Obj >
static Setter_t setterFromMemberFunction (Obj *obj, void(Obj::*mem_func)(T))
 

Additional Inherited Members

- Protected Member Functions inherited from graphics::Property
 Property (const std::string &name)
 
template<typename T >
void invalidType (T) const
 
void invalidGet () const
 
void invalidSet () const
 
- Protected Attributes inherited from graphics::Property
const std::string name_
 

Member Typedef Documentation

◆ Getter_t

template<typename T >
typedef boost::function<const T&(void)> graphics::PropertyTpl< T >::Getter_t

◆ Ptr_t

template<typename T >
typedef shared_ptr<PropertyTpl> graphics::PropertyTpl< T >::Ptr_t

◆ Setter_t

template<typename T >
typedef boost::function<void(const T&)> graphics::PropertyTpl< T >::Setter_t

Constructor & Destructor Documentation

◆ PropertyTpl()

template<typename T >
graphics::PropertyTpl< T >::PropertyTpl ( const std::string &  name,
const Getter_t g,
const Setter_t s 
)
inline

Member Function Documentation

◆ create()

template<typename T >
static Ptr_t graphics::PropertyTpl< T >::create ( const std::string &  name,
const Getter_t g,
const Setter_t s 
)
inlinestatic

◆ get()

template<typename T >
bool graphics::PropertyTpl< T >::get ( T &  value)
inline

◆ getterFromMemberFunction() [1/2]

template<typename T >
template<typename Obj >
static Getter_t graphics::PropertyTpl< T >::getterFromMemberFunction ( Obj *  obj,
const T &(Obj::*)() const  mem_func 
)
inlinestatic

◆ getterFromMemberFunction() [2/2]

template<typename T >
template<typename Obj >
static Getter_t graphics::PropertyTpl< T >::getterFromMemberFunction ( Obj *  obj,
T(Obj::*)() const  mem_func 
)
inlinestatic

◆ hasReadAccess()

template<typename T >
bool graphics::PropertyTpl< T >::hasReadAccess ( ) const
inlinevirtual

Implements graphics::Property.

◆ hasWriteAccess()

template<typename T >
bool graphics::PropertyTpl< T >::hasWriteAccess ( ) const
inlinevirtual

Implements graphics::Property.

◆ set()

template<typename T >
bool graphics::PropertyTpl< T >::set ( const T &  value)
inline

◆ setterFromMemberFunction() [1/2]

template<typename T >
template<typename Obj >
static Setter_t graphics::PropertyTpl< T >::setterFromMemberFunction ( Obj *  obj,
void(Obj::*)(const T &)  mem_func 
)
inlinestatic

◆ setterFromMemberFunction() [2/2]

template<typename T >
template<typename Obj >
static Setter_t graphics::PropertyTpl< T >::setterFromMemberFunction ( Obj *  obj,
void(Obj::*)(T)  mem_func 
)
inlinestatic

◆ type()

template<typename T >
std::string graphics::PropertyTpl< T >::type ( )
inlinevirtual

Implements graphics::Property.