[77] | 1 | #ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_network_read_unit_to_execution_unit_Types_h |
---|
| 2 | #define morpheo_behavioural_core_multi_execute_loop_execute_loop_network_read_unit_to_execution_unit_Types_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include "Behavioural/include/Types.h" |
---|
| 12 | #include "Common/include/ToString.h" |
---|
| 13 | #include "Common/include/FromString.h" |
---|
| 14 | #include "Common/include/ErrorMorpheo.h" |
---|
| 15 | |
---|
| 16 | namespace morpheo { |
---|
| 17 | namespace behavioural { |
---|
| 18 | namespace core { |
---|
| 19 | namespace multi_execute_loop { |
---|
| 20 | namespace execute_loop { |
---|
| 21 | namespace network { |
---|
| 22 | namespace read_unit_to_execution_unit { |
---|
| 23 | |
---|
| 24 | typedef enum |
---|
| 25 | { |
---|
| 26 | PRIORITY_STATIC, |
---|
| 27 | PRIORITY_ROUND_ROBIN |
---|
| 28 | } Tpriority_t; |
---|
| 29 | |
---|
| 30 | }; // end namespace read_unit_to_execution_unit |
---|
| 31 | }; // end namespace network |
---|
| 32 | }; // end namespace execute_loop |
---|
| 33 | }; // end namespace multi_execute_loop |
---|
| 34 | }; // end namespace core |
---|
| 35 | }; // end namespace behavioural |
---|
| 36 | |
---|
| 37 | template<> inline std::string toString<morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::Tpriority_t>(const morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::Tpriority_t& x) |
---|
| 38 | { |
---|
| 39 | switch (x) |
---|
| 40 | { |
---|
| 41 | case morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::PRIORITY_STATIC : return "priority_static"; break; |
---|
| 42 | case morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::PRIORITY_ROUND_ROBIN : return "priority_round_robin"; break; |
---|
| 43 | default : return "" ; break; |
---|
| 44 | } |
---|
| 45 | }; |
---|
| 46 | |
---|
| 47 | template<> inline morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::Tpriority_t fromString<morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::Tpriority_t>(const std::string& x) |
---|
| 48 | { |
---|
| 49 | if ( (x.compare("0") == 0) or |
---|
| 50 | (x.compare("priority_static") == 0)) |
---|
| 51 | return morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::PRIORITY_STATIC; |
---|
| 52 | if ( (x.compare("1") == 0) or |
---|
| 53 | (x.compare("priority_round_robin") == 0)) |
---|
| 54 | return morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::PRIORITY_ROUND_ROBIN; |
---|
| 55 | throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\"")); |
---|
| 56 | }; |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | }; // end namespace morpheo |
---|
| 60 | |
---|
| 61 | #endif |
---|