OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
AttributeHandler Class Referenceabstract

Abstract base class for attribute parsers. More...

#include <AttributeHandler.h>

Inheritance diagram for AttributeHandler:
Inheritance graph
[legend]
Collaboration diagram for AttributeHandler:
Collaboration graph
[legend]

Public Types

enum  OwnerType {
  ELEMENT , COMMAND , SUB_COMMAND , STATEMENT ,
  NONE
}
 

Public Member Functions

 AttributeHandler (const std::string &name, const std::string &help, AttributeBase *def)
 Constructor. More...
 
virtual ~AttributeHandler ()
 
virtual AttributeHandlerclone () const
 Make clone. More...
 
virtual AttributeBasegetDefault () const
 Return default value. More...
 
virtual const std::string & getHelp () const
 Return help string. More...
 
virtual const std::string & getName () const
 Return attribute name. More...
 
virtual const std::string & getType () const =0
 Return attribute type. More...
 
virtual void parse (Attribute &a, Statement &s, bool eval) const =0
 Parse new value. More...
 
virtual void parseComponent (Attribute &a, Statement &s, bool eval, int i) const
 Parse component value. More...
 
bool isDeferred () const
 Return defer flag. More...
 
void setDeferred (bool)
 Set or reset defer flag. More...
 
bool isReadOnly () const
 Return read-only flag. More...
 
void setReadOnly (bool)
 Set or reset read-only flag. More...
 
void setPredefinedValues (const std::set< std::string > &, const std::string &)
 Add predefined strings values to the help. More...
 
- Public Member Functions inherited from RCObject
int addReference () const
 Increment reference count. More...
 
int removeReference () const
 Decrement the reference count. More...
 
bool isShared () const
 Test for sharing. More...
 

Static Public Member Functions

static std::multimap< OwnerType, std::string > getOwner (const std::string &att)
 
static void addAttributeOwner (const std::string &owner, const OwnerType &type, const std::string &name)
 

Protected Attributes

const std::string itsName
 Attribute name. More...
 
const std::string itsHelp
 Help text. More...
 
Pointer< AttributeBaseitsDefault
 Default value. More...
 
bool is_deferred
 Defer flag. More...
 
bool is_readonly
 Read-only flag. More...
 

Private Member Functions

 AttributeHandler ()
 
 AttributeHandler (const AttributeHandler &)
 
void operator= (const AttributeHandler &)
 

Static Private Attributes

static std::multimap< std::string, std::pair< OwnerType, std::string > > attributeOwnerDictionary_s
 

Additional Inherited Members

- Protected Member Functions inherited from RCObject
 RCObject ()
 Default constructor. More...
 
 RCObject (const RCObject &)
 Copy constructor. More...
 
virtual ~RCObject ()=0
 
RCObjectoperator= (const RCObject &right)
 

Detailed Description

Abstract base class for attribute parsers.

Definition at line 49 of file AttributeHandler.h.

Member Enumeration Documentation

◆ OwnerType

Enumerator
ELEMENT 
COMMAND 
SUB_COMMAND 
STATEMENT 
NONE 

Definition at line 118 of file AttributeHandler.h.

Constructor & Destructor Documentation

◆ AttributeHandler() [1/3]

AttributeHandler::AttributeHandler ( const std::string &  name,
const std::string &  help,
AttributeBase def 
)

Constructor.

Definition at line 33 of file AttributeHandler.cpp.

◆ ~AttributeHandler()

AttributeHandler::~AttributeHandler ( )
virtual

Definition at line 40 of file AttributeHandler.cpp.

◆ AttributeHandler() [2/3]

AttributeHandler::AttributeHandler ( )
private

◆ AttributeHandler() [3/3]

AttributeHandler::AttributeHandler ( const AttributeHandler )
private

Member Function Documentation

◆ addAttributeOwner()

void AttributeHandler::addAttributeOwner ( const std::string &  owner,
const OwnerType type,
const std::string &  name 
)
static

◆ clone()

AttributeHandler * AttributeHandler::clone ( ) const
virtual

Make clone.

Definition at line 44 of file AttributeHandler.cpp.

◆ getDefault()

AttributeBase * AttributeHandler::getDefault ( ) const
virtual

Return default value.

Definition at line 50 of file AttributeHandler.cpp.

References Pointer< Object >::isValid(), itsDefault, and itsName.

Referenced by Attribute::setDefault().

Here is the call graph for this function:

◆ getHelp()

const std::string & AttributeHandler::getHelp ( ) const
virtual

Return help string.

Definition at line 60 of file AttributeHandler.cpp.

References itsHelp.

Referenced by Attribute::getHelp().

◆ getName()

const std::string & AttributeHandler::getName ( ) const
virtual

Return attribute name.

Definition at line 65 of file AttributeHandler.cpp.

References itsName.

Referenced by Attribute::getName().

◆ getOwner()

std::multimap< AttributeHandler::OwnerType, std::string > AttributeHandler::getOwner ( const std::string &  att)
static

Definition at line 109 of file AttributeHandler.cpp.

References attributeOwnerDictionary_s.

Referenced by OpalParser::getHint().

◆ getType()

virtual const std::string & AttributeHandler::getType ( ) const
pure virtual

◆ isDeferred()

bool AttributeHandler::isDeferred ( ) const

Return defer flag.

Definition at line 79 of file AttributeHandler.cpp.

References is_deferred.

Referenced by Attribute::isDeferred(), and Attributes::Real::parse().

◆ isReadOnly()

bool AttributeHandler::isReadOnly ( ) const

Return read-only flag.

Definition at line 89 of file AttributeHandler.cpp.

References is_readonly.

Referenced by Attribute::isReadOnly().

◆ operator=()

void AttributeHandler::operator= ( const AttributeHandler )
private

◆ parse()

virtual void AttributeHandler::parse ( Attribute a,
Statement s,
bool  eval 
) const
pure virtual

◆ parseComponent()

void AttributeHandler::parseComponent ( Attribute a,
Statement s,
bool  eval,
int  i 
) const
virtual

◆ setDeferred()

void AttributeHandler::setDeferred ( bool  flag)

Set or reset defer flag.

Definition at line 84 of file AttributeHandler.cpp.

References is_deferred.

Referenced by Attribute::setDeferred().

◆ setPredefinedValues()

void AttributeHandler::setPredefinedValues ( const std::set< std::string > &  predefinedValues,
const std::string &  defaultValue 
)

Add predefined strings values to the help.

Definition at line 98 of file AttributeHandler.cpp.

References itsHelp.

Referenced by Attributes::PredefinedString::PredefinedString().

◆ setReadOnly()

void AttributeHandler::setReadOnly ( bool  flag)

Set or reset read-only flag.

Definition at line 94 of file AttributeHandler.cpp.

References is_readonly.

Referenced by Attribute::setReadOnly().

Member Data Documentation

◆ attributeOwnerDictionary_s

std::multimap< std::string, std::pair< AttributeHandler::OwnerType, std::string > > AttributeHandler::attributeOwnerDictionary_s
staticprivate

Definition at line 151 of file AttributeHandler.h.

Referenced by addAttributeOwner(), and getOwner().

◆ is_deferred

bool AttributeHandler::is_deferred
protected

◆ is_readonly

bool AttributeHandler::is_readonly
protected

Read-only flag.

Definition at line 142 of file AttributeHandler.h.

Referenced by isReadOnly(), and setReadOnly().

◆ itsDefault

Pointer<AttributeBase> AttributeHandler::itsDefault
protected

Default value.

Definition at line 136 of file AttributeHandler.h.

Referenced by getDefault().

◆ itsHelp

const std::string AttributeHandler::itsHelp
protected

Help text.

Definition at line 133 of file AttributeHandler.h.

Referenced by getHelp(), and setPredefinedValues().

◆ itsName

const std::string AttributeHandler::itsName
protected

Attribute name.

Definition at line 130 of file AttributeHandler.h.

Referenced by getDefault(), getName(), and parseComponent().


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