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

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.
 
const std::string itsHelp
 Help text.
 
Pointer< AttributeBase > itsDefault
 Default value.
 
bool is_deferred
 Defer flag.
 
bool is_readonly
 Read-only flag.
 

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.
 
 RCObject (const RCObject &)
 Copy constructor.
 
virtual ~RCObject ()=0
 
RCObject & operator= (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 117 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 32 of file AttributeHandler.cpp.

◆ ~AttributeHandler()

AttributeHandler::~AttributeHandler ( )
virtual

Definition at line 39 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 43 of file AttributeHandler.cpp.

◆ getDefault()

AttributeBase * AttributeHandler::getDefault ( ) const
virtual

Return default value.

Definition at line 49 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 59 of file AttributeHandler.cpp.

References itsHelp.

Referenced by Attribute::getHelp().

◆ getName()

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

Return attribute name.

Definition at line 64 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 108 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 78 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 88 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 83 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 97 of file AttributeHandler.cpp.

References itsHelp, and Util::join().

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

Here is the call graph for this function:

◆ setReadOnly()

void AttributeHandler::setReadOnly ( bool  flag)

Set or reset read-only flag.

Definition at line 93 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 149 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 141 of file AttributeHandler.h.

Referenced by isReadOnly(), and setReadOnly().

◆ itsDefault

Pointer<AttributeBase> AttributeHandler::itsDefault
protected

Default value.

Definition at line 135 of file AttributeHandler.h.

Referenced by getDefault().

◆ itsHelp

const std::string AttributeHandler::itsHelp
protected

Help text.

Definition at line 132 of file AttributeHandler.h.

Referenced by getHelp(), and setPredefinedValues().

◆ itsName

const std::string AttributeHandler::itsName
protected

Attribute name.

Definition at line 129 of file AttributeHandler.h.

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


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