The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | List of all members
EnumPropertyHandler Class Reference

#include <EnumPropertyHandler.hpp>

Inheritance diagram for EnumPropertyHandler:
Inheritance graph
[legend]

Public Member Functions

void acceptVisitor (PropertyHandlerVisitor *visitor) override
 
string defaultValue () const
 
virtual void insertNames () override
 
bool isValidValue (string value) const override
 
 PropertyHandler (const PropertyHandler &)=delete
 
 PropertyHandler (Item *target, const PropertyDef *property, const SchemaDef *schema, NameManager *nameMgr)
 
void setValue (string value)
 
string titleForValue () const
 
vector< string > titlesForValues () const
 
string value () const
 
vector< string > values () const
 
- Public Member Functions inherited from PropertyHandler
 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
 
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 enumeration types.

Member Function Documentation

◆ acceptVisitor()

void EnumPropertyHandler::acceptVisitor ( PropertyHandlerVisitor visitor)
overridevirtual

Accepts the specified property handler visitor.

Implements PropertyHandler.

◆ defaultValue()

string EnumPropertyHandler::defaultValue ( ) const

Returns the enumeration name corresponding to the default value for the handled property, or the empty string if unavailable.

◆ insertNames()

virtual void EnumPropertyHandler::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 enumeration properties, the function inserts a name obtained by concatenating the target property's name and the enumeration name for the current value. In addition, the function inserts the names provided in the conditional expression of the "insert" attribute of the target property, if any.

Implements PropertyHandler.

◆ isValidValue()

bool EnumPropertyHandler::isValidValue ( string  value) const
overridevirtual

Returns true if the given string can be successfully converted to a value of the property's type. For enumeration properties, the function returns true if the specified string matches one of the enumeration names for the handled property; otherwise it returns false.

Implements PropertyHandler.

◆ PropertyHandler() [1/2]

PropertyHandler::PropertyHandler ( const PropertyHandler )
delete

Constructs a property handler for the specified target item and property, with a given schema definition.

◆ PropertyHandler() [2/2]

PropertyHandler::PropertyHandler ( Item target,
const PropertyDef property,
const SchemaDef schema,
NameManager nameMgr 
)

Constructs a property handler for the specified target item and property, with a given schema definition.

◆ setValue()

void EnumPropertyHandler::setValue ( string  value)

Sets the value of the handled property in the target item to the value corresponding to the specified enumeration name. If the specified key is invalid for this property, nothing happens.

◆ titleForValue()

string EnumPropertyHandler::titleForValue ( ) const

Returns the title corresponding to the value of the handled property in the target item. If there is no title, the empty string is returned instead.

◆ titlesForValues()

vector< string > EnumPropertyHandler::titlesForValues ( ) const

Returns a list of the titles corresponding to all enumeration names defined for the type of the handled property, in the order corresponding to values().

◆ value()

string EnumPropertyHandler::value ( ) const

Returns the enumeration name corresponding to the value of the handled property in the target item.

◆ values()

vector< string > EnumPropertyHandler::values ( ) const

Returns a list of all enumeration names defined for the type of the handled property.


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