BeamSequence.h 2.1 KB
Newer Older
gsell's avatar
gsell committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#ifndef OPAL_BeamSequence_HH
#define OPAL_BeamSequence_HH

// ------------------------------------------------------------------------
// $RCSfile: BeamSequence.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: BeamSequence
//
// ------------------------------------------------------------------------
//
// $Date: 2000/03/27 09:33:34 $
// $Author: Andreas Adelmann $
//
// ------------------------------------------------------------------------

#include "AbstractObjects/Element.h"

23 24
#include <memory>

gsell's avatar
gsell committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
class Beamline;


// Class BeamSequence
// ------------------------------------------------------------------------
/// The base class for all OPAL beam lines and sequences.
//  It implements the common behaviour of sequences, it can also be used via
//  dynamic casting to determine whether an object represents a sequence.

class BeamSequence: public Element {

public:

    virtual ~BeamSequence();

    /// Make complete copy.
    //  Copy also the line list.
42
    virtual BeamSequence *copy(const std::string &name) = 0;
gsell's avatar
gsell committed
43 44

    /// Find a BeamSequence by name.
45
    static BeamSequence *find(const std::string &name);
gsell's avatar
gsell committed
46 47 48

    /// Return the object category as a string.
    //  Return the string "SEQUENCE".
49
    virtual const std::string getCategory() const;
gsell's avatar
gsell committed
50 51 52

    /// Return the embedded CLASSIC beam line.
    //  The result it the ideal line.
53
    virtual std::shared_ptr<Beamline> fetchLine() const = 0;
gsell's avatar
gsell committed
54 55 56 57 58 59 60 61 62

protected:

    /// Constructor for exemplars.
    BeamSequence(int size, const char *name, const char *help);

    /// Constructor for clones.
    //  The clone will be [b]empty[/b].
    //  It has to be filled in by the corresponding parser.
63
    BeamSequence(const std::string &name, BeamSequence *parent);
gsell's avatar
gsell committed
64 65 66 67 68 69 70 71 72

private:

    // Not implemented.
    BeamSequence();
    BeamSequence(const BeamSequence &);
    void operator=(const BeamSequence &);
};

73
#endif // OPAL_BeamSequence_HH