OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Replacer.h
Go to the documentation of this file.
1 #ifndef OPAL_Replacer_HH
2 #define OPAL_Replacer_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: Replacer.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: Replacer
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:42 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
22 #include <string>
23 
24 class Beamline;
25 class ElementBase;
26 
27 
28 // Class Replacer
29 // ------------------------------------------------------------------------
31 
32 class Replacer: public DefaultVisitor {
33 
34 public:
35 
37  // Attach visitor to a beamline, remember the range.
38  Replacer(const Beamline &, const std::string &name, ElementBase *elm);
39 
40  virtual ~Replacer();
41 
43  virtual void visitFlaggedElmPtr(const FlaggedElmPtr &);
44 
45 private:
46 
47  // Not implemented.
48  Replacer();
49  Replacer(const Replacer &);
50  void operator=(const Replacer &);
51 
52  // The name to be replaced.
53  const std::string itsName;
54 
55  // The new element replacing the old one.
57 };
58 
59 #endif // OPAL_Replacer_HH
Interface for basic beam line object.
Definition: ElementBase.h:128
ElementBase * newBase
Definition: Replacer.h:56
Default algorithms.
virtual ~Replacer()
Definition: Replacer.cpp:41
An abstract sequence of beam line components.
Definition: Beamline.h:37
virtual void visitFlaggedElmPtr(const FlaggedElmPtr &)
Apply the visitor to an FlaggedElmPtr.
Definition: Replacer.cpp:45
const std::string name
const std::string itsName
Definition: Replacer.h:53
Replace all references to named element by a new version.
Definition: Replacer.h:32
A section of a beam line.
Definition: FlaggedElmPtr.h:36
void operator=(const Replacer &)