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