Version: 8.3.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 ( )
virtual

Definition at line 33 of file PropertyInterface.cxx.

34 {
35 }

Member Function Documentation

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.

References DEBTRACE.

49 {
50  DEBTRACE("PropertyInterface::getProperty " << name );
51  return _propertyMap[name];
52 }
void PropertyInterface::setProperties ( std::map< std::string, std::string >  properties)
virtual

Definition at line 54 of file PropertyInterface.cxx.

References DEBTRACE.

Referenced by YACS::HMI::CommandSetComponentInstanceProperties::localExecute(), and YACS::HMI::CommandSetComponentInstanceProperties::localReverse().

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 }
void PropertyInterface::setProperty ( const std::string &  name,
const std::string &  value 
)
virtual

Definition at line 37 of file PropertyInterface.cxx.

References DEBTRACE.

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

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

Member Data Documentation

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

Definition at line 42 of file PropertyInterface.hxx.


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