RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
PropertyBase Class Referenceabstract

Base class for Property handling. More...

#include <PropertyBase.hpp>

Inherited by Property< rw::math::Vector3D<> >, Property< rw::core::PropertyMap >, Property< bool >, and Property< T >.

Public Types

typedef rw::core::Ptr< PropertyBasePtr
 smart pointer type to this class
 
typedef std::function< void(PropertyBase *)> PropertyListener
 Method signature for a callback function.
 
typedef rw::core::Event< PropertyListener, PropertyBase * > ChangedEvent
 Type for changed property events.
 

Public Member Functions

 PropertyBase (const std::string &identifier, const std::string &description)
 Constructor. More...
 
 PropertyBase (const std::string &identifier, const std::string &description, const PropertyType &type)
 Constructor. More...
 
virtual ~PropertyBase ()
 Destroys PropertyBase.
 
const std::string & getIdentifier () const
 Returns the Property identifier. More...
 
const std::string & getDescription () const
 Returns description. More...
 
void setDescription (const std::string &desc, bool fireChangedEvent=true)
 Set description. More...
 
virtual PropertyBaseclone () const =0
 Construct a clone of the property.
 
virtual PropertyValueBasegetPropertyValue ()=0
 returns reference to the property value More...
 
virtual const PropertyValueBasegetPropertyValue () const =0
 returns const reference to the property value More...
 
ChangedEventchangedEvent ()
 get changed event More...
 
const rw::core::PropertyTypegetType () const
 Returns the PropertyType. More...
 

Detailed Description

Base class for Property handling.

Constructor & Destructor Documentation

◆ PropertyBase() [1/2]

PropertyBase ( const std::string &  identifier,
const std::string &  description 
)

Constructor.

Parameters
identifier[in] identifier for the property
description[in] description of the property

◆ PropertyBase() [2/2]

PropertyBase ( const std::string &  identifier,
const std::string &  description,
const PropertyType type 
)

Constructor.

Parameters
identifier[in] identifier for the property
description[in] description of the property
type[in] type of the property

Member Function Documentation

◆ changedEvent()

ChangedEvent& changedEvent ( )
inline

get changed event

to add listener use: changedEvent().add(...)

◆ getDescription()

const std::string& getDescription ( ) const

Returns description.

Returns
string description

◆ getIdentifier()

const std::string& getIdentifier ( ) const

Returns the Property identifier.

Returns
string identifier

◆ getPropertyValue() [1/2]

virtual const PropertyValueBase& getPropertyValue ( ) const
pure virtual

returns const reference to the property value

Returns
value

Implemented in Property< T >, Property< rw::math::Vector3D<> >, Property< rw::core::PropertyMap >, and Property< bool >.

◆ getPropertyValue() [2/2]

virtual PropertyValueBase& getPropertyValue ( )
pure virtual

returns reference to the property value

Returns
value

Implemented in Property< T >, Property< rw::math::Vector3D<> >, Property< rw::core::PropertyMap >, and Property< bool >.

◆ getType()

const rw::core::PropertyType& getType ( ) const

Returns the PropertyType.

Returns
the PropertyType

◆ setDescription()

void setDescription ( const std::string &  desc,
bool  fireChangedEvent = true 
)

Set description.

Parameters
desc[in] the new description.
fireChangedEvent[in] (optional) fire changed event.

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