|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
Abstract base class for attribute parsers. More...
#include <AttributeHandler.h>
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. | |
| 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 &) |
Private Attributes | |
| int | refCount |
Static Private Attributes | |
| static std::multimap< std::string, std::pair< OwnerType, std::string > > | attributeOwnerDictionary_s |
Abstract base class for attribute parsers.
Definition at line 49 of file AttributeHandler.h.
| Enumerator | |
|---|---|
| ELEMENT | |
| COMMAND | |
| SUB_COMMAND | |
| STATEMENT | |
| NONE | |
Definition at line 118 of file AttributeHandler.h.
| AttributeHandler::AttributeHandler | ( | const std::string & | name, |
| const std::string & | help, | ||
| AttributeBase * | def ) |
Constructor.
Definition at line 33 of file AttributeHandler.cpp.
References is_deferred, is_readonly, itsDefault, itsHelp, itsName, name, and RCObject::RCObject().
Referenced by AttributeHandler(), Attributes::Bool::Bool(), Attributes::BoolArray::BoolArray(), clone(), operator=(), Attributes::Place::Place(), Attributes::PredefinedString::PredefinedString(), Attributes::Range::Range(), Attributes::Real::Real(), Attributes::RealArray::RealArray(), Attributes::Reference::Reference(), Attributes::String::String(), Attributes::StringArray::StringArray(), Attributes::TableRow::TableRow(), Attributes::TokenList::TokenList(), Attributes::TokenListArray::TokenListArray(), Attributes::UpperCaseString::UpperCaseString(), and Attributes::UpperCaseStringArray::UpperCaseStringArray().
|
virtual |
Definition at line 40 of file AttributeHandler.cpp.
|
private |
|
private |
|
static |
Definition at line 125 of file AttributeHandler.cpp.
References attributeOwnerDictionary_s, and name.
Referenced by OpalElement::OpalElement(), Object::registerOwnership(), OpalElement::registerOwnership(), and TrackCmd::TrackCmd().
|
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().
|
virtual |
Make clone.
Definition at line 44 of file AttributeHandler.cpp.
References AttributeHandler().
|
virtual |
Return default value.
Definition at line 50 of file AttributeHandler.cpp.
References itsDefault, and itsName.
|
virtual |
|
virtual |
|
static |
Definition at line 109 of file AttributeHandler.cpp.
References attributeOwnerDictionary_s.
Referenced by OpalParser::getHint().
|
pure virtual |
Return attribute type.
Implemented in Attributes::Bool, Attributes::BoolArray, Attributes::Place, Attributes::PredefinedString, Attributes::Range, Attributes::Real, Attributes::RealArray, Attributes::Reference, Attributes::String, Attributes::StringArray, Attributes::TableRow, Attributes::TokenList, Attributes::TokenListArray, Attributes::UpperCaseString, and Attributes::UpperCaseStringArray.
| bool AttributeHandler::isDeferred | ( | ) | const |
Return defer flag.
Definition at line 79 of file AttributeHandler.cpp.
References is_deferred.
Referenced by Attributes::Real::parse().
| bool AttributeHandler::isReadOnly | ( | ) | const |
|
inlineinherited |
|
private |
Parse new value.
Implemented in Attributes::Bool, Attributes::BoolArray, Attributes::Place, Attributes::PredefinedString, Attributes::Range, Attributes::Real, Attributes::RealArray, Attributes::Reference, Attributes::String, Attributes::StringArray, Attributes::TableRow, Attributes::TokenList, Attributes::TokenListArray, Attributes::UpperCaseString, and Attributes::UpperCaseStringArray.
References a.
|
virtual |
Parse component value.
Reimplemented in Attributes::BoolArray, Attributes::RealArray, Attributes::StringArray, Attributes::TokenListArray, and Attributes::UpperCaseStringArray.
Definition at line 70 of file AttributeHandler.cpp.
References itsName.
|
inlineinherited |
| void AttributeHandler::setDeferred | ( | bool | flag | ) |
Set or reset defer flag.
Definition at line 84 of file AttributeHandler.cpp.
References is_deferred.
| 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().
| void AttributeHandler::setReadOnly | ( | bool | flag | ) |
Set or reset read-only flag.
Definition at line 94 of file AttributeHandler.cpp.
References is_readonly.
|
staticprivate |
Definition at line 151 of file AttributeHandler.h.
Referenced by addAttributeOwner(), and getOwner().
|
protected |
Defer flag.
Definition at line 139 of file AttributeHandler.h.
Referenced by AttributeHandler(), isDeferred(), Attributes::Bool::parse(), Attributes::BoolArray::parse(), Attributes::RealArray::parse(), and setDeferred().
|
protected |
Read-only flag.
Definition at line 142 of file AttributeHandler.h.
Referenced by AttributeHandler(), isReadOnly(), and setReadOnly().
|
protected |
Default value.
Definition at line 136 of file AttributeHandler.h.
Referenced by AttributeHandler(), and getDefault().
|
protected |
Help text.
Definition at line 133 of file AttributeHandler.h.
Referenced by AttributeHandler(), getHelp(), and setPredefinedValues().
|
protected |
Attribute name.
Definition at line 130 of file AttributeHandler.h.
Referenced by AttributeHandler(), getDefault(), getName(), and parseComponent().
|
mutableprivateinherited |
Definition at line 76 of file RCObject.h.
Referenced by addReference(), isShared(), RCObject(), RCObject(), and removeReference().