OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Private Attributes | List of all members
Attribute Class Reference

A representation of an Object attribute. More...

#include <Attribute.h>

Collaboration diagram for Attribute:
Collaboration graph
[legend]

Public Member Functions

 Attribute ()
 Default constructor. More...
 
 Attribute (const Attribute &rhs)
 Copy constructor. More...
 
 Attribute (AttributeHandler *h, AttributeBase *b=nullptr)
 Constructor defining a parser and an optional value. More...
 
 ~Attribute ()
 
const Attributeoperator= (const Attribute &)
 
 operator bool () const
 Test for valid pointer. More...
 
AttributeBasegetBase () const
 Return reference to polymorphic value. More...
 
bool isBaseAllocated () const
 
std::string getImage () const
 Return printable representation. More...
 
AttributeHandlergetHandler () const
 Return a reference to the parser. More...
 
const std::string & getHelp () const
 Return the help string. More...
 
const std::string & getName () const
 Return the attribute name. More...
 
const std::string & getType () const
 Return the attribute type. More...
 
bool isDeferred () const
 Return [b]deferred[/b] flag. More...
 
void setDeferred (bool)
 Set read-only flag. More...
 
bool isExpression () const
 Test for expression. More...
 
bool isReadOnly () const
 Test for read only. More...
 
void setReadOnly (bool)
 Set read-only flag. More...
 
void parse (Statement &stat, bool eval)
 Parse attribute. More...
 
void parseComponent (Statement &stat, bool eval, int index)
 Parse array component. More...
 
void set (AttributeBase *newBase)
 Define new value. More...
 
void setDefault ()
 Assign default value. More...
 
void print (int &len) const
 Print attribute. More...
 
bool defaultUsed () const
 

Private Attributes

Pointer< AttributeBasebase
 
Pointer< AttributeHandlerhandler
 
bool isDefault
 

Detailed Description

A representation of an Object attribute.

Definition at line 52 of file Attribute.h.

Constructor & Destructor Documentation

◆ Attribute() [1/3]

Attribute::Attribute ( )

Default constructor.

Definition at line 34 of file Attribute.cpp.

◆ Attribute() [2/3]

Attribute::Attribute ( const Attribute rhs)

Copy constructor.

Definition at line 41 of file Attribute.cpp.

◆ Attribute() [3/3]

Attribute::Attribute ( AttributeHandler h,
AttributeBase b = nullptr 
)

Constructor defining a parser and an optional value.

Definition at line 48 of file Attribute.cpp.

◆ ~Attribute()

Attribute::~Attribute ( )

Definition at line 55 of file Attribute.cpp.

Member Function Documentation

◆ defaultUsed()

bool Attribute::defaultUsed ( ) const
inline

Definition at line 173 of file Attribute.h.

References isDefault.

◆ getBase()

AttributeBase & Attribute::getBase ( ) const

◆ getHandler()

AttributeHandler & Attribute::getHandler ( ) const

◆ getHelp()

const std::string & Attribute::getHelp ( ) const

Return the help string.

Definition at line 82 of file Attribute.cpp.

References AttributeHandler::getHelp(), and handler.

Here is the call graph for this function:

◆ getImage()

std::string Attribute::getImage ( ) const

Return printable representation.

Definition at line 87 of file Attribute.cpp.

References base, and AttributeBase::getImage().

Referenced by print(), and OpalElement::printMultipoleStrength().

Here is the call graph for this function:

◆ getName()

const std::string & Attribute::getName ( ) const

◆ getType()

const std::string & Attribute::getType ( ) const

Return the attribute type.

Definition at line 97 of file Attribute.cpp.

References AttributeHandler::getType(), and handler.

Here is the call graph for this function:

◆ isBaseAllocated()

bool Attribute::isBaseAllocated ( ) const

◆ isDeferred()

bool Attribute::isDeferred ( ) const

Return [b]deferred[/b] flag.

Definition at line 102 of file Attribute.cpp.

References handler, and AttributeHandler::isDeferred().

Here is the call graph for this function:

◆ isExpression()

bool Attribute::isExpression ( ) const

Test for expression.

Definition at line 112 of file Attribute.cpp.

References base, and AttributeBase::isExpression().

Referenced by print().

Here is the call graph for this function:

◆ isReadOnly()

bool Attribute::isReadOnly ( ) const

Test for read only.

Definition at line 117 of file Attribute.cpp.

References handler, and AttributeHandler::isReadOnly().

Here is the call graph for this function:

◆ operator bool()

Attribute::operator bool ( ) const
inline

Test for valid pointer.

Definition at line 169 of file Attribute.h.

◆ operator=()

const Attribute & Attribute::operator= ( const Attribute rhs)

Definition at line 59 of file Attribute.cpp.

References base, and handler.

◆ parse()

void Attribute::parse ( Statement stat,
bool  eval 
)

Parse attribute.

Definition at line 127 of file Attribute.cpp.

References handler, isDefault, and AttributeHandler::parse().

Referenced by IfStatement::execute(), WhileStatement::execute(), and OpalElement::parse().

Here is the call graph for this function:

◆ parseComponent()

void Attribute::parseComponent ( Statement stat,
bool  eval,
int  index 
)

Parse array component.

Definition at line 133 of file Attribute.cpp.

References handler, isDefault, and AttributeHandler::parseComponent().

Referenced by OpalElement::parse().

Here is the call graph for this function:

◆ print()

void Attribute::print ( int &  len) const

Print attribute.

Definition at line 151 of file Attribute.cpp.

References endl(), getImage(), getName(), gmsg, isExpression(), and name.

Here is the call graph for this function:

◆ set()

void Attribute::set ( AttributeBase newBase)

◆ setDefault()

void Attribute::setDefault ( )

Assign default value.

Definition at line 145 of file Attribute.cpp.

References base, AttributeHandler::getDefault(), handler, and isDefault.

Referenced by OpalElement::parse().

Here is the call graph for this function:

◆ setDeferred()

void Attribute::setDeferred ( bool  flag)

Set read-only flag.

Definition at line 107 of file Attribute.cpp.

References handler, and AttributeHandler::setDeferred().

Here is the call graph for this function:

◆ setReadOnly()

void Attribute::setReadOnly ( bool  flag)

Set read-only flag.

Definition at line 122 of file Attribute.cpp.

References handler, and AttributeHandler::setReadOnly().

Here is the call graph for this function:

Member Data Documentation

◆ base

Pointer<AttributeBase> Attribute::base
private

Definition at line 157 of file Attribute.h.

Referenced by getBase(), getImage(), isBaseAllocated(), isExpression(), operator=(), set(), and setDefault().

◆ handler

Pointer<AttributeHandler> Attribute::handler
private

◆ isDefault

bool Attribute::isDefault
private

Definition at line 162 of file Attribute.h.

Referenced by defaultUsed(), parse(), parseComponent(), set(), and setDefault().


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