Version: 9.16.0
YACS::ENGINE::PropertyInterface Class Reference

Class for adding property interface to another class. More...

#include <PropertyInterface.hxx>

Inheritance diagram for YACS::ENGINE::PropertyInterface:
Collaboration diagram for YACS::ENGINE::PropertyInterface:

Public Member Functions

virtual ~PropertyInterface ()
 
virtual void setProperty (const std::string &name, const std::string &value)
 
virtual std::string getProperty (const std::string &name)
 Get a property value given its name. More...
 
std::map< std::string, std::string > getProperties () const
 
virtual void setProperties (std::map< std::string, std::string > properties)
 

Protected Attributes

std::map< std::string, std::string > _propertyMap
 

Detailed Description

Class for adding property interface to another class.

Definition at line 32 of file PropertyInterface.hxx.

Constructor & Destructor Documentation

◆ ~PropertyInterface()

PropertyInterface::~PropertyInterface ( )
virtual

Definition at line 33 of file PropertyInterface.cxx.

34{
35}

Member Function Documentation

◆ getProperties()

std::map< std::string, std::string > YACS::ENGINE::PropertyInterface::getProperties ( ) const
inline

◆ getProperty()

std::string PropertyInterface::getProperty ( const std::string &  name)
virtual

Get a property value given its name.

Parameters
name: the property name
Returns
the property value

Definition at line 48 of file PropertyInterface.cxx.

49{
50 DEBTRACE("PropertyInterface::getProperty " << name );
51 return _propertyMap[name];
52}
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31

References _propertyMap, and DEBTRACE.

◆ setProperties()

void PropertyInterface::setProperties ( std::map< std::string, std::string >  properties)
virtual

Definition at line 54 of file PropertyInterface.cxx.

55{
56 DEBTRACE("PropertyInterface::setProperties " );
57 _propertyMap.clear();
58 std::map<std::string,std::string>::iterator it;
59 for (it = properties.begin(); it != properties.end(); ++it)
60 {
61 setProperty(it->first, it->second); // setProperty virtual and derived
62 }
63}
virtual void setProperty(const std::string &name, const std::string &value)

References _propertyMap, DEBTRACE, and setProperty().

◆ setProperty()

void PropertyInterface::setProperty ( const std::string &  name,
const std::string &  value 
)
virtual

Definition at line 37 of file PropertyInterface.cxx.

38{
39 DEBTRACE("PropertyInterface::setProperty " << name << " " << value);
40 _propertyMap[name]=value;
41}

References _propertyMap, and DEBTRACE.

Referenced by YACS::proctypeParser< T >::componentinstance(), and setProperties().

Member Data Documentation

◆ _propertyMap

std::map<std::string,std::string> YACS::ENGINE::PropertyInterface::_propertyMap
protected

Definition at line 42 of file PropertyInterface.hxx.

Referenced by getProperty(), setProperties(), and setProperty().


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