OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
AttCell.h
Go to the documentation of this file.
1 #ifndef OPAL_AttCell_HH
2 #define OPAL_AttCell_HH 1
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: AttCell.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: AttCell
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:40 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
21 #include <map>
22 #include <string>
23 
24 
25 // Class AttCell.
26 // ------------------------------------------------------------------------
28 // Representation of a table cell for ATTLIST command.
29 
30 class AttCell {
31 
32 public:
33 
34  AttCell();
35  virtual ~AttCell();
36 
38  // Reset the value to undefined.
39  virtual void clearValue() = 0;
40 
42  // Print the format string in C style.
43  virtual void printFormat(std::ostream &os) const = 0;
44 
46  // According to the format string.
47  virtual void printValue(std::ostream &os) const = 0;
48 
50  // Set the cell value to the given double.
51  virtual void setReal(double);
52 
54  // Set the cell value to the given string.
55  virtual void setString(const std::string &);
56 
57 private:
58 
59  // Not implemented.
60  AttCell(const AttCell &);
61  void operator=(const AttCell &);
62 };
63 
64 
65 // Class AttReal.
66 // ------------------------------------------------------------------------
68 
69 class AttReal: public AttCell {
70 
71 public:
72 
73  AttReal();
74  virtual ~AttReal();
75 
77  virtual void clearValue();
78 
80  // Prints "%le".
81  virtual void printFormat(std::ostream &os) const;
82 
84  virtual void printValue(std::ostream &os) const;
85 
87  virtual void setReal(double);
88 
89 private:
90 
91  // Not implemented.
92  AttReal(const AttReal &);
93  void operator=(const AttReal &);
94 
95  // The attribute value.
96  double itsValue;
97 };
98 
99 
100 // Class AttString.
101 // ------------------------------------------------------------------------
103 
104 class AttString: public AttCell {
105 
106 public:
107 
108  AttString();
109  virtual ~AttString();
110 
112  virtual void clearValue();
113 
115  // Prints "%s".
116  virtual void printFormat(std::ostream &os) const;
117 
119  virtual void printValue(std::ostream &os) const;
120 
122  virtual void setString(const std::string &);
123 
124 private:
125 
126  // Not implemented.
127  AttString(const AttString &);
128  void operator=(const AttString &);
129 
130  // The attribute value.
131  std::string itsValue;
132 };
133 
134 #endif // OPAL_AttCell_HH
void operator=(const AttString &)
virtual ~AttString()
Definition: AttCell.cpp:50
virtual void printFormat(std::ostream &os) const =0
Print the attribute format.
virtual void printValue(std::ostream &os) const
Print the attribute value.
Definition: AttCell.cpp:64
virtual void printValue(std::ostream &os) const =0
Print the attribute value.
virtual void setReal(double)
Store the value.
Definition: AttCell.cpp:105
std::string itsValue
Definition: AttCell.h:131
The abstract base class for attribute cells.
Definition: AttCell.h:30
virtual void printValue(std::ostream &os) const
Print the attribute value.
Definition: AttCell.cpp:100
virtual void clearValue()
Clear the value.
Definition: AttCell.cpp:90
virtual void setString(const std::string &)
Store the value.
Definition: AttCell.cpp:38
void operator=(const AttCell &)
virtual void printFormat(std::ostream &os) const
Print the attribute format.
Definition: AttCell.cpp:59
virtual void printFormat(std::ostream &os) const
Print the attribute format.
Definition: AttCell.cpp:95
virtual ~AttCell()
Definition: AttCell.cpp:30
AttReal()
Definition: AttCell.cpp:81
virtual void setString(const std::string &)
Store the value.
Definition: AttCell.cpp:73
AttString()
Definition: AttCell.cpp:45
void operator=(const AttReal &)
virtual ~AttReal()
Definition: AttCell.cpp:86
The class for attribute cells with a real value.
Definition: AttCell.h:69
virtual void clearValue()
Clear the value.
Definition: AttCell.cpp:54
The class for attribute cells with a string value.
Definition: AttCell.h:104
virtual void clearValue()=0
Clear the value.
double itsValue
Definition: AttCell.h:96
AttCell()
Definition: AttCell.cpp:26
virtual void setReal(double)
Store the value.
Definition: AttCell.cpp:34