OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <Sequence.h>
Public Types | |
typedef TBeamline< SequenceMember > | TLine |
The type of a sequence line. More... | |
Public Types inherited from Element | |
enum | ReferenceType { IS_ENTRY , IS_CENTRE , IS_EXIT } |
Reference for element positioning. More... | |
Public Member Functions | |
Sequence () | |
Exemplar constructor. More... | |
virtual | ~Sequence () |
virtual Sequence * | clone (const std::string &name) |
Make clone. More... | |
virtual Sequence * | copy (const std::string &name) |
Make copy of the sequence line. More... | |
virtual double | getLength () const |
Return sequence length. More... | |
virtual double | getEntrance (ReferenceType) const |
Return the arc length from origin to entrance. More... | |
virtual double | getExit (ReferenceType) const |
Return the arc length from origin to exit. More... | |
ReferenceType | getReference () const |
Return the reference type flag. More... | |
virtual Object * | makeTemplate (const std::string &, TokenStream &, Statement &) |
Make a sequence template. More... | |
virtual void | parse (Statement &) |
Parse sequence. More... | |
virtual void | print (std::ostream &) const |
Print sequence. More... | |
virtual void | replace (Object *oldObject, Object *newObject) |
Replace references to elements. More... | |
virtual void | update () |
Update the embedded CLASSIC beam line. More... | |
virtual TLine * | fetchLine () const |
Return the embedded CLASSIC beam line. More... | |
void | storeLine (TLine &line) |
Store sequence line. More... | |
Public Member Functions inherited from BeamSequence | |
virtual | ~BeamSequence () |
virtual const std::string | getCategory () const |
Return the object category as a string. More... | |
Public Member Functions inherited from Element | |
virtual | ~Element () |
virtual bool | canReplaceBy (Object *object) |
Test if replacement is allowed. More... | |
virtual bool | shouldTrace () const |
Trace flag. More... | |
virtual bool | shouldUpdate () const |
Update flag. More... | |
virtual void | setShared (bool) |
Set shared flag. More... | |
ElementBase * | getElement () const |
Return the embedded CLASSIC element. More... | |
void | setElement (ElementBase *) |
Assign new CLASSIC element. More... | |
Public Member Functions inherited from Object | |
virtual | ~Object () |
void | copyAttributes (const Object &) |
Copy attributes from another object. More... | |
virtual void | execute () |
Execute the command. More... | |
virtual Attribute * | findAttribute (const std::string &name) |
Find an attribute by name. More... | |
virtual const Attribute * | findAttribute (const std::string &name) const |
Find an attribute by name. More... | |
virtual Object * | makeInstance (const std::string &name, Statement &, const Parser *) |
Macro handler function. More... | |
virtual void | parseShortcut (Statement &, bool eval=true) |
Parser for single-attribute commands. More... | |
virtual void | printValue (std::ostream &) const |
virtual void | printHelp (std::ostream &) const |
Print help. More... | |
bool | isBuiltin () const |
True, if [b]this[/b] is a built-in object. More... | |
virtual bool | isShared () const |
Shared flag. More... | |
void | setDirty (bool) |
Set/reset the [b]modified[/b] flag. More... | |
bool | isDirty () const |
True, if the [b]modified[/b] flag is set. More... | |
void | setFlag (bool) |
Flag/unflag this object, e. g. to control output of objects for. More... | |
bool | isFlagged () const |
True, if [b]this[/b] is flagged by setFlag(true). More... | |
const Object * | getBaseObject () const |
Return the object's base type object. More... | |
const std::string & | getOpalName () const |
Return object name. More... | |
Object * | getParent () const |
Return parent pointer. More... | |
bool | isTreeMember (const Object *subTree) const |
Test for tree membership. More... | |
void | setOpalName (const std::string &name) |
Set object name. More... | |
void | setParent (Object *) |
Set parent object. More... | |
void | clear () |
Clear the occurrence counter. More... | |
int | increment () |
Increment and return the occurrence counter. More... | |
int | occurrenceCount () |
Return the occurrence counter. More... | |
void | registerReference (Invalidator *a) |
Register a reference to this object. More... | |
void | unregisterReference (Invalidator *a) |
Unegister a reference to this object. More... | |
void | registerOwnership (const AttributeHandler::OwnerType &itsClass) const |
Public Member Functions inherited from RCObject | |
int | addReference () const |
Increment reference count. More... | |
int | removeReference () const |
Decrement the reference count. More... | |
bool | isShared () const |
Test for sharing. More... | |
Private Member Functions | |
Sequence (const Sequence &) | |
void | operator= (const Sequence &) |
Sequence (const std::string &name, Sequence *parent) | |
void | addEndMarkers (TLine &line) const |
double | findDriftLength (TLine::iterator drift) const |
TLine::iterator | findNamedPosition (TLine &, const std::string &) const |
void | insertDrifts (TLine &line) |
Static Private Member Functions | |
static void | updateList (Sequence *, TLine *) |
Private Attributes | |
ReferenceType | itsCode |
std::string | itsRefPoint |
Friends | |
class | Edit |
class | SequenceParser |
class | SequenceTemplate |
Additional Inherited Members | |
Static Public Member Functions inherited from BeamSequence | |
static BeamSequence * | find (const std::string &name) |
Find a BeamSequence by name. More... | |
Static Public Member Functions inherited from Element | |
static Element * | find (const std::string &name) |
Find named Element. More... | |
Public Attributes inherited from Object | |
std::vector< Attribute > | itsAttr |
The object attributes. More... | |
Protected Member Functions inherited from BeamSequence | |
BeamSequence (int size, const char *name, const char *help) | |
Constructor for exemplars. More... | |
BeamSequence (const std::string &name, BeamSequence *parent) | |
Constructor for clones. More... | |
Protected Member Functions inherited from Element | |
Element (int size, const char *name, const char *help) | |
Constructor for exemplars. More... | |
Element (const std::string &name, Element *parent) | |
Constructor for clones. More... | |
Protected Member Functions inherited from Object | |
Object (int size, const char *name, const char *help) | |
Constructor for exemplars. More... | |
Object (const std::string &name, Object *parent) | |
Constructor for clones. More... | |
Protected Member Functions inherited from RCObject | |
RCObject () | |
Default constructor. More... | |
RCObject (const RCObject &) | |
Copy constructor. More... | |
virtual | ~RCObject ()=0 |
RCObject & | operator= (const RCObject &right) |
Protected Attributes inherited from Object | |
bool | builtin |
Built-in flag. More... | |
bool | modified |
Dirty flag. More... | |
bool | flagged |
Object flag. More... | |
Definition at line 33 of file Sequence.h.
typedef TBeamline<SequenceMember> Sequence::TLine |
The type of a sequence line.
Definition at line 42 of file Sequence.h.
Sequence::Sequence | ( | ) |
Exemplar constructor.
Definition at line 52 of file Sequence.cpp.
References Object::itsAttr, Attributes::makeReal(), Attributes::makeString(), Object::registerOwnership(), Element::setElement(), AttributeHandler::STATEMENT, and Attrib::Distribution::TYPE.
Referenced by clone().
|
virtual |
Definition at line 93 of file Sequence.cpp.
|
private |
|
private |
Definition at line 83 of file Sequence.cpp.
References name, and Element::setElement().
|
private |
Definition at line 312 of file Sequence.cpp.
References SequenceMember::ABSOLUTE, Element::find(), Element::getElement(), getLength(), SequenceMember::GLOBAL, SequenceMember::itsFlag, SequenceMember::itsPosition, SequenceMember::itsType, and ElmPtr::setElement().
Referenced by SequenceParser::parse().
|
virtual |
Make clone.
Implements Object.
Definition at line 97 of file Sequence.cpp.
References name, and Sequence().
Referenced by copy(), and SequenceTemplate::makeInstance().
|
virtual |
Make copy of the sequence line.
Implements BeamSequence.
Definition at line 102 of file Sequence.cpp.
References ElementBase::clone(), clone(), ElementBase::copyStructure(), fetchLine(), SequenceMember::GENERATED, ElmPtr::getElement(), name, ElmPtr::setElement(), and storeLine().
|
virtual |
Return the embedded CLASSIC beam line.
Implements BeamSequence.
Definition at line 278 of file Sequence.cpp.
References Element::getElement().
Referenced by copy(), getEntrance(), getExit(), print(), replace(), storeLine(), and update().
|
private |
Definition at line 325 of file Sequence.cpp.
References abs(), Element::getEntrance(), Element::getExit(), Object::getOpalName(), and itsCode.
Referenced by updateList().
|
private |
Definition at line 124 of file Sequence.cpp.
References SequenceMember::GENERATED, and name.
Referenced by SequenceParser::findFromPositions(), getEntrance(), and getExit().
|
virtual |
Return the arc length from origin to entrance.
Reimplemented from Element.
Definition at line 155 of file Sequence.cpp.
References fetchLine(), findNamedPosition(), Element::getEntrance(), itsRefPoint, and Hypervolume::ref.
|
virtual |
Return the arc length from origin to exit.
Reimplemented from Element.
Definition at line 166 of file Sequence.cpp.
References fetchLine(), findNamedPosition(), Element::getExit(), getLength(), itsRefPoint, and Hypervolume::ref.
|
virtual |
Return sequence length.
Implements Element.
Definition at line 150 of file Sequence.cpp.
References Attributes::getReal(), and Object::itsAttr.
Referenced by addEndMarkers(), and getExit().
Sequence::ReferenceType Sequence::getReference | ( | ) | const |
Return the reference type flag.
Definition at line 177 of file Sequence.cpp.
References Attributes::getString(), Element::IS_CENTRE, Element::IS_ENTRY, Element::IS_EXIT, Object::itsAttr, and Hypervolume::ref.
Referenced by storeLine().
|
private |
Definition at line 368 of file Sequence.cpp.
References SequenceMember::GENERATED, SequenceMember::itsType, ElmPtr::setElement(), and ElementBase::setName().
Referenced by SequenceParser::parse().
|
virtual |
Make a sequence template.
Reimplemented from Object.
Definition at line 191 of file Sequence.cpp.
References name, SequenceTemplate::parseTemplate(), and SequenceTemplate.
|
private |
|
virtual |
Parse sequence.
Reimplemented from Object.
Definition at line 206 of file Sequence.cpp.
References Attributes::getString(), Object::itsAttr, itsRefPoint, Object::parse(), and OpalParser::run().
|
virtual |
Print sequence.
Reimplemented from Object.
Definition at line 218 of file Sequence.cpp.
References endl(), fetchLine(), SequenceMember::GENERATED, ElmPtr::getElement(), ElementBase::getName(), Object::getOpalName(), FlaggedElmPtr::getReflectionFlag(), Object::isShared(), Object::itsAttr, SequenceMember::itsPosition, SequenceMember::itsType, name, and Inform::precision().
Replace references to elements.
Reimplemented from Object.
Definition at line 259 of file Sequence.cpp.
References DefaultVisitor::execute(), fetchLine(), Element::getElement(), and Object::getOpalName().
void Sequence::storeLine | ( | TLine & | line | ) |
Store sequence line.
Definition at line 283 of file Sequence.cpp.
References OpalData::apply(), fetchLine(), Element::find(), SequenceMember::GENERATED, OpalData::getInstance(), getReference(), Object::increment(), itsCode, and name.
Referenced by copy(), and SequenceParser::parse().
|
virtual |
Update the embedded CLASSIC beam line.
Reimplemented from Object.
Definition at line 272 of file Sequence.cpp.
References fetchLine(), and updateList().
Definition at line 383 of file Sequence.cpp.
References OpalData::find(), findDriftLength(), OpalData::getInstance(), ElementBase::getName(), and ElementBase::isSharable().
Referenced by update().
|
friend |
Definition at line 35 of file Sequence.h.
|
friend |
Definition at line 36 of file Sequence.h.
|
friend |
Definition at line 37 of file Sequence.h.
Referenced by makeTemplate().
|
private |
Definition at line 124 of file Sequence.h.
Referenced by findDriftLength(), and storeLine().
|
private |
Definition at line 127 of file Sequence.h.
Referenced by getEntrance(), getExit(), and parse().