The SKIRT project
advanced radiative transfer for astrophysics
ItemPropertyHandler Class Reference

#include <ItemPropertyHandler.hpp>

Inheritance diagram for ItemPropertyHandler:

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)
Itemvalue () const
Public Member Functions inherited from AbstractItemPropertyHandler
vector< stringallowedAndDisplayedDescendants ()
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)
Public Member Functions inherited from PropertyHandler
 PropertyHandler (const PropertyHandler &)=delete
 PropertyHandler (Item *target, const PropertyDef *property, const SchemaDef *schema, NameManager *nameMgr)
virtual ~PropertyHandler ()=default
bool hasChanged () const
bool hasDefaultValue () const
bool isConfigured ()
bool isConfiguredByUser ()
bool isDisplayed () const
bool isRelevant () const
bool isRequired () const
bool isSilent () const
string name () const
NameManagernameManager () const
PropertyHandleroperator= (const PropertyHandler &)=delete
void rebuildNames ()
Itemroot () const
const SchemaDefschema () const
void setConfiguredByUser (bool valid=true)
void setConfiguredToDefault ()
void setNotConfigured ()
string title () const
string type () const

Additional Inherited Members

Protected Member Functions inherited from PropertyHandler
const PropertyDefproperty () const
void setChanged ()
Itemtarget () const

Detailed Description

This class handles SMILE data item properties of type "pointer to item".

Member Function Documentation

◆ acceptVisitor()

void ItemPropertyHandler::acceptVisitor ( PropertyHandlerVisitor * visitor)
overridevirtual

Accepts the specified visitor. This function is part of the "visitor" design pattern implementation used to handle properties of various types.

Implements PropertyHandler.

◆ children()

vector< Item * > ItemPropertyHandler::children ( ) const
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.

◆ insertNames()

void ItemPropertyHandler::insertNames ( )
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.

◆ setToNewItemOfType()

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).

◆ setToNull()

void ItemPropertyHandler::setToNull ( )

Sets the value of the handled property in the target item to a null pointer, removing any previously owned item instance.

◆ setValue()

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).

◆ value()

Item * ItemPropertyHandler::value ( ) const

Returns the value of the handled property in the target item. There is no transfer of ownership.


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