#include <ItemPropertyHandler.hpp>
Public Member Functions | |
void | acceptVisitor (PropertyHandlerVisitor *visitor) override |
vector< Item * > | children () const override |
void | insertNames () override |
bool | setToNewItemOfType (string type) |
void | setToNull () |
bool | setValue (Item *value) |
Item * | value () const |
![]() | |
vector< string > | allowedAndDisplayedDescendants () |
string | baseType () const |
string | defaultType () const |
bool | isCompound () const override |
bool | isValidValue (string value) const override |
PropertyHandler (const PropertyHandler &)=delete | |
PropertyHandler (Item *target, const PropertyDef *property, const SchemaDef *schema, NameManager *nameMgr) | |
![]() | |
PropertyHandler (const PropertyHandler &)=delete | |
PropertyHandler (Item *target, const PropertyDef *property, const SchemaDef *schema, NameManager *nameMgr) | |
virtual | ~PropertyHandler ()=default |
virtual void | acceptVisitor (PropertyHandlerVisitor *visitor)=0 |
virtual vector< Item * > | children () const |
bool | hasChanged () const |
bool | hasDefaultValue () const |
virtual void | insertNames ()=0 |
virtual bool | isCompound () const |
bool | isConfigured () |
bool | isConfiguredByUser () |
bool | isDisplayed () const |
bool | isRelevant () const |
bool | isRequired () const |
bool | isSilent () const |
virtual bool | isValidValue (string value) const =0 |
string | name () const |
NameManager * | nameManager () const |
PropertyHandler & | operator= (const PropertyHandler &)=delete |
void | rebuildNames () |
Item * | root () const |
const SchemaDef * | schema () const |
void | setConfiguredByUser (bool valid=true) |
void | setConfiguredToDefault () |
void | setNotConfigured () |
string | title () const |
string | type () const |
Additional Inherited Members | |
![]() | |
const PropertyDef * | property () const |
void | setChanged () |
Item * | target () const |
This class handles SMILE data item properties of type "pointer to item".
|
overridevirtual |
Accepts the specified visitor. This function is part of the "visitor" design pattern implementation used to handle properties of various types.
Implements PropertyHandler.
|
overridevirtual |
Returns a list of SMILE data items including the immediate children of the target item in the dataset in which the target item resides. The implementation in this class returns the result of the value() function encapsulated in a list, or the empty list if the value is null.
Reimplemented from PropertyHandler.
|
overridevirtual |
Causes the name manager associated with this handler to insert names into the global and/or local name sets corresponding to the current value of the target property. For item properties, the function inserts the target property's name if the current property value is not null (i.e. an item is present), and does not insert any names if the value is null (i.e no item is present). In addition, the function inserts the names provided in the conditional expression of the "insert" attribute of the target property, if any.
Furthermore, if the current property value is not null (i.e. an item is present), the function inserts the name of the item's type and of all its ancestor types, recursively. In addition, it inserts the names provided in the conditional expression of the "insert" attribute of these types, if any.
Implements PropertyHandler.
bool ItemPropertyHandler::setToNewItemOfType | ( | string | type | ) |
Constructs a new item instance of the specified type and sets the value of the handled property in the target item so that it points to this new instance. The target item assumes ownership of the new instance. The function returns false if the property couldn't be set (e.g. because the specified item type is inappropriate).
void ItemPropertyHandler::setToNull | ( | ) |
Sets the value of the handled property in the target item to a null pointer, removing any previously owned item instance.
bool ItemPropertyHandler::setValue | ( | Item * | value | ) |
Sets the value of the handled property in the target item so that it points to the specified item. The target item assumes ownership of the specified item instance. The function returns false if the property couldn't be set (e.g. because the specified item has an inappropriate type).
Item * ItemPropertyHandler::value | ( | ) | const |
Returns the value of the handled property in the target item. There is no transfer of ownership.