OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Reference.cpp
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2// $RCSfile: Reference.cpp,v $
3// ------------------------------------------------------------------------
4// $Revision: 1.1.1.1 $
5// ------------------------------------------------------------------------
6// Copyright: see Copyright.readme
7// ------------------------------------------------------------------------
8//
9// Class Reference:
10// A class used to parse reference attributes.
11//
12// ------------------------------------------------------------------------
13//
14// $Date: 2000/03/27 09:33:36 $
15// $Author: Andreas Adelmann $
16//
17// ------------------------------------------------------------------------
18
23#include "Expressions/SValue.h"
25
26using namespace Expressions;
27
28// Class Reference
29// ------------------------------------------------------------------------
30
31namespace Attributes {
32
33 Reference::Reference(const std::string& name, const std::string& help)
34 : AttributeHandler(name, help, 0) {}
35
37
38 const std::string& Reference::getType() const {
39 static const std::string type("reference");
40 return type;
41 }
42
43 void Reference::parse(Attribute& attr, Statement& stat, bool) const {
44 attr.set(new SValue<SRefAttr<double> >(*parseReference(stat)));
45 }
46
47}; // namespace Attributes
Abstract base class for attribute parsers.
A representation of an Object attribute.
Definition Attribute.h:52
void set(AttributeBase *newBase)
Define new value.
Definition Attribute.cpp:86
Reference(const std::string &name, const std::string &help)
Constructor.
Definition Reference.cpp:33
virtual const std::string & getType() const
Return attribute type string `‘reference’'.
Definition Reference.cpp:38
virtual void parse(Attribute &, Statement &, bool) const
Parse the attribute.
Definition Reference.cpp:43
An attribute defined as a reference to a scalar.
Definition SRefAttr.h:47
Object attribute with a constant scalar value.
Definition SValue.h:34
Interface for statements.
Definition Statement.h:37
A collection of routines to construct object Attributes and retrieve.
Representation objects and parsers for attribute expressions.
SRefAttr< double > * parseReference(Statement &)
Parse variable reference.