1 | #ifndef NOMDELOGICIEL_SEEN |
---|
2 | #define NOMDELOGICIEL_SEEN |
---|
3 | |
---|
4 | #include "trivaluedBool.h" |
---|
5 | #include "nomdElements.h" |
---|
6 | |
---|
7 | #include <string> |
---|
8 | #include <vector> |
---|
9 | #include <iostream> |
---|
10 | using namespace std; |
---|
11 | |
---|
12 | class nomDeLogiciel |
---|
13 | { |
---|
14 | |
---|
15 | public : |
---|
16 | |
---|
17 | enum Logiciel |
---|
18 | { |
---|
19 | parmela, transport, generator, test, madx, usersprogram, unknownSoftware |
---|
20 | }; |
---|
21 | |
---|
22 | |
---|
23 | private : |
---|
24 | |
---|
25 | Logiciel program_; |
---|
26 | std::string progString_; |
---|
27 | |
---|
28 | /** |
---|
29 | Accepted elements list for this software |
---|
30 | */ |
---|
31 | std::vector <nomdElements::typedElement> acceptedElements_; |
---|
32 | |
---|
33 | /** |
---|
34 | Ignore software list for this element |
---|
35 | */ |
---|
36 | std::vector <nomdElements::typedElement> ignoredElements_; |
---|
37 | |
---|
38 | |
---|
39 | static Logiciel fromString( std::string s); |
---|
40 | static std::string toString( Logiciel lg); |
---|
41 | std::string getWtColor( nomDeLogiciel::Logiciel lg) const; |
---|
42 | |
---|
43 | void registerElement(nomdElements::typedElement nomdel,trivaluedBool b); |
---|
44 | void setCompatiblesElements(); |
---|
45 | |
---|
46 | nomDeLogiciel(); |
---|
47 | |
---|
48 | public : |
---|
49 | |
---|
50 | nomDeLogiciel(const string& s); |
---|
51 | nomDeLogiciel(int val); |
---|
52 | static int getNumberOfSoftwares(); |
---|
53 | |
---|
54 | inline std::string getString() const {return progString_;} |
---|
55 | inline nomDeLogiciel::Logiciel getLogiciel() const {return program_;} |
---|
56 | |
---|
57 | |
---|
58 | inline const std::vector<nomdElements::typedElement>& acceptedElements() const { return acceptedElements_; |
---|
59 | } |
---|
60 | |
---|
61 | inline const std::vector<nomdElements::typedElement>& ignoredElements() const { return ignoredElements_; |
---|
62 | } |
---|
63 | |
---|
64 | trivaluedBool doAcceptElement(nomdElements::typedElement typdel); |
---|
65 | |
---|
66 | |
---|
67 | /** Color of the background of the sofware |
---|
68 | Should be a valid Css name as FFEEDD |
---|
69 | */ |
---|
70 | inline std::string getColor() const {return getWtColor(program_);} |
---|
71 | // operators |
---|
72 | nomDeLogiciel& operator= (const nomDeLogiciel& nl); |
---|
73 | bool operator== (const nomDeLogiciel& nl); |
---|
74 | bool operator!= (const nomDeLogiciel& nl); |
---|
75 | }; |
---|
76 | #endif |
---|