OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Types | Public Member Functions | Protected Attributes | List of all members
AttributeSet Class Reference

Map of std::string versus double value. More...

#include <AttributeSet.h>

Public Types

typedef std::map< std::string, double, std::less< std::string > > NameMap
 A map of name versus value. More...
 
typedef NameMap::const_iterator const_iterator
 An iterator for a map of name versus value. More...
 

Public Member Functions

 AttributeSet ()
 Default constructor. More...
 
 AttributeSet (const AttributeSet &)
 
virtual ~AttributeSet ()
 
const AttributeSetoperator= (const AttributeSet &)
 
const_iterator begin () const
 Iterator accessing first member. More...
 
const_iterator end () const
 Iterator marking the end of the list. More...
 
double getAttribute (const std::string &aKey) const
 Get attribute value. More...
 
bool hasAttribute (const std::string &aKey) const
 Test for presence of an attribute. More...
 
void removeAttribute (const std::string &aKey)
 Remove an existing attribute. More...
 
void setAttribute (const std::string &aKey, double val)
 Set value of an attribute. More...
 
ChannelgetChannel (const std::string &aKey, bool create=false)
 Construct a read/write channel. More...
 
const ConstChannelgetConstChannel (const std::string &aKey) const
 Construct a read-only channel. More...
 

Protected Attributes

NameMap itsMap
 The attribute map. More...
 

Detailed Description

Map of std::string versus double value.

Definition at line 41 of file AttributeSet.h.

Member Typedef Documentation

◆ const_iterator

typedef NameMap::const_iterator AttributeSet::const_iterator

An iterator for a map of name versus value.

Definition at line 49 of file AttributeSet.h.

◆ NameMap

typedef std::map<std::string, double, std::less<std::string> > AttributeSet::NameMap

A map of name versus value.

Definition at line 46 of file AttributeSet.h.

Constructor & Destructor Documentation

◆ AttributeSet() [1/2]

AttributeSet::AttributeSet ( )

Default constructor.

Definition at line 30 of file AttributeSet.cpp.

◆ AttributeSet() [2/2]

AttributeSet::AttributeSet ( const AttributeSet rhs)

Definition at line 35 of file AttributeSet.cpp.

◆ ~AttributeSet()

AttributeSet::~AttributeSet ( )
virtual

Definition at line 40 of file AttributeSet.cpp.

Member Function Documentation

◆ begin()

AttributeSet::const_iterator AttributeSet::begin ( ) const
inline

Iterator accessing first member.

Definition at line 105 of file AttributeSet.h.

References itsMap.

Referenced by ElementBase::update().

◆ end()

AttributeSet::const_iterator AttributeSet::end ( ) const
inline

Iterator marking the end of the list.

Definition at line 108 of file AttributeSet.h.

References itsMap.

Referenced by ElementBase::update().

◆ getAttribute()

double AttributeSet::getAttribute ( const std::string &  aKey) const

Get attribute value.

Definition at line 50 of file AttributeSet.cpp.

References itsMap.

◆ getChannel()

Channel * AttributeSet::getChannel ( const std::string &  aKey,
bool  create = false 
)

Construct a read/write channel.

Definition at line 79 of file AttributeSet.cpp.

References itsMap.

Referenced by ElementBase::getChannel(), and getConstChannel().

◆ getConstChannel()

const ConstChannel * AttributeSet::getConstChannel ( const std::string &  aKey) const

Construct a read-only channel.

Definition at line 95 of file AttributeSet.cpp.

References getChannel().

Here is the call graph for this function:

◆ hasAttribute()

bool AttributeSet::hasAttribute ( const std::string &  aKey) const

Test for presence of an attribute.

Definition at line 61 of file AttributeSet.cpp.

References itsMap.

◆ operator=()

const AttributeSet & AttributeSet::operator= ( const AttributeSet rhs)

Definition at line 44 of file AttributeSet.cpp.

References itsMap.

◆ removeAttribute()

void AttributeSet::removeAttribute ( const std::string &  aKey)

Remove an existing attribute.

Definition at line 66 of file AttributeSet.cpp.

References itsMap.

Referenced by ElementBase::removeAttribute().

◆ setAttribute()

void AttributeSet::setAttribute ( const std::string &  aKey,
double  val 
)

Set value of an attribute.

Definition at line 71 of file AttributeSet.cpp.

References itsMap.

Member Data Documentation

◆ itsMap

NameMap AttributeSet::itsMap
protected

The attribute map.

Definition at line 98 of file AttributeSet.h.

Referenced by begin(), end(), getAttribute(), getChannel(), hasAttribute(), operator=(), removeAttribute(), and setAttribute().


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