OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Attributes::PredefinedString Class Reference

Parser for an attribute of type string. More...

#include <PredefinedString.h>

Inheritance diagram for Attributes::PredefinedString:
Inheritance graph
Collaboration diagram for Attributes::PredefinedString:
Collaboration graph

Public Types

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

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

 PredefinedString ()
 
 PredefinedString (const PredefinedString &)
 
void operator= (const PredefinedString &)
 

Private Attributes

std::set< std::string > predefinedStrings_m
 
int refCount
 

Static Private Attributes

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

Detailed Description

Parser for an attribute of type string.

Definition at line 30 of file PredefinedString.h.

Member Enumeration Documentation

◆ OwnerType

Enumerator
ELEMENT 
COMMAND 
SUB_COMMAND 
STATEMENT 
NONE 

Definition at line 118 of file AttributeHandler.h.

Constructor & Destructor Documentation

◆ PredefinedString() [1/3]

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

Here is the call graph for this function:

◆ ~PredefinedString()

Attributes::PredefinedString::~PredefinedString ( )
virtual

Definition at line 43 of file PredefinedString.cpp.

◆ PredefinedString() [2/3]

Attributes::PredefinedString::PredefinedString ( )
private

◆ PredefinedString() [3/3]

Attributes::PredefinedString::PredefinedString ( const PredefinedString )
private

Member Function Documentation

◆ addAttributeOwner()

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

◆ addReference()

int RCObject::addReference ( ) const
inlineinherited

Increment reference count.

Definition at line 83 of file RCObject.h.

References RCObject::refCount.

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

◆ clone()

AttributeHandler * AttributeHandler::clone ( ) const
virtualinherited

Make clone.

Definition at line 44 of file AttributeHandler.cpp.

◆ getDefault()

AttributeBase * AttributeHandler::getDefault ( ) const
virtualinherited

Return default value.

Definition at line 50 of file AttributeHandler.cpp.

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

Referenced by Attribute::setDefault().

Here is the call graph for this function:

◆ getHelp()

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

Return help string.

Definition at line 60 of file AttributeHandler.cpp.

References AttributeHandler::itsHelp.

Referenced by Attribute::getHelp().

◆ getName()

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

Return attribute name.

Definition at line 65 of file AttributeHandler.cpp.

References AttributeHandler::itsName.

Referenced by Attribute::getName().

◆ getOwner()

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

Definition at line 109 of file AttributeHandler.cpp.

References AttributeHandler::attributeOwnerDictionary_s.

Referenced by OpalParser::getHint().

◆ getType()

const std::string & Attributes::PredefinedString::getType ( ) const
virtual

Return attribute type string `‘string’'.

Implements AttributeHandler.

Definition at line 47 of file PredefinedString.cpp.

◆ isDeferred()

bool AttributeHandler::isDeferred ( ) const
inherited

Return defer flag.

Definition at line 79 of file AttributeHandler.cpp.

References AttributeHandler::is_deferred.

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

◆ isReadOnly()

bool AttributeHandler::isReadOnly ( ) const
inherited

Return read-only flag.

Definition at line 89 of file AttributeHandler.cpp.

References AttributeHandler::is_readonly.

Referenced by Attribute::isReadOnly().

◆ isShared()

bool RCObject::isShared ( ) const
inlineinherited

Test for sharing.

Definition at line 93 of file RCObject.h.

References RCObject::refCount.

◆ operator=()

void Attributes::PredefinedString::operator= ( const PredefinedString )
private

◆ parse()

void Attributes::PredefinedString::parse ( Attribute attr,
Statement stat,
bool   
) const
virtual

Parse the attribute.

Implements AttributeHandler.

Definition at line 52 of file PredefinedString.cpp.

References Expressions::parseStringValue(), predefinedStrings_m, Attributes::setPredefinedString(), and Util::toUpper().

Here is the call graph for this function:

◆ parseComponent()

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

◆ removeReference()

int RCObject::removeReference ( ) const
inlineinherited

Decrement the reference count.

Definition at line 88 of file RCObject.h.

References RCObject::refCount.

◆ setDeferred()

void AttributeHandler::setDeferred ( bool  flag)
inherited

Set or reset defer flag.

Definition at line 84 of file AttributeHandler.cpp.

References AttributeHandler::is_deferred.

Referenced by Attribute::setDeferred().

◆ setPredefinedValues()

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

Add predefined strings values to the help.

Definition at line 98 of file AttributeHandler.cpp.

References AttributeHandler::itsHelp.

Referenced by PredefinedString().

◆ setReadOnly()

void AttributeHandler::setReadOnly ( bool  flag)
inherited

Set or reset read-only flag.

Definition at line 94 of file AttributeHandler.cpp.

References AttributeHandler::is_readonly.

Referenced by Attribute::setReadOnly().

Member Data Documentation

◆ attributeOwnerDictionary_s

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

◆ is_deferred

bool AttributeHandler::is_deferred
protectedinherited

◆ is_readonly

bool AttributeHandler::is_readonly
protectedinherited

Read-only flag.

Definition at line 142 of file AttributeHandler.h.

Referenced by AttributeHandler::isReadOnly(), and AttributeHandler::setReadOnly().

◆ itsDefault

Pointer<AttributeBase> AttributeHandler::itsDefault
protectedinherited

Default value.

Definition at line 136 of file AttributeHandler.h.

Referenced by AttributeHandler::getDefault().

◆ itsHelp

const std::string AttributeHandler::itsHelp
protectedinherited

◆ itsName

const std::string AttributeHandler::itsName
protectedinherited

◆ predefinedStrings_m

std::set<std::string> Attributes::PredefinedString::predefinedStrings_m
private

Definition at line 56 of file PredefinedString.h.

Referenced by parse(), and PredefinedString().

◆ refCount

int RCObject::refCount
mutableprivateinherited

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