Base class for properties.
More...
#include <cppexpose/include/cppexpose/reflection/AbstractProperty.h>
Base class for properties.
cppexpose::AbstractProperty::AbstractProperty |
( |
| ) |
|
cppexpose::AbstractProperty::AbstractProperty |
( |
const Variant & |
options | ) |
|
Constructor.
- Parameters
-
[in] | options | Options with which the property is initialized |
virtual cppexpose::AbstractProperty::~AbstractProperty |
( |
| ) |
|
|
virtual |
const std::string& cppexpose::AbstractProperty::name |
( |
| ) |
const |
void cppexpose::AbstractProperty::setName |
( |
const std::string & |
name | ) |
|
std::string cppexpose::AbstractProperty::qualifiedName |
( |
const Object * |
relativeRoot = nullptr | ) |
const |
Get qualified name.
- Parameters
-
[in] | relativeRoot | (optional) Root object for relative name resolution |
- Returns
- Qualified name
Object* cppexpose::AbstractProperty::parent |
( |
| ) |
const |
Get parent object.
- Returns
- Parent (can be null)
bool cppexpose::AbstractProperty::hasParent |
( |
| ) |
const |
Finds out whether the Object has a parent.
- Returns
- false if the parent is null, otherwise true
virtual bool cppexpose::AbstractProperty::isObject |
( |
| ) |
const |
|
pure virtual |
Check if property is an object.
- Returns
- 'true' if property is an object, else 'false'
Implemented in cppexpose::Object.
const VariantMap& cppexpose::AbstractProperty::options |
( |
| ) |
const |
Get options of property.
Options provide additional meta information about a property. Use options to add, e.g., minimum and maximum values, affixes, or flags. These can be used to configure editor widgets. Look at the class documentation of the specific property type to get a list of supported options.
- Returns
- List of options
void cppexpose::AbstractProperty::setOptions |
( |
const VariantMap & |
map | ) |
|
Set options of property.
- Parameters
-
bool cppexpose::AbstractProperty::hasOption |
( |
const std::string & |
key | ) |
const |
Check if option is set.
- Parameters
-
- Returns
- 'true' if the option is set, else 'false'
const Variant& cppexpose::AbstractProperty::option |
( |
const std::string & |
key | ) |
const |
Get option of property.
- Parameters
-
- Returns
- Option value
Referenced by option().
template<typename Type >
Type cppexpose::AbstractProperty::option |
( |
const std::string & |
key, |
|
|
const Type & |
defaultValue = Type() |
|
) |
| const |
Get option of property convert to a specific type.
- Parameters
-
[in] | key | Option name |
[in] | defaultValue | Default value |
- Returns
- Option value converted to Type, defaultValue if the option doesn't exist or couldn't be converted
References option().
void cppexpose::AbstractProperty::setOption |
( |
const std::string & |
key, |
|
|
const Variant & |
value |
|
) |
| |
Set option of property.
- Parameters
-
[in] | key | Option name |
[in] | value | Option value |
bool cppexpose::AbstractProperty::removeOption |
( |
const std::string & |
key | ) |
|
Remove option of property.
- Parameters
-
- Returns
- 'true' if the option has been removed, else 'false'
void cppexpose::AbstractProperty::initProperty |
( |
const std::string & |
name, |
|
|
Object * |
parent |
|
) |
| |
|
protected |
Initialize property.
- Parameters
-
[in] | name | Name (can be empty) |
[in] | parent | Parent object (can be null) |
[in] | ownership | Property ownership |
void cppexpose::AbstractProperty::setParent |
( |
Object * |
parent | ) |
|
|
protected |
Set parent object.
- Parameters
-
[in] | parent | Parent object (can be null) |
virtual void cppexpose::AbstractProperty::onOptionChanged |
( |
const std::string & |
option | ) |
|
|
protectedvirtual |
Called when an option of the property has changed.
- Parameters
-
[in] | option | Name of the option |
Called before a property is destroyed.
Signal<const std::string &> cppexpose::AbstractProperty::optionChanged |
Called when an option of the property has been changed.
std::string cppexpose::AbstractProperty::m_name |
|
protected |
Object* cppexpose::AbstractProperty::m_parent |
|
protected |
VariantMap cppexpose::AbstractProperty::m_options |
|
protected |
Additional options for the property (e.g., minimum or maximum values)
The documentation for this class was generated from the following files: