OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
AttCell.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: AttCell.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.2 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class: AttCell
10 // The representation of a table cell for OPAL ATTLIST commands.
11 //
12 // ------------------------------------------------------------------------
13 //
14 // $Date: 2000/03/28 11:50:57 $
15 // $Author: opal $
16 //
17 // ------------------------------------------------------------------------
18 
19 #include "Elements/AttCell.h"
20 #include <iostream>
21 
22 
23 // Class AttCell.
24 // ------------------------------------------------------------------------
25 
27 {}
28 
29 
31 {}
32 
33 
34 void AttCell::setReal(double)
35 {}
36 
37 
38 void AttCell::setString(const std::string &)
39 {}
40 
41 
42 // Class AttString.
43 // ------------------------------------------------------------------------
44 
46  itsValue()
47 {}
48 
49 
51 {}
52 
53 
55  itsValue.erase();
56 }
57 
58 
59 void AttString::printFormat(std::ostream &os) const {
60  os << "%s";
61 }
62 
63 
64 void AttString::printValue(std::ostream &os) const {
65  if(itsValue.empty()) {
66  os << "Null";
67  } else {
68  os << itsValue;
69  }
70 }
71 
72 
73 void AttString::setString(const std::string &value) {
74  itsValue = value;
75 }
76 
77 
78 // Class AttReal.
79 // ------------------------------------------------------------------------
80 
82  itsValue(0.0)
83 {}
84 
85 
87 {}
88 
89 
91  itsValue = 0.0;
92 }
93 
94 
95 void AttReal::printFormat(std::ostream &os) const {
96  os << "%le";
97 }
98 
99 
100 void AttReal::printValue(std::ostream &os) const {
101  os << itsValue;
102 }
103 
104 
105 void AttReal::setReal(double value) {
106  itsValue = value;
107 }
virtual ~AttString()
Definition: AttCell.cpp:50
virtual void printValue(std::ostream &os) const
Print the attribute value.
Definition: AttCell.cpp:64
virtual void setReal(double)
Store the value.
Definition: AttCell.cpp:105
std::string itsValue
Definition: AttCell.h:131
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
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
virtual ~AttReal()
Definition: AttCell.cpp:86
virtual void clearValue()
Clear the value.
Definition: AttCell.cpp:54
double itsValue
Definition: AttCell.h:96
AttCell()
Definition: AttCell.cpp:26
virtual void setReal(double)
Store the value.
Definition: AttCell.cpp:34