OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Range.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: Range.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.1.1.1 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class: Range
10 // A class used to parse range attributes.
11 //
12 // ------------------------------------------------------------------------
13 //
14 // $Date: 2000/03/27 09:33:36 $
15 // $Author: Andreas Adelmann $
16 //
17 // ------------------------------------------------------------------------
18 
19 #include "Attributes/Range.h"
22 #include "Expressions/SValue.h"
24 
25 using namespace Expressions;
26 
27 
28 // Class Range
29 // ------------------------------------------------------------------------
30 
31 namespace Attributes {
32 
33  Range::Range(const std::string &name, const std::string &help):
34  AttributeHandler(name, help, 0)
35  {}
36 
37 
39  {}
40 
41 
42  const std::string &Range::getType() const {
43  static const std::string type("range");
44  return type;
45  }
46 
47 
48  void Range::parse(Attribute &attr, Statement &stat, bool) const {
49  attr.set(new SValue<RangeRep>(parseRange(stat)));
50  }
51 
52 };
void set(AttributeBase *newBase)
Define new value.
Definition: Attribute.cpp:137
virtual void parse(Attribute &, Statement &, bool) const
Parse the attribute.
Definition: Range.cpp:48
RangeRep parseRange(Statement &)
Parse range specification.
virtual ~Range()
Definition: Range.cpp:38
A representation of an Object attribute.
Definition: Attribute.h:55
Interface for statements.
Definition: Statement.h:38
Abstract base class for attribute parsers.
Object attribute with a constant scalar value.
Definition: SValue.h:34
const std::string name
virtual const std::string & getType() const
Return attribute type ``range&#39;&#39;.
Definition: Range.cpp:42