Graphite  Version 3
An experimental 3D geometry processing program
OGF::CustomAttributes Class Reference

Stores a set of custom attributes, i.e. name-value pairs attached to the objects. More...

#include <OGF/gom/reflection/meta_type.h>

Inheritance diagram for OGF::CustomAttributes:
OGF::MetaArg OGF::MetaInformation OGF::MetaMember OGF::MetaType OGF::MetaMethod OGF::MetaProperty OGF::MetaBuiltinType OGF::MetaClass OGF::MetaEnum OGF::MetaConstructor OGF::MetaMethodGetProperty OGF::MetaMethodSetProperty OGF::MetaSignal OGF::MetaSlot OGF::DynamicMetaClass OGF::DynamicMetaSlot

Public Member Functions

size_t nb_custom_attributes () const
 Gets the number of custom attributes. More...
 
std::string ith_custom_attribute_name (index_t i) const
 Gets the name of a custom attribute by index. More...
 
std::string ith_custom_attribute_value (index_t i) const
 Gets the value of a custom attribute by index. More...
 
bool has_custom_attribute (const std::string &name) const
 Tests whether a given custom attribute exists. More...
 
void create_custom_attribute (const std::string &name, const std::string &value)
 Creates a new custom attribute. More...
 
void set_custom_attribute (const std::string &name, const std::string &value)
 Sets the value of a new custom attribute. More...
 
std::string custom_attribute_value (const std::string &name) const
 Gets the value of a new custom attribute. More...
 
void clear_custom_attributes ()
 Clears the custom attributes.
 

Detailed Description

Stores a set of custom attributes, i.e. name-value pairs attached to the objects.

All the constructs of the language (classes, methods, arguments...) can be "decorated" with custom attributes. For instance, these custom attribute can indicate which widget type should be used for a function argument in the GUI. They can also contain the documentation parsed from the Doxygen comments.

Definition at line 63 of file meta_type.h.

Member Function Documentation

◆ create_custom_attribute()

void OGF::CustomAttributes::create_custom_attribute ( const std::string &  name,
const std::string &  value 
)
inline

Creates a new custom attribute.

Parameters
[in]namename of the custom attribute
[in]valuevalue of the custom attribute
Precondition
!has_custom_attribute(name)

Definition at line 114 of file meta_type.h.

◆ custom_attribute_value()

std::string OGF::CustomAttributes::custom_attribute_value ( const std::string &  name) const
inline

Gets the value of a new custom attribute.

Parameters
[in]namename of the custom attribute
Returns
the value of the custom attribute
Precondition
has_custom_attribute(name)

Definition at line 138 of file meta_type.h.

◆ has_custom_attribute()

bool OGF::CustomAttributes::has_custom_attribute ( const std::string &  name) const
inline

Tests whether a given custom attribute exists.

Parameters
[in]namename of the custom attribute
Return values
trueif the object has a custom attribute named name
falseotherwise

Definition at line 104 of file meta_type.h.

◆ ith_custom_attribute_name()

std::string OGF::CustomAttributes::ith_custom_attribute_name ( index_t  i) const
inline

Gets the name of a custom attribute by index.

Parameters
[in]ithe index of the custom attribute
Returns
the name of the i th custom attribute
Precondition
i < nb_custom_attributes()

Definition at line 80 of file meta_type.h.

◆ ith_custom_attribute_value()

std::string OGF::CustomAttributes::ith_custom_attribute_value ( index_t  i) const
inline

Gets the value of a custom attribute by index.

Parameters
[in]ithe index of the custom attribute
Returns
the value of the i th custom attribute
Precondition
i < nb_custom_attributes()

Definition at line 92 of file meta_type.h.

◆ nb_custom_attributes()

size_t OGF::CustomAttributes::nb_custom_attributes ( ) const
inline

Gets the number of custom attributes.

Returns
the number of custom attribute

Definition at line 70 of file meta_type.h.

◆ set_custom_attribute()

void OGF::CustomAttributes::set_custom_attribute ( const std::string &  name,
const std::string &  value 
)
inline

Sets the value of a new custom attribute.

Parameters
[in]namename of the custom attribute
[in]valuevalue of the custom attribute
Precondition
has_custom_attribute(name)

Definition at line 126 of file meta_type.h.


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