A base class for composite data values. More...
#include <CompositeData.h>
Public Member Functions | |
| void | add (const std::string &name, AbstractData *value) |
| void | add (AbstractData *value) |
| It adds the value as the last component of the composite data. More... | |
| AbstractData * | clone () const |
| It creates a new clone of the composite. More... | |
| CompositeData () | |
| Constructor. More... | |
| CompositeData (std::size_t nComponents) | |
| It prepares the internal container for at least nComponents. More... | |
| CompositeData (const std::string &name) | |
| CompositeData (const CompositeData &rhs) | |
| Copy constructor. More... | |
| int | getTypeCode () const |
| It returns the associated data type code. More... | |
| AbstractData * | getValue (std::size_t i) const |
| It returns the i-th component value of the composite data. More... | |
| CompositeData & | operator= (const CompositeData &rhs) |
| Copy constructor. More... | |
| void | setName (const std::string &name) |
| void | setValue (std::size_t i, AbstractData *value) |
| It sets the i-th component value of the composite data. More... | |
| std::string | toString () const |
| It returns the data value in a string representation. More... | |
| ~CompositeData () | |
| Destructor. More... | |
Private Attributes | |
| std::string | m_name |
| The composite name. More... | |
| std::vector< std::string > | m_names |
| The component names. More... | |
| std::vector< AbstractData * > | m_values |
| The component values. More... | |
A base class for composite data values.
Definition at line 49 of file CompositeData.h.
|
inline |
Constructor.
Definition at line 54 of file CompositeData.h.
| te::dt::CompositeData::CompositeData | ( | std::size_t | nComponents | ) |
It prepares the internal container for at least nComponents.
| nComponents | The number of expected components for the composite. |
Definition at line 34 of file CompositeData.cpp.
| te::dt::CompositeData::CompositeData | ( | const std::string & | name | ) |
Definition at line 40 of file CompositeData.cpp.
| te::dt::CompositeData::CompositeData | ( | const CompositeData & | rhs | ) |
Copy constructor.
| rhs | The right-hand-side composite. |
Definition at line 45 of file CompositeData.cpp.
References te::common::Clone(), and m_values.
| te::dt::CompositeData::~CompositeData | ( | ) |
| void te::dt::CompositeData::add | ( | const std::string & | name, |
| AbstractData * | value | ||
| ) |
Definition at line 77 of file CompositeData.cpp.
| void te::dt::CompositeData::add | ( | AbstractData * | value | ) |
It adds the value as the last component of the composite data.
| value | The component value at the specified index. If there is another component at the specified index it will be released. |
Definition at line 95 of file CompositeData.cpp.
|
virtual |
It creates a new clone of the composite.
Implements te::dt::AbstractData.
Definition at line 100 of file CompositeData.cpp.
|
inlinevirtual |
It returns the associated data type code.
Implements te::dt::AbstractData.
Definition at line 132 of file CompositeData.h.
References te::dt::COMPOSITE_TYPE.
| te::dt::AbstractData * te::dt::CompositeData::getValue | ( | std::size_t | i | ) | const |
It returns the i-th component value of the composite data.
| i | The position index of the component. |
Definition at line 83 of file CompositeData.cpp.
| te::dt::CompositeData & te::dt::CompositeData::operator= | ( | const CompositeData & | rhs | ) |
Copy constructor.
| rhs | The right-hand-side composite. |
Definition at line 56 of file CompositeData.cpp.
References te::common::Clone(), te::common::FreeContents(), m_names, and m_values.
| void te::dt::CompositeData::setName | ( | const std::string & | name | ) |
Definition at line 72 of file CompositeData.cpp.
| void te::dt::CompositeData::setValue | ( | std::size_t | i, |
| AbstractData * | value | ||
| ) |
It sets the i-th component value of the composite data.
| i | The position index of the component. |
| value | The component value at the specified index. If there is another component at the specified index it will be released. |
Definition at line 89 of file CompositeData.cpp.
|
virtual |
It returns the data value in a string representation.
Implements te::dt::AbstractData.
Definition at line 105 of file CompositeData.cpp.
|
private |
The composite name.
Definition at line 145 of file CompositeData.h.
|
private |
|
private |
The component values.
Definition at line 143 of file CompositeData.h.
Referenced by CompositeData(), and operator=().