SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | Protected Attributes | List of all members
smtk::view::Configuration::Component Class Reference

Configure one item in a view, which may contain children. More...

#include <Configuration.h>

Collaboration diagram for smtk::view::Configuration::Component:
[legend]

Public Member Functions

 Component (const std::string &myName)
 
const std::string & name () const
 
const std::string & contents () const
 
bool contentsAsVector (std::vector< double > &vec) const
 
bool contentsAsInt (int &val) const
 
ComponentsetContents (const std::string &c)
 
ComponentsetAttribute (const std::string &attname, const std::string &value)
 
ComponentunsetAttribute (const std::string &attname)
 
bool attribute (const std::string &attname, std::string &value) const
 Returns true if the component has an attribute called name and will set value to the attribute's values. More...
 
bool attribute (const std::string &attname) const
 Simply tests to see if the attribute exists.
 
bool attributeAsBool (const std::string &attname, bool &value) const
 Returns true if the component has an attribute called name and if it has the string value of true, t, false, or f (ignoring case). More...
 
bool attributeAsBool (const std::string &attname) const
 Returns true if the component has an attribute called name and if it's value is either t or true (ignoring case). More...
 
std::string attributeAsString (const std::string &attname) const
 Returns the value of the attribute named attname as a string. More...
 
bool attributeAsInt (const std::string &attname, int &val) const
 
bool attributeAsDouble (const std::string &attname, double &val) const
 
const std::map< std::string, std::string > & attributes () const
 
ComponentaddChild (const std::string &childName)
 
void copyContents (const Component &comp)
 
const std::vector< Component > & children () const
 
std::vector< Component > & children ()
 
std::size_t numberOfChildren () const
 
Componentchild (std::size_t i)
 
const Componentchild (std::size_t i) const
 
int findChild (const std::string &compName) const
 
bool operator== (const Component &other) const
 

Protected Attributes

std::string m_name
 
std::string m_contents
 
std::map< std::string, std::string > m_attributes
 
std::vector< Componentm_children
 

Detailed Description

Configure one item in a view, which may contain children.

Member Function Documentation

◆ attribute()

bool smtk::view::Configuration::Component::attribute ( const std::string &  attname,
std::string &  value 
) const

Returns true if the component has an attribute called name and will set value to the attribute's values.

Else it returns false

◆ attributeAsBool() [1/2]

bool smtk::view::Configuration::Component::attributeAsBool ( const std::string &  attname) const

Returns true if the component has an attribute called name and if it's value is either t or true (ignoring case).

Else it returns false.

◆ attributeAsBool() [2/2]

bool smtk::view::Configuration::Component::attributeAsBool ( const std::string &  attname,
bool &  value 
) const

Returns true if the component has an attribute called name and if it has the string value of true, t, false, or f (ignoring case).

Value will be true if the attribute is t or true, false if attribute is f or false and not set otherwise set value to the attribute's values. Else it returns false

◆ attributeAsString()

std::string smtk::view::Configuration::Component::attributeAsString ( const std::string &  attname) const

Returns the value of the attribute named attname as a string.

It will return an empty string if the attribute does not exists


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