OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
ElmPtr.h
Go to the documentation of this file.
1#ifndef CLASSIC_ElmPtr_HH
2#define CLASSIC_ElmPtr_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: ElmPtr.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: ElmPtr
13//
14// ------------------------------------------------------------------------
15// Class category: Beamlines
16// ------------------------------------------------------------------------
17//
18// $Date: 2000/03/27 09:32:35 $
19// $Author: fci $
20//
21// ------------------------------------------------------------------------
22
25
26
27// Class ElmPtr.
28// ------------------------------------------------------------------------
30// A beam line is built as a list of ElmPtr.
31
32class ElmPtr {
33
34public:
35
36 ElmPtr();
37 ElmPtr(const ElmPtr &);
39 virtual ~ElmPtr();
40
42 // If any error occurs, this method throws an exception.
43 virtual void accept(BeamlineVisitor &) const;
44
46 inline ElementBase *getElement() const;
47
49 inline void setElement(ElementBase *);
50
51protected:
52
53 // The pointer to the element.
55};
56
57
59 return &*itsElement;
60}
61
62
63inline void ElmPtr::setElement(ElementBase *elem) {
64 itsElement = elem;
65}
66
67#endif // CLASSIC_ElmPtr_HH
A section of a beam line.
Definition: ElmPtr.h:32
ElmPtr()
Definition: ElmPtr.cpp:26
ElementBase * getElement() const
Get the element pointer.
Definition: ElmPtr.h:58
void setElement(ElementBase *)
Set the element pointer.
Definition: ElmPtr.h:63
Pointer< ElementBase > itsElement
Definition: ElmPtr.h:54
virtual void accept(BeamlineVisitor &) const
Apply visitor.
Definition: ElmPtr.cpp:45
virtual ~ElmPtr()
Definition: ElmPtr.cpp:41