OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
AttributeBase.h
Go to the documentation of this file.
1 #ifndef OPAL_AttributeBase_HH
2 #define OPAL_AttributeBase_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: AttributeBase.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.2 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: AttributeBase
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/29 10:40:33 $
17 // $Author: opal $
18 //
19 // ------------------------------------------------------------------------
20 
23 #include <iosfwd>
24 #include <string>
25 
26 // Class AttributeBase
27 // ------------------------------------------------------------------------
29 // The various derived classes contain the actual values, notably the
30 // template classes SValue<T> for scalars and AValue<T> for arrays.
31 
32 class AttributeBase: public RCObject, public Invalidator {
33 
34 public:
35 
36  AttributeBase();
37  virtual ~AttributeBase();
38 
40  // Construct an exact copy of the value.
41  virtual AttributeBase *clone() const = 0;
42 
44  // Uses [b]print()[/b] to convert the input expression for the attribute
45  // to a printable representation.
46  std::string getImage() const;
47 
49  // Return [b]true[/b] if the value is an expression.
50  virtual bool isExpression() const;
51 
53  // Print the value on the given output stream.
54  // The result allows reconstruction of any expression.
55  virtual void print(std::ostream &) const = 0;
56 
57 private:
58 
59  // Not implemented.
62 };
63 
64 #endif // OPAL_AttributeBase_HH
Abstract base class for attribute values of different types.
Definition: AttributeBase.h:32
AttributeBase(AttributeBase &)
virtual AttributeBase * clone() const =0
Make clone.
virtual bool isExpression() const
Test for expression.
virtual ~AttributeBase()
void operator=(AttributeBase &)
std::string getImage() const
Convert to string.
virtual void print(std::ostream &) const =0
Print value.
Abstract base class for references which must be invalidated when an.
Definition: Invalidator.h:27
Abstract base class for reference counted objects.
Definition: RCObject.h:40