[88] | 1 | /* |
---|
| 2 | * $Id: Priority.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Generic/Priority/include/Priority.h" |
---|
| 9 | #include "Common/include/Max.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace priority { |
---|
| 15 | |
---|
| 16 | #undef FUNCTION |
---|
| 17 | #define FUNCTION "Priority::Priority" |
---|
| 18 | Priority::Priority (std::string name, |
---|
| 19 | Tpriority_t priority , |
---|
| 20 | Tload_balancing_t load_balancing, |
---|
| 21 | uint32_t nb_grp , |
---|
| 22 | uint32_t * nb_elt ,//[nb_grp] |
---|
| 23 | uint32_t nb_grp_select |
---|
| 24 | ): |
---|
| 25 | _name (name) |
---|
| 26 | { |
---|
| 27 | log_begin(Priority,FUNCTION); |
---|
| 28 | |
---|
| 29 | _priority = priority ; |
---|
| 30 | _load_balancing = load_balancing; |
---|
| 31 | _nb_grp = nb_grp ; |
---|
| 32 | _nb_elt = nb_elt ; |
---|
| 33 | _nb_grp_select = nb_grp_select ; |
---|
| 34 | _max_nb_elt = max<uint32_t>(_nb_elt,_nb_grp); |
---|
| 35 | |
---|
| 36 | allocation(); |
---|
| 37 | |
---|
| 38 | log_end(Priority,FUNCTION); |
---|
| 39 | }; |
---|
| 40 | |
---|
| 41 | #undef FUNCTION |
---|
| 42 | #define FUNCTION "Priority::Priority" |
---|
| 43 | Priority::Priority (std::string name, |
---|
| 44 | Tpriority_t priority , |
---|
| 45 | uint32_t nb_grp , |
---|
| 46 | uint32_t nb_grp_select |
---|
| 47 | ): |
---|
| 48 | _name (name) |
---|
| 49 | { |
---|
| 50 | log_begin(Priority,FUNCTION); |
---|
| 51 | |
---|
| 52 | _priority = priority ; |
---|
| 53 | _load_balancing = LOAD_BALANCING_MAXIMUM_FOR_PRIORITY; |
---|
| 54 | _nb_grp = nb_grp ; |
---|
| 55 | // _nb_elt = nb_elt ; |
---|
| 56 | _nb_grp_select = nb_grp_select ; |
---|
| 57 | _max_nb_elt = 1; |
---|
| 58 | |
---|
| 59 | allocation(); |
---|
| 60 | |
---|
| 61 | log_end(Priority,FUNCTION); |
---|
| 62 | }; |
---|
| 63 | |
---|
| 64 | #undef FUNCTION |
---|
| 65 | #define FUNCTION "Priority::Priority" |
---|
| 66 | Priority::Priority (std::string name, |
---|
| 67 | Tpriority_t priority , |
---|
| 68 | uint32_t nb_grp |
---|
| 69 | ): |
---|
| 70 | _name (name) |
---|
| 71 | { |
---|
| 72 | log_begin(Priority,FUNCTION); |
---|
| 73 | |
---|
| 74 | _priority = priority ; |
---|
| 75 | _load_balancing = LOAD_BALANCING_MAXIMUM_FOR_PRIORITY; |
---|
| 76 | _nb_grp = nb_grp ; |
---|
| 77 | // _nb_elt = nb_elt ; |
---|
| 78 | _nb_grp_select = nb_grp ; |
---|
| 79 | _max_nb_elt = 1; |
---|
| 80 | |
---|
| 81 | allocation(); |
---|
| 82 | |
---|
| 83 | log_end(Priority,FUNCTION); |
---|
| 84 | }; |
---|
| 85 | |
---|
| 86 | #undef FUNCTION |
---|
| 87 | #define FUNCTION "Priority::~Priority" |
---|
| 88 | Priority::~Priority (void) |
---|
| 89 | { |
---|
| 90 | log_begin(Priority,FUNCTION); |
---|
| 91 | |
---|
| 92 | deallocation (); |
---|
| 93 | |
---|
| 94 | log_end(Priority,FUNCTION); |
---|
| 95 | }; |
---|
| 96 | |
---|
| 97 | }; // end namespace priority |
---|
| 98 | }; // end namespace generic |
---|
| 99 | |
---|
| 100 | }; // end namespace behavioural |
---|
| 101 | }; // end namespace morpheo |
---|