OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
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 55 of file Attribute.h.

Constructor & Destructor Documentation

Attribute::Attribute ( )

Default constructor.

Definition at line 32 of file Attribute.cpp.

Attribute::Attribute ( const Attribute rhs)

Copy constructor.

Definition at line 39 of file Attribute.cpp.

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

Constructor defining a parser and an optional value.

Definition at line 46 of file Attribute.cpp.

Attribute::~Attribute ( )

Definition at line 53 of file Attribute.cpp.

Member Function Documentation

bool Attribute::defaultUsed ( ) const
inline

Definition at line 176 of file Attribute.h.

References isDefault.

AttributeBase & Attribute::getBase ( ) const
AttributeHandler & Attribute::getHandler ( ) const
const std::string & Attribute::getHelp ( ) const

Return the help string.

Definition at line 80 of file Attribute.cpp.

References AttributeHandler::getHelp(), and handler.

Here is the call graph for this function:

std::string Attribute::getImage ( ) const

Return printable representation.

Definition at line 85 of file Attribute.cpp.

References base, and AttributeBase::getImage().

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

Here is the call graph for this function:

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

Return the attribute type.

Definition at line 95 of file Attribute.cpp.

References AttributeHandler::getType(), and handler.

Here is the call graph for this function:

bool Attribute::isBaseAllocated ( ) const
bool Attribute::isDeferred ( ) const

Return [b]deferred[/b] flag.

Definition at line 100 of file Attribute.cpp.

References handler, and AttributeHandler::isDeferred().

Here is the call graph for this function:

bool Attribute::isExpression ( ) const

Test for expression.

Definition at line 110 of file Attribute.cpp.

References base, and AttributeBase::isExpression().

Referenced by print().

Here is the call graph for this function:

bool Attribute::isReadOnly ( ) const

Test for read only.

Definition at line 115 of file Attribute.cpp.

References handler, and AttributeHandler::isReadOnly().

Here is the call graph for this function:

Attribute::operator bool ( ) const
inline

Test for valid pointer.

Definition at line 172 of file Attribute.h.

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

Definition at line 57 of file Attribute.cpp.

References base, and handler.

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

Parse attribute.

Definition at line 125 of file Attribute.cpp.

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

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

Here is the call graph for this function:

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

Parse array component.

Definition at line 131 of file Attribute.cpp.

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

Referenced by OpalElement::parse().

Here is the call graph for this function:

void Attribute::print ( int &  len) const

Print attribute.

Definition at line 149 of file Attribute.cpp.

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

Referenced by Expressions::operator<<().

Here is the call graph for this function:

void Attribute::set ( AttributeBase newBase)
void Attribute::setDefault ( )

Assign default value.

Definition at line 143 of file Attribute.cpp.

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

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

Here is the call graph for this function:

void Attribute::setDeferred ( bool  flag)

Set read-only flag.

Definition at line 105 of file Attribute.cpp.

References handler, and AttributeHandler::setDeferred().

Here is the call graph for this function:

void Attribute::setReadOnly ( bool  flag)

Set read-only flag.

Definition at line 120 of file Attribute.cpp.

References handler, and AttributeHandler::setReadOnly().

Here is the call graph for this function:

Member Data Documentation

Pointer<AttributeBase> Attribute::base
private

Definition at line 160 of file Attribute.h.

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

Pointer<AttributeHandler> Attribute::handler
private
bool Attribute::isDefault
private

Definition at line 165 of file Attribute.h.

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


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