[88] | 1 | /* |
---|
| 2 | * $Id: Instance_test.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Configuration/include/Instance.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace configuration { |
---|
| 13 | |
---|
| 14 | #undef FUNCTION |
---|
| 15 | #define FUNCTION "Instance::test" |
---|
| 16 | void Instance::test (std::string type, |
---|
| 17 | std::string value) |
---|
| 18 | { |
---|
| 19 | log_begin(Configuration,FUNCTION); |
---|
| 20 | |
---|
| 21 | // Test the parameter : |
---|
| 22 | // * name is correct |
---|
| 23 | // * value is correct |
---|
| 24 | |
---|
| 25 | _generator->test(type, value); |
---|
| 26 | |
---|
| 27 | log_end(Configuration,FUNCTION); |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | #undef FUNCTION |
---|
| 31 | #define FUNCTION "Instance::test" |
---|
| 32 | void Instance::test (std::string type, |
---|
| 33 | std::string father_name, |
---|
| 34 | bool father_is_src, |
---|
| 35 | bool father_is_dest) |
---|
| 36 | { |
---|
| 37 | log_begin(Configuration,FUNCTION); |
---|
| 38 | |
---|
| 39 | // * name is correct |
---|
| 40 | // * if not have_src , test if src is correct |
---|
| 41 | // * if not have_dest, test if dest is correct |
---|
| 42 | _generator->test(type, |
---|
| 43 | father_name, |
---|
| 44 | father_is_src, |
---|
| 45 | father_is_dest); |
---|
| 46 | |
---|
| 47 | log_end(Configuration,FUNCTION); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | #undef FUNCTION |
---|
| 51 | #define FUNCTION "Instance::test" |
---|
| 52 | |
---|
| 53 | void Instance::test (std::string link, |
---|
| 54 | std::vector<std::string> & vect, |
---|
| 55 | uint32_t nb_elt) |
---|
| 56 | { |
---|
| 57 | log_begin(Configuration,FUNCTION); |
---|
| 58 | |
---|
| 59 | if (vect.size() == 0) |
---|
| 60 | for (uint32_t i=0; i<nb_elt; ++i) |
---|
| 61 | vect.push_back("0"); // default to link |
---|
| 62 | else |
---|
| 63 | if (vect.size() != nb_elt) |
---|
| 64 | throw ERRORMORPHEO(FUNCTION,toString(_("The destination of link \"%s\" must an index on %d elements.\n"),link.c_str(),nb_elt)); |
---|
| 65 | |
---|
| 66 | log_end(Configuration,FUNCTION); |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | /* |
---|
| 70 | #undef FUNCTION |
---|
| 71 | #define FUNCTION "Instance::test" |
---|
| 72 | void Instance::test (std::string component, |
---|
| 73 | uint32_t nb_component) |
---|
| 74 | { |
---|
| 75 | log_begin(Configuration,FUNCTION); |
---|
| 76 | |
---|
| 77 | test (component,nb_component,_list_components); |
---|
| 78 | |
---|
| 79 | log_end(Configuration,FUNCTION); |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | #undef FUNCTION |
---|
| 83 | #define FUNCTION "Instance::test" |
---|
| 84 | void Instance::test (std::string component, |
---|
| 85 | uint32_t nb_component, |
---|
| 86 | list_components_t * list_components) |
---|
| 87 | { |
---|
| 88 | log_begin(Configuration,FUNCTION); |
---|
| 89 | |
---|
| 90 | // ........................ |
---|
| 91 | |
---|
| 92 | |
---|
| 93 | for (list_components_t::iterator it1=list_components->begin(); |
---|
| 94 | it1!=list_components->end(); |
---|
| 95 | ++it1) |
---|
| 96 | for (list_instances_t::iterator it2=it1->second.begin(); |
---|
| 97 | it2!=it1->second.end(); |
---|
| 98 | ++it2) |
---|
| 99 | test (component,nb_component,it2->second->_list_components); |
---|
| 100 | |
---|
| 101 | log_end(Configuration,FUNCTION); |
---|
| 102 | } |
---|
| 103 | */ |
---|
| 104 | |
---|
| 105 | }; // end namespace configuration |
---|
| 106 | }; // end namespace behavioural |
---|
| 107 | }; // end namespace morpheo |
---|