1 | #ifndef ABSTRACTSOFTWARE_SEEN |
---|
2 | #define ABSTRACTSOFTWARE_SEEN |
---|
3 | |
---|
4 | #include "globalParameters.h" |
---|
5 | #include "particleBeam.h" |
---|
6 | #include "nomDeLogiciel.h" |
---|
7 | #include "nomdElements.h" |
---|
8 | #include "trivaluedBool.h" |
---|
9 | |
---|
10 | #include <iostream> |
---|
11 | #include <string> |
---|
12 | |
---|
13 | using namespace std; |
---|
14 | |
---|
15 | class dataManager; |
---|
16 | |
---|
17 | class abstractSoftware |
---|
18 | { |
---|
19 | |
---|
20 | protected : |
---|
21 | |
---|
22 | unsigned numeroDeb_, numeroFin_; |
---|
23 | globalParameters* globParamPtr_; |
---|
24 | dataManager* dataManager_; |
---|
25 | string inputFileName_; |
---|
26 | nomDeLogiciel nameOfSoftware_; |
---|
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 | abstractSoftware(); |
---|
39 | |
---|
40 | bool launchJob(string commandLine, string& resul); |
---|
41 | bool initComputationLimits(unsigned int numeroDeb,unsigned int numeroFin); |
---|
42 | bool ComputationLimitsOk() const; |
---|
43 | |
---|
44 | |
---|
45 | void registerElement(nomdElements::typedElement nomdel,trivaluedBool b); |
---|
46 | |
---|
47 | public : |
---|
48 | |
---|
49 | abstractSoftware(string inputFileName, globalParameters* globals, dataManager* dt); |
---|
50 | ~abstractSoftware() {;} |
---|
51 | |
---|
52 | inline const nomDeLogiciel* getNomDeLogiciel() const { |
---|
53 | return &nameOfSoftware_; |
---|
54 | } |
---|
55 | |
---|
56 | trivaluedBool doAcceptElement(nomdElements::typedElement typdel); |
---|
57 | |
---|
58 | |
---|
59 | virtual bool createInputFile(particleBeam* beamBefore,unsigned int numeroDeb, unsigned int numeroFin, string workingDir) = 0; |
---|
60 | |
---|
61 | |
---|
62 | virtual bool execute(string workingDir) = 0; |
---|
63 | |
---|
64 | virtual bool buildBeamAfterElements(string workingDir) = 0; |
---|
65 | |
---|
66 | /** Color of the background of this sofware |
---|
67 | Should be a valid Css name as FFEEDD |
---|
68 | */ |
---|
69 | virtual string getColor() = 0; |
---|
70 | |
---|
71 | /** Name of this software |
---|
72 | */ |
---|
73 | inline string getName() const { |
---|
74 | return nameOfSoftware_.getString(); |
---|
75 | } |
---|
76 | |
---|
77 | }; |
---|
78 | #endif |
---|