OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
Parser for an attribute of type string. More...
#include <PredefinedString.h>
Public Member Functions | |
PredefinedString (const std::string &name, const std::string &help, const std::initializer_list< std::string > &predefinedStrings, const std::string &defaultValue="_HAS_NO_DEFAULT_") | |
Constructor. More... | |
virtual | ~PredefinedString () |
virtual const std::string & | getType () const |
Return attribute type string `‘string’'. More... | |
virtual void | parse (Attribute &, Statement &, bool) const |
Parse the attribute. More... | |
Public Member Functions inherited from AttributeHandler | |
AttributeHandler (const std::string &name, const std::string &help, AttributeBase *def) | |
Constructor. More... | |
virtual | ~AttributeHandler () |
virtual AttributeHandler * | clone () const |
Make clone. More... | |
virtual AttributeBase * | getDefault () 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... | |
Private Member Functions | |
PredefinedString () | |
PredefinedString (const PredefinedString &) | |
void | operator= (const PredefinedString &) |
Private Attributes | |
std::set< std::string > | predefinedStrings_m |
Additional Inherited Members | |
Public Types inherited from AttributeHandler | |
enum | OwnerType { ELEMENT , COMMAND , SUB_COMMAND , STATEMENT , NONE } |
Static Public Member Functions inherited from AttributeHandler | |
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 Member Functions inherited from RCObject | |
RCObject () | |
Default constructor. More... | |
RCObject (const RCObject &) | |
Copy constructor. More... | |
virtual | ~RCObject ()=0 |
RCObject & | operator= (const RCObject &right) |
Protected Attributes inherited from AttributeHandler | |
const std::string | itsName |
Attribute name. More... | |
const std::string | itsHelp |
Help text. More... | |
Pointer< AttributeBase > | itsDefault |
Default value. More... | |
bool | is_deferred |
Defer flag. More... | |
bool | is_readonly |
Read-only flag. More... | |
Parser for an attribute of type string.
Definition at line 30 of file PredefinedString.h.
Attributes::PredefinedString::PredefinedString | ( | const std::string & | name, |
const std::string & | help, | ||
const std::initializer_list< std::string > & | predefinedStrings, | ||
const std::string & | defaultValue = "_HAS_NO_DEFAULT_" |
||
) |
Constructor.
Definition at line 30 of file PredefinedString.cpp.
References predefinedStrings_m, AttributeHandler::setPredefinedValues(), and Util::toUpper().
|
virtual |
Definition at line 43 of file PredefinedString.cpp.
|
private |
|
private |
|
virtual |
Return attribute type string `‘string’'.
Implements AttributeHandler.
Definition at line 47 of file PredefinedString.cpp.
|
private |
Parse the attribute.
Implements AttributeHandler.
Definition at line 52 of file PredefinedString.cpp.
References Expressions::parseStringValue(), predefinedStrings_m, Attributes::setPredefinedString(), and Util::toUpper().
|
private |
Definition at line 56 of file PredefinedString.h.
Referenced by parse(), and PredefinedString().