dsim_model member functions that provide attribute setting and retrieval. More...
Functions | |
void | dsim_model::set_attribute (const std::string &ame, const std::string &value) |
Set an attribute at this object. | |
bool | dsim_model::has_attribute (const std::string &name) |
Determine whether or not an attribute for this object has been set. | |
std::string | dsim_model::get_attribute (const std::string &name) |
Get the value of an attribute at this object. | |
std::map< std::string, std::string >::iterator | dsim_model::attribute_iterator () |
Get an iterator for moving through the attributes of this object. | |
std::map< std::string, std::string >::iterator | dsim_model::end_attribute_iterator () |
Get the endpoint iterator for the stopping condition when moving through the attibutes of this object. |
dsim_model member functions that provide attribute setting and retrieval.
Objects can have attribute/value pairs that are specified either programmatically or via a setup file. These attributes can be used either by the object itself to configure specific behavior (though this is generally better handled via custom setup commands and parse_setup()); they are also often used either by other objects or by whatever external system is running the simulation to configure how an object is handled. Attribute names are arbitrary non-NULL strings, as are their values.
std::map< std::string, std::string >::iterator dsim_model::attribute_iterator | ( | ) | [inherited] |
Get an iterator for moving through the attributes of this object.
Returns the starting iterator for the map of attributes, suitable for use in iterating over the attributes of the object.
std::map< std::string, std::string >::iterator dsim_model::end_attribute_iterator | ( | ) | [inherited] |
Get the endpoint iterator for the stopping condition when moving through the attibutes of this object.
Returns the ending iterator for the map of attributes, suitable for use as the end condition of a loop over the attributes of an object.
std::string dsim_model::get_attribute | ( | const std::string & | name ) | [inherited] |
Get the value of an attribute at this object.
Returns the string value associated with the requested attribute.
name | The name of the attribute to look up. |
bool dsim_model::has_attribute | ( | const std::string & | name ) | [inherited] |
Determine whether or not an attribute for this object has been set.
Determines whether or not an attribute with a specific name has been set for this object.
name | The name of the attribute. |
void dsim_model::set_attribute | ( | const std::string & | name, |
const std::string & | value | ||
) | [inherited] |
Set an attribute at this object.
Sets the value associated with a named attribute, creating that attribute if it does not yet exist.
name | The name of the attribute. |
value | The value to associate with the attribute. |