OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
AttributeHandler Class Referenceabstract

Abstract base class for attribute parsers. More...

#include <AttributeHandler.h>

Inheritance diagram for AttributeHandler:
Collaboration diagram for AttributeHandler:

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 AttributeHandlerclone () const
 Make clone.
virtual AttributeBasegetDefault () 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.
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< AttributeBaseitsDefault
 Default value.
bool is_deferred
 Defer flag.
bool is_readonly
 Read-only flag.

Private Member Functions

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

Private Attributes

int refCount

Static Private Attributes

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

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::~AttributeHandler ( )
virtual

Definition at line 40 of file AttributeHandler.cpp.

◆ AttributeHandler() [2/3]

AttributeHandler::AttributeHandler ( )
private

◆ AttributeHandler() [3/3]

AttributeHandler::AttributeHandler ( const AttributeHandler & )
private

References AttributeHandler().

Here is the call graph for this function:

Member Function Documentation

◆ addAttributeOwner()

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

◆ addReference()

int RCObject::addReference ( ) const
inlineinherited

Increment reference count.

Definition at line 83 of file RCObject.h.

References refCount.

Referenced by Pointer< Object >::operator=(), Pointer< Object >::operator=(), and Pointer< Object >::unique().

◆ clone()

AttributeHandler * AttributeHandler::clone ( ) const
virtual

Make clone.

Definition at line 44 of file AttributeHandler.cpp.

References AttributeHandler().

Here is the call graph for this function:

◆ getDefault()

AttributeBase * AttributeHandler::getDefault ( ) const
virtual

Return default value.

Definition at line 50 of file AttributeHandler.cpp.

References itsDefault, and itsName.

◆ getHelp()

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

Return help string.

Definition at line 60 of file AttributeHandler.cpp.

References itsHelp.

◆ getName()

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

Return attribute name.

Definition at line 65 of file AttributeHandler.cpp.

References itsName.

◆ 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()

◆ isDeferred()

bool AttributeHandler::isDeferred ( ) const

Return defer flag.

Definition at line 79 of file AttributeHandler.cpp.

References is_deferred.

Referenced by Attributes::Real::parse().

◆ isReadOnly()

bool AttributeHandler::isReadOnly ( ) const

Return read-only flag.

Definition at line 89 of file AttributeHandler.cpp.

References is_readonly.

◆ isShared()

bool RCObject::isShared ( ) const
inlineinherited

Test for sharing.

Definition at line 93 of file RCObject.h.

References refCount.

◆ operator=()

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

References AttributeHandler().

Here is the call graph for this function:

◆ parse()

◆ parseComponent()

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

◆ removeReference()

int RCObject::removeReference ( ) const
inlineinherited

Decrement the reference count.

Definition at line 88 of file RCObject.h.

References refCount.

◆ setDeferred()

void AttributeHandler::setDeferred ( bool flag)

Set or reset defer flag.

Definition at line 84 of file AttributeHandler.cpp.

References is_deferred.

◆ 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.

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 AttributeHandler(), isReadOnly(), and setReadOnly().

◆ itsDefault

Pointer<AttributeBase> AttributeHandler::itsDefault
protected

Default value.

Definition at line 136 of file AttributeHandler.h.

Referenced by AttributeHandler(), and getDefault().

◆ itsHelp

const std::string AttributeHandler::itsHelp
protected

Help text.

Definition at line 133 of file AttributeHandler.h.

Referenced by AttributeHandler(), getHelp(), and setPredefinedValues().

◆ itsName

const std::string AttributeHandler::itsName
protected

Attribute name.

Definition at line 130 of file AttributeHandler.h.

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

◆ refCount

int RCObject::refCount
mutableprivateinherited

Definition at line 76 of file RCObject.h.

Referenced by addReference(), isShared(), RCObject(), RCObject(), and removeReference().


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