gepetto::viewer::EnumProperty Class Reference

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

Inheritance diagram for gepetto::viewer::EnumProperty:
[legend]
Collaboration diagram for gepetto::viewer::EnumProperty:
[legend]

Public Types

typedef shared_ptr< EnumPropertyPtr_t
 
typedef boost::function< T(void)> Getter_t
 
typedef boost::function< void(const T &)> Setter_t
 
- Public Types inherited from gepetto::viewer::PropertyTpl< T >
typedef boost::function< void(const T &)> Setter_t
 
typedef boost::function< T(void)> Getter_t
 
typedef shared_ptr< PropertyTplPtr_t
 

Public Member Functions

virtual std::string type ()
 
const MetaEnummetaEnum () const
 
 EnumProperty (const std::string &name, const MetaEnum *type, const Getter_t &g, const Setter_t &s)
 
bool set (const int &value)
 Set the enum property. More...
 
- Public Member Functions inherited from gepetto::viewer::PropertyTpl< T >
 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
 
const Getter_tgetter () const
 
void getter (const Getter_t &g)
 
const Setter_tsetter () const
 
void setter (const Setter_t &s)
 
- Public Member Functions inherited from gepetto::viewer::Property
virtual bool set (const bool &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 Configuration &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 (Configuration &v)
 
const std::string & name () const
 

Static Public Member Functions

static Ptr_t create (const std::string &name, const MetaEnum *type, const Getter_t &g, const Setter_t &s)
 
- Static Public Member Functions inherited from gepetto::viewer::PropertyTpl< T >
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 gepetto::viewer::Property
 Property (const std::string &name)
 
template<typename T >
void invalidType (T) const
 
void invalidGet () const
 
void invalidSet () const
 
- Protected Attributes inherited from gepetto::viewer::Property
const std::string name_
 

Member Typedef Documentation

typedef boost::function< T (void)> gepetto::viewer::PropertyTpl< T >::Getter_t
typedef boost::function<void(const T&)> gepetto::viewer::PropertyTpl< T >::Setter_t

Constructor & Destructor Documentation

gepetto::viewer::EnumProperty::EnumProperty ( const std::string &  name,
const MetaEnum type,
const Getter_t g,
const Setter_t s 
)
inline

Member Function Documentation

static Ptr_t gepetto::viewer::EnumProperty::create ( const std::string &  name,
const MetaEnum type,
const Getter_t g,
const Setter_t s 
)
inlinestatic
const MetaEnum* gepetto::viewer::EnumProperty::metaEnum ( ) const
inline
bool gepetto::viewer::EnumProperty::set ( const int &  value)
virtual

Set the enum property.

It also checks that value is a valid enum.

Reimplemented from gepetto::viewer::Property.

virtual std::string gepetto::viewer::EnumProperty::type ( )
inlinevirtual

Reimplemented from gepetto::viewer::PropertyTpl< T >.