OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
AttWriter.h
Go to the documentation of this file.
1 #ifndef OPAL_AttWriter_HH
2 #define OPAL_AttWriter_HH 1
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: AttWriter.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.2 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: AttWriter
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2001/08/13 15:25:21 $
17 // $Author: jowett $
18 //
19 // ------------------------------------------------------------------------
20 
24 #include "Elements/OpalElement.h"
25 #include "Utilities/Timer.h"
26 #include <iosfwd>
27 #include <string>
28 #include <vector>
29 
30 class AttCell;
31 class Beamline;
32 class CCollimator;
33 class Corrector;
34 class Drift;
35 class ElementBase;
36 class Multipole;
37 class Patch;
38 class RBend;
39 class RFCavity;
40 class TravelingWave;
41 class SBend;
42 class Separator;
43 class Solenoid;
44 
45 
46 // Class AttWriter
47 // ------------------------------------------------------------------------
49 // A ``Visitor'' which looks at all elements in turn. For each element
50 // it asks to store all defined attributes in a registry, and then
51 // requests the desired values from that registry to build a print line.
52 
53 class AttWriter: public DefaultVisitor {
54 
55 public:
56 
58  AttWriter(const Beamline &,
59  std::ostream &,
60  OpalElement::ValueFlag valueFlag,
61  const std::vector<AttCell *> &);
62 
63  virtual ~AttWriter();
64 
65 
67  virtual void visitFlaggedElmPtr(const FlaggedElmPtr &);
68 
69 private:
70 
71  // Not implemented.
72  AttWriter();
73  AttWriter(const AttWriter &);
74  void operator=(const AttWriter &);
75 
76  // The output stream.
77  std::ostream &itsStream;
78 
79  // The current output line representation.
80  const std::vector<AttCell *> &itsBuffer;
81 
82  // The flag for the type of value desired.
84 };
85 
86 #endif // OPAL_AttWriter_HH
Interface for basic beam line object.
Definition: ElementBase.h:128
ValueFlag
Switch for value desired on ATTLIST command.
Definition: OpalElement.h:71
Interface for electrostatic separator.
Definition: Separator.h:33
virtual void visitFlaggedElmPtr(const FlaggedElmPtr &)
Apply the algorithm to a FlaggedElmPtr.
Definition: AttWriter.cpp:67
std::ostream & itsStream
Definition: AttWriter.h:77
Interface for general corrector.
Definition: Corrector.h:35
The abstract base class for attribute cells.
Definition: AttCell.h:30
Definition: RBend.h:73
Interface for drift space.
Definition: Drift.h:33
Default algorithms.
Interface for general multipole.
Definition: Multipole.h:46
const std::vector< AttCell * > & itsBuffer
Definition: AttWriter.h:80
void operator=(const AttWriter &)
Interface for cyclotron collimator.
Definition: CCollimator.h:13
Interface for RF cavity.
Definition: TravelingWave.h:37
Definition: SBend.h:68
The worker class for ATTLIST commands.
Definition: AttWriter.h:53
Interface for solenoids.
Definition: Solenoid.h:36
An abstract sequence of beam line components.
Definition: Beamline.h:37
virtual ~AttWriter()
Definition: AttWriter.cpp:63
Interface for RF cavity.
Definition: RFCavity.h:37
Interface for a geometric patch.
Definition: Patch.h:34
OpalElement::ValueFlag itsValueFlag
Definition: AttWriter.h:83
A section of a beam line.
Definition: FlaggedElmPtr.h:36