The SKIRT project
advanced radiative transfer for astrophysics
ItemListPropertyHandler Class Reference

#include <ItemListPropertyHandler.hpp>

Inheritance diagram for ItemListPropertyHandler:

Public Member Functions

void acceptVisitor (PropertyHandlerVisitor *visitor) override
bool addNewItemOfType (string type)
bool addValue (Item *value)
vector< Item * > children () const override
void insertNames () override
bool insertNewItemOfType (int index, string type)
bool insertValue (int index, Item *value)
bool removeValueAt (int index)
int retrieveSelectedRow ()
void setToEmpty ()
void storeSelectedRow (int row)
vector< Item * > value () 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 "list of pointer to item".

Member Function Documentation

◆ acceptVisitor()

void ItemListPropertyHandler::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.

◆ addNewItemOfType()

bool ItemListPropertyHandler::addNewItemOfType ( string type)

Constructs a new item instance of the specified type and adds it to the list held by the handled property in the target item. The target item assumes ownership of the new instance. The function returns false if a new item couldn't be added (e.g. because the specified type is inappropriate).

◆ addValue()

bool ItemListPropertyHandler::addValue ( Item * value)

Adds the specified item to the list held by the handled property in the target item. The target item assumes ownership of the specified instance. The function returns false if the item couldn't be added (e.g. because it has an inappropriate type).

◆ children()

vector< Item * > ItemListPropertyHandler::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.

Reimplemented from PropertyHandler.

◆ insertNames()

void ItemListPropertyHandler::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 list properties, the function inserts the target property's name if the current property value is a nonempty list (i.e. including at least one item), and does not insert any names if the value is the empty list. In addition, the function inserts the names provided in the conditional expression of the "insert" attribute of the target property, if any.

Furthermore, for each of the items in the current property value, 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.

◆ insertNewItemOfType()

bool ItemListPropertyHandler::insertNewItemOfType ( int index,
string type )

Constructs a new instance of the specified type and inserts it at the specified index into the list held by the handled property in the target item. The target item assumes ownership of the new instance. The function returns false if a new item couldn't be added (e.g. because the specified item type is inappropriate).

◆ insertValue()

bool ItemListPropertyHandler::insertValue ( int index,
Item * value )

Inserts the specified item at the specified index into the list held by the handled property in the target item. The target item assumes ownership of the specified instance. The function returns false if the item couldn't be added (e.g. because it has an inappropriate type).

◆ removeValueAt()

bool ItemListPropertyHandler::removeValueAt ( int index)

Removes the item with the specified zero-based index from the list held by the handled property in the target item. The removed item is deleted. The function returns false if the item couldn't be removed (e.g. because the index is out of range).

◆ retrieveSelectedRow()

int ItemListPropertyHandler::retrieveSelectedRow ( )

This function returns the stored selected row index for the handled property in the target item. If the selected row index has never been stored for this property and item, the function returns zero.

◆ setToEmpty()

void ItemListPropertyHandler::setToEmpty ( )

Empties the list held by the handled property in the target item, removing any previously owned item instances.

◆ storeSelectedRow()

void ItemListPropertyHandler::storeSelectedRow ( int row)

This function stores the selected row index for the handled property in the target item to the specified integer value.

◆ value()

vector< Item * > ItemListPropertyHandler::value ( ) const

Returns the value of the handled property in the target item.


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