1 | #ifndef NOMDELEMENTS_SEEN |
---|
2 | #define NOMDELEMENTS_SEEN |
---|
3 | |
---|
4 | using namespace std; |
---|
5 | |
---|
6 | // enum typedElement {beam, RFgun, drift, cell, bend, soleno, fit, snapshot, inconnu}; |
---|
7 | |
---|
8 | |
---|
9 | |
---|
10 | class nomdElements |
---|
11 | { |
---|
12 | |
---|
13 | public : |
---|
14 | |
---|
15 | enum typedElement {beam, RFgun, drift, cell, bend, soleno, fit, snapshot, inconnu}; |
---|
16 | |
---|
17 | private : |
---|
18 | |
---|
19 | typedElement e_; // type entier (enum) |
---|
20 | std::string expandedName_; // nom generique de l'element |
---|
21 | std::string genericLabel_; |
---|
22 | unsigned nbParam_; // nombre de parametres a saisir |
---|
23 | |
---|
24 | static typedElement fromString(std::string s); |
---|
25 | static typedElement fromGenericLabel(std::string s); |
---|
26 | static std::string toExpandedName(typedElement eType); |
---|
27 | static std::string toGenericLabel(typedElement eType); |
---|
28 | static unsigned toNbParam(typedElement eType); |
---|
29 | |
---|
30 | public : |
---|
31 | |
---|
32 | nomdElements(); |
---|
33 | nomdElements(nomdElements& ne); |
---|
34 | nomdElements(const nomdElements& ne); |
---|
35 | nomdElements(const std::string& s); |
---|
36 | nomdElements(typedElement& eType); |
---|
37 | |
---|
38 | |
---|
39 | static int getNumberOfElements(); |
---|
40 | static std::string getLabelFromType(typedElement tp); |
---|
41 | static typedElement getTypeFromLabel(std::string lb); |
---|
42 | |
---|
43 | typedElement getElementType() const; |
---|
44 | std::string getExpandedName() const; |
---|
45 | std::string getGenericLabel() const; |
---|
46 | unsigned getElementNbParameters() const; |
---|
47 | |
---|
48 | // operators |
---|
49 | |
---|
50 | nomdElements& operator= (const nomdElements& ne); |
---|
51 | |
---|
52 | |
---|
53 | }; |
---|
54 | #endif |
---|