#include <GhostItem.hpp>
Public Member Functions | |
GhostItem (string type) | |
void | clearItemListProperty (const PropertyDef *property) override |
bool | getBoolProperty (const PropertyDef *property) const override |
vector< double > | getDoubleListProperty (const PropertyDef *property) const override |
double | getDoubleProperty (const PropertyDef *property) const override |
string | getEnumProperty (const PropertyDef *property) const override |
int | getIntProperty (const PropertyDef *property) const override |
vector< Item * > | getItemListProperty (const PropertyDef *property) const override |
Item * | getItemProperty (const PropertyDef *property) const override |
string | getStringProperty (const PropertyDef *property) const override |
void | insertIntoItemListProperty (const PropertyDef *property, int index, Item *item) override |
void | removeFromItemListProperty (const PropertyDef *property, int index) override |
void | setBoolProperty (const PropertyDef *property, bool value) override |
void | setDoubleListProperty (const PropertyDef *property, vector< double > value) override |
void | setDoubleProperty (const PropertyDef *property, double value) override |
void | setEnumProperty (const PropertyDef *property, string value) override |
void | setIntProperty (const PropertyDef *property, int value) override |
void | setItemProperty (const PropertyDef *property, Item *item) override |
void | setStringProperty (const PropertyDef *property, string value) override |
string | type () const override |
![]() | |
Item (const Item &)=delete | |
virtual | ~Item () |
void | addChild (Item *child) |
const vector< Item * > & | children () const |
virtual void | clearItemListProperty (const PropertyDef *property) |
void | destroyChild (Item *child) |
virtual bool | getBoolProperty (const PropertyDef *property) const |
virtual vector< double > | getDoubleListProperty (const PropertyDef *property) const |
virtual double | getDoubleProperty (const PropertyDef *property) const |
virtual string | getEnumProperty (const PropertyDef *property) const |
virtual int | getIntProperty (const PropertyDef *property) const |
virtual vector< Item * > | getItemListProperty (const PropertyDef *property) const |
virtual Item * | getItemProperty (const PropertyDef *property) const |
virtual string | getStringProperty (const PropertyDef *property) const |
int | getUtilityProperty (string name) const |
virtual void | insertIntoItemListProperty (const PropertyDef *property, int index, Item *item) |
Item & | operator= (const Item &)=delete |
Item * | parent () const |
virtual void | removeFromItemListProperty (const PropertyDef *property, int index) |
virtual void | setBoolProperty (const PropertyDef *property, bool value) |
virtual void | setDoubleListProperty (const PropertyDef *property, vector< double > value) |
virtual void | setDoubleProperty (const PropertyDef *property, double value) |
virtual void | setEnumProperty (const PropertyDef *property, string value) |
virtual void | setIntProperty (const PropertyDef *property, int value) |
virtual void | setItemProperty (const PropertyDef *property, Item *item) |
virtual void | setStringProperty (const PropertyDef *property, string value) |
void | setUtilityProperty (string name, int value) |
virtual string | type () const |
Private Attributes | |
std::unordered_map< string, bool > | _boolProperties |
std::unordered_map< string, vector< double > > | _doubleListProperties |
std::unordered_map< string, double > | _doubleProperties |
std::unordered_map< string, string > | _enumProperties |
std::unordered_map< string, int > | _intProperties |
std::unordered_map< string, vector< Item * > > | _itemListProperties |
std::unordered_map< string, Item * > | _itemProperties |
std::unordered_map< string, string > | _stringProperties |
string | _type |
Additional Inherited Members | |
![]() | |
Item () | |
An instance of the GhostItem class represents an arbitrary item in any dataset described by a SMILE schema. The GhostItem class does not provide any actual item-specific functionality: the intention is to represent and manipulate a SMILE dataset in an abstract way without expecting it to actually do something. To this end, the GhostItem class implements the setters and getters for property values of the various supported property types, just like the Item base class. However, the property values are stored in generic dictionaries rather than in custom data members tailored to the type being represented.
|
inline |
The constructor sets the item's type, which should match one of the concrete types defined in the SMILE schema describing the dataset to which the item belongs. The item's parent is initialized to the null pointer. For all items other than the root node, the parent is set later on by handing the item to an item or item list property of another item (which calls the private setParent() function). The constructor further initializes the item's state so that no properties have been setup, which also implies that the item has no children.
|
overridevirtual |
Sets the specified item list property to the empty list, removing any items that were present.
Reimplemented from Item.
|
overridevirtual |
Returns the value of the specified Boolean property. If the property does not exist, the function throws an error.
Reimplemented from Item.
|
overridevirtual |
Returns the value of the specified floating point list property. If the property does not exist, the function throws an error.
Reimplemented from Item.
|
overridevirtual |
Returns the value of the specified floating point property. If the property does not exist, the function throws an error.
Reimplemented from Item.
|
overridevirtual |
Returns the value of the specified enumeration property. If the property does not exist, the function throws an error.
Reimplemented from Item.
|
overridevirtual |
Returns the value of the specified integer property. If the property does not exist, the function throws an error.
Reimplemented from Item.
|
overridevirtual |
Returns the value of the specified item list property. Ownership for the returned items is not handed over. If the property does not exist, the function throws an error.
Reimplemented from Item.
|
overridevirtual |
Returns the value of the specified item property. Ownership for the returned item is not handed over. If the property does not exist, the function throws an error.
Reimplemented from Item.
|
overridevirtual |
Returns the value of the specified string property. If the property does not exist, the function throws an error.
Reimplemented from Item.
|
overridevirtual |
Adds the specified item to the specified item list property, and sets the parent of the specified item to the receiving item so that ownership is handed over to the receiving item. Assume that the item list property has N items when this function is called (i.e. before anything is changed). If the specified zero-based index is in the range [0,N-1], the new item is inserted at the specified index (i.e. just before the item that was there previously). If the index is out of this range (i.e. it is negative or at least N), the new item is added at the end of the list.
Reimplemented from Item.
|
overridevirtual |
Removes the item at the specified index from the specified item list property and deletes it. If the index is out of range, nothing happens.
Reimplemented from Item.
|
overridevirtual |
Sets the specified Boolean property to the specified value.
Reimplemented from Item.
|
overridevirtual |
Sets the specified floating point list property to the specified value.
Reimplemented from Item.
|
overridevirtual |
Sets the specified floating point property to the specified value.
Reimplemented from Item.
|
overridevirtual |
Sets the specified enumeration property to the specified value.
Reimplemented from Item.
|
overridevirtual |
Sets the specified integer property to the specified value.
Reimplemented from Item.
|
overridevirtual |
Sets the specified item property to the specified item, and sets the parent of the specified item to the receiving item so that ownership is handed over to the receiving item. If the specified property already holds another item, that item is destructed.
Reimplemented from Item.
|
overridevirtual |
Sets the specified string property to the specified value.
Reimplemented from Item.
|
overridevirtual |
Returns the name of the item's type.
Reimplemented from Item.