[112] | 1 | #ifndef morpheo_behavioural_Model_h |
---|
| 2 | #define morpheo_behavioural_Model_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Model.h 112 2009-03-18 22:36:26Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include "Common/include/Debug.h" |
---|
| 12 | #include "Common/include/ErrorMorpheo.h" |
---|
| 13 | #include <map> |
---|
| 14 | |
---|
| 15 | namespace morpheo { |
---|
| 16 | namespace behavioural { |
---|
| 17 | |
---|
| 18 | typedef enum |
---|
| 19 | { |
---|
| 20 | MODEL_SYSTEMC, |
---|
| 21 | MODEL_VHDL |
---|
| 22 | } model_type_t; |
---|
| 23 | |
---|
| 24 | typedef struct |
---|
| 25 | { |
---|
| 26 | model_type_t type ; |
---|
| 27 | debug_verbosity_t debug; |
---|
| 28 | } model_t; |
---|
| 29 | |
---|
| 30 | class Model |
---|
| 31 | { |
---|
| 32 | private : static const model_type_t default_type = MODEL_SYSTEMC; |
---|
| 33 | private : static const debug_verbosity_t default_debug = DEBUG_NONE; |
---|
| 34 | |
---|
| 35 | private : std::map<std::string,model_t> models; |
---|
| 36 | |
---|
| 37 | public : Model (void); |
---|
| 38 | public : ~Model (void); |
---|
| 39 | public : void set_model (std::string component, model_type_t type, debug_verbosity_t debug); |
---|
| 40 | public : model_type_t get_type (std::string component); |
---|
| 41 | public : debug_verbosity_t get_debug (std::string component); |
---|
| 42 | }; |
---|
| 43 | |
---|
| 44 | }; // end namespace behavioural |
---|
| 45 | |
---|
| 46 | template<> inline morpheo::behavioural::model_type_t fromString<morpheo::behavioural::model_type_t>(const std::string& x) |
---|
| 47 | { |
---|
| 48 | if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::MODEL_SYSTEMC))) == 0) or |
---|
| 49 | (x.compare("model_systemc") == 0) or |
---|
| 50 | (x.compare("systemc") == 0) |
---|
| 51 | ) |
---|
| 52 | return morpheo::behavioural::MODEL_SYSTEMC; |
---|
| 53 | if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::MODEL_VHDL))) == 0) or |
---|
| 54 | (x.compare("model_vhdl") == 0) or |
---|
| 55 | (x.compare("vhdl") == 0)) |
---|
| 56 | return morpheo::behavioural::MODEL_VHDL; |
---|
| 57 | throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\"\n")); |
---|
| 58 | }; |
---|
| 59 | |
---|
| 60 | }; // end namespace morpheo |
---|
| 61 | |
---|
| 62 | #endif |
---|
| 63 | |
---|