ponder 3.2
C++ reflection library
ponder::Property Class Referenceabstract

Abstract representation of a property. More...

#include <property.hpp>

+ Inheritance diagram for ponder::Property:

Public Member Functions

virtual ~Property ()
 Destructor.
 
IdReturn name () const
 Get the name of the property. More...
 
ValueKind kind () const
 Get the type of the property. More...
 
virtual bool isReadable () const
 Check if the property can be read. More...
 
virtual bool isWritable () const
 Check if the property can be written. More...
 
Value get (const UserObject &object) const
 Get the current value of the property for a given object. More...
 
void set (const UserObject &object, const Value &value) const
 Set the current value of the property for a given object. More...
 
virtual void accept (ClassVisitor &visitor) const
 Accept the visitation of a ClassVisitor. More...
 

Friends

template<typename T >
class ClassBuilder
 
class UserObject
 

Detailed Description

Abstract representation of a property.

Properties are members of metaclasses. Their main purpose is to be get and/or set; They also provide detailed informations about their type.

See also
SimpleProperty, ArrayProperty, EnumProperty, ObjectProperty

Member Function Documentation

◆ accept()

virtual void ponder::Property::accept ( ClassVisitor visitor) const
virtual

Accept the visitation of a ClassVisitor.

Parameters
visitorVisitor to accept

Reimplemented in ponder::ArrayProperty, ponder::EnumProperty, ponder::UserProperty, and ponder::SimpleProperty.

◆ get()

Value ponder::Property::get ( const UserObject object) const

Get the current value of the property for a given object.

Parameters
objectObject
Returns
Value of the property
Exceptions
NullObjectobject is invalid
ForbiddenReadproperty is not readable

◆ isReadable()

virtual bool ponder::Property::isReadable ( ) const
virtual

Check if the property can be read.

Returns
True if the property can be read, false otherwise

◆ isWritable()

virtual bool ponder::Property::isWritable ( ) const
virtual

Check if the property can be written.

Returns
True if the property can be written, false otherwise

◆ kind()

ValueKind ponder::Property::kind ( ) const

Get the type of the property.

Returns
Type of the property

◆ name()

IdReturn ponder::Property::name ( ) const

Get the name of the property.

Returns
Name of the property

◆ set()

void ponder::Property::set ( const UserObject object,
const Value value 
) const

Set the current value of the property for a given object.

Parameters
objectObject
valueNew value to assign to the property
Exceptions
NullObjectobject is invalid
ForbiddenWriteproperty is not writable
BadTypevalue can't be converted to the property's type

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