OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Attribute Class Reference

A representation of an Object attribute. More...

#include <Attribute.h>

Collaboration diagram for Attribute:
Collaboration graph

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

std::shared_ptr< AttributeBasebase
 
std::shared_ptr< 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 33 of file Attribute.cpp.

◆ Attribute() [2/3]

Attribute::Attribute ( const Attribute rhs)

Copy constructor.

Definition at line 35 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 38 of file Attribute.cpp.

◆ ~Attribute()

Attribute::~Attribute ( )

Definition at line 41 of file Attribute.cpp.

Member Function Documentation

◆ defaultUsed()

bool Attribute::defaultUsed ( ) const
inline

Definition at line 168 of file Attribute.h.

References isDefault.

◆ getBase()

◆ getHandler()

◆ getHelp()

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

Return the help string.

Definition at line 58 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 60 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 64 of file Attribute.cpp.

References handler.

◆ isBaseAllocated()

◆ isDeferred()

bool Attribute::isDeferred ( ) const

Return [b]deferred[/b] flag.

Definition at line 66 of file Attribute.cpp.

References handler.

◆ isExpression()

bool Attribute::isExpression ( ) const

Test for expression.

Definition at line 70 of file Attribute.cpp.

References base.

Referenced by print().

◆ isReadOnly()

bool Attribute::isReadOnly ( ) const

Test for read only.

Definition at line 72 of file Attribute.cpp.

References handler.

◆ operator bool()

Attribute::operator bool ( ) const
inline

Test for valid pointer.

Definition at line 166 of file Attribute.h.

◆ operator=()

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

Definition at line 43 of file Attribute.cpp.

References base, and handler.

◆ parse()

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

Parse attribute.

Definition at line 76 of file Attribute.cpp.

References handler, and isDefault.

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

◆ parseComponent()

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

Parse array component.

Definition at line 81 of file Attribute.cpp.

References handler, and isDefault.

Referenced by OpalElement::parse().

◆ print()

void Attribute::print ( int &  len) const

Print attribute.

Definition at line 96 of file Attribute.cpp.

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

Here is the call graph for this function:

◆ set()

◆ setDefault()

void Attribute::setDefault ( )

Assign default value.

Definition at line 91 of file Attribute.cpp.

References base, handler, and isDefault.

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

◆ setDeferred()

void Attribute::setDeferred ( bool  flag)

Set read-only flag.

Definition at line 68 of file Attribute.cpp.

References handler.

◆ setReadOnly()

void Attribute::setReadOnly ( bool  flag)

Set read-only flag.

Definition at line 74 of file Attribute.cpp.

References handler.

Member Data Documentation

◆ base

std::shared_ptr<AttributeBase> Attribute::base
private

Definition at line 155 of file Attribute.h.

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

◆ handler

std::shared_ptr<AttributeHandler> Attribute::handler
private

◆ isDefault

bool Attribute::isDefault
private

Definition at line 160 of file Attribute.h.

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


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