Functions

Model Attributes

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.

Detailed Description

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.


Function Documentation

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.

Returns:
The begin() iterator for the map.
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.

Returns:
The end() iterator for the map.
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.

Parameters:
nameThe name of the attribute to look up.
Returns:
The value for the requested attribute, or an empty string if the attribute does not exist. If you need to distinquish non-existence with empty-string values, use the has_attribute() function.
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.

Parameters:
nameThe name of the attribute.
Returns:
Returns true if an attribute with the given name has been set, or false if not.
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.

Parameters:
nameThe name of the attribute.
valueThe value to associate with the attribute.
 All Classes Files Functions Typedefs Enumerations Enumerator