OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Attribute Class Reference

A representation of an Object attribute. More...

#include <Attribute.h>

Collaboration diagram for Attribute:

Public Member Functions

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

References base, handler, and isDefault.

Referenced by Attribute(), and operator=().

◆ Attribute() [2/3]

Attribute::Attribute ( const Attribute & rhs)

Copy constructor.

Definition at line 41 of file Attribute.cpp.

References Attribute(), base, handler, and isDefault.

Here is the call graph for this function:

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

References base, handler, and isDefault.

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

◆ getHandler()

◆ getHelp()

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

Return the help string.

Definition at line 82 of file Attribute.cpp.

References handler.

Referenced by PyOpal::PyOpalObjectNS::PyOpalObject< C >::getDocString().

◆ getImage()

std::string Attribute::getImage ( ) const

Return printable representation.

Definition at line 87 of file Attribute.cpp.

References base.

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

◆ getName()

◆ getType()

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

Return the attribute type.

Definition at line 97 of file Attribute.cpp.

References handler.

◆ isBaseAllocated()

◆ isDeferred()

bool Attribute::isDeferred ( ) const

Return [b]deferred[/b] flag.

Definition at line 102 of file Attribute.cpp.

References handler.

◆ isExpression()

bool Attribute::isExpression ( ) const

Test for expression.

Definition at line 112 of file Attribute.cpp.

References base.

Referenced by print().

◆ isReadOnly()

bool Attribute::isReadOnly ( ) const

Test for read only.

Definition at line 117 of file Attribute.cpp.

References handler.

◆ operator bool()

Attribute::operator bool ( ) const
inline

Test for valid pointer.

Definition at line 169 of file Attribute.h.

References base.

◆ operator=()

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

Definition at line 59 of file Attribute.cpp.

References Attribute(), base, and handler.

Here is the call graph for this function:

◆ parse()

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

Parse attribute.

Definition at line 127 of file Attribute.cpp.

References handler, and isDefault.

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

◆ parseComponent()

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

Parse array component.

Definition at line 133 of file Attribute.cpp.

References handler, and isDefault.

Referenced by OpalElement::parse().

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

◆ setDefault()

void Attribute::setDefault ( )

Assign default value.

Definition at line 145 of file Attribute.cpp.

References base, handler, and isDefault.

Referenced by Line::parse(), and OpalElement::parse().

◆ setDeferred()

void Attribute::setDeferred ( bool flag)

Set read-only flag.

Definition at line 107 of file Attribute.cpp.

References handler.

◆ setReadOnly()

void Attribute::setReadOnly ( bool flag)

Set read-only flag.

Definition at line 122 of file Attribute.cpp.

References handler.

Member Data Documentation

◆ base

◆ handler

◆ isDefault

bool Attribute::isDefault
private

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