OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
SCell.h
Go to the documentation of this file.
1 #ifndef OPAL_SCell_HH
2 #define OPAL_SCell_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: SCell.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Template class SCell:
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:42 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
23 #include <iosfwd>
24 
25 class ConstChannel;
26 
27 
28 namespace Expressions {
29 
30  // Class SCell
31  // ----------------------------------------------------------------------
33  // This expression returns the value in a table cell, identified by
34  // the table name, the row (a place reference), and the column (a name).
35 
36  class SCell: public Scalar<double> {
37 
38  public:
39 
41  // Identify the table by its name [b]tab[/b], the row by the place
42  // reference [b]place[/b] and the column by its name [b]col[/b].
43  SCell(const std::string &tab, const PlaceRep &place, const std::string &col);
44 
45  virtual ~SCell();
46 
48  virtual Scalar<double> *clone() const;
49 
51  // Evaluate the reference and return the value in that cell.
52  virtual double evaluate() const;
53 
55  virtual void print(std::ostream &stream, int) const;
56 
57  private:
58 
59  // Not implemented.
60  SCell();
61  void operator=(const SCell &);
62 
63  // Names of table, of position, and of column, plus occurrence count.
64  const std::string tab_name;
66  const std::string col_name;
67 
68  // The Chanel leading to the table cell.
70  };
71 
72 }
73 
74 #endif // OPAL_SCell_HH
A scalar expression.
Definition: Expressions.h:79
const std::string col_name
Definition: SCell.h:66
virtual double evaluate() const
Evaluate.
Definition: SCell.cpp:49
const PlaceRep position
Definition: SCell.h:65
virtual void print(std::ostream &stream, int) const
Print expression.
Definition: SCell.cpp:59
Representation of a place within a beam line or sequence.
Definition: PlaceRep.h:41
Abstract interface for read-only access to variable.
Definition: ConstChannel.h:29
A scalar expression referring to a table cell.
Definition: SCell.h:36
const std::string tab_name
Definition: SCell.h:64
void operator=(const SCell &)
virtual ~SCell()
Definition: SCell.cpp:39
ConstChannel * itsChannel
Definition: SCell.h:69
virtual Scalar< double > * clone() const
Make clone.
Definition: SCell.cpp:44