0.44.0
|
Item holding generic data and other items. More...
#include <iItem.h>
Public Member Functions | |
iItem (const iaString &name="root") | |
template<typename T > | |
void | setValue (const iaString &key, const T &value) |
template<typename T > | |
T | getValue (const iaString &key) const |
bool | hasValue (const iaString &key) const |
const iaString | getName () const |
iItemPtr | addItem (const iaString &name) |
void | removeItem (iItemPtr item) |
const std::vector< iItemPtr > | getItems () const |
iItemPtr | getParent () const |
void | clear () |
bool | operator== (const iItem &other) const |
bool | operator!= (const iItem &other) const |
template<> | |
void | setValue (const iaString &key, const iaString &value) |
template<> | |
iaString | getValue (const iaString &key) const |
template<> | |
void | setValue (const iaString &key, const bool &value) |
template<> | |
bool | getValue (const iaString &key) const |
template<> | |
void | setValue (const iaString &key, const uint64 &value) |
template<> | |
uint64 | getValue (const iaString &key) const |
Item holding generic data and other items.
Useful for small hierarchies since all data is copied a lot
igor::iItem::iItem | ( | const iaString & | name = "root" | ) |
ctor
name | name of the item (must be unique between siblings) |
adds item to this item
this item retains ownership
name | name of the item (must be unique between siblings) |
void igor::iItem::clear | ( | ) |
clear item and it's children
const std::vector< iItemPtr > igor::iItem::getItems | ( | ) | const |
const iaString igor::iItem::getName | ( | ) | const |
iItemPtr igor::iItem::getParent | ( | ) | const |
T igor::iItem::getValue | ( | const iaString & | key | ) | const |
key "name" is a reserved key. Every item has a name
key | the given key |
|
inline |
|
inline |
|
inline |
bool igor::iItem::hasValue | ( | const iaString & | key | ) | const |
bool igor::iItem::operator!= | ( | const iItem & | other | ) | const |
compare two items recursively for being not equal
other | the other item |
bool igor::iItem::operator== | ( | const iItem & | other | ) | const |
compare two items recursively for being equal
other | the other item |
void igor::iItem::removeItem | ( | iItemPtr | item | ) |
removes given item from this item
item | the item to remove |
|
inline |
|
inline |
void igor::iItem::setValue | ( | const iaString & | key, |
const T & | value | ||
) |
set value for given key
key "name" is a reserved key. Every item has a name
key | to set |
value | to set |
|
inline |