Last change
on this file since 52 was
43,
checked in by rosiere, 17 years ago
|
Modif mineur : ajout d'info de débug
Release non stable
|
File size:
1.1 KB
|
Line | |
---|
1 | #ifdef STATISTICS |
---|
2 | |
---|
3 | #ifndef morpheo_behavioural_Statistics_save_cpp |
---|
4 | #define morpheo_behavioural_Statistics_save_cpp |
---|
5 | |
---|
6 | /* |
---|
7 | * $Id$ |
---|
8 | * |
---|
9 | * [ Description ] |
---|
10 | * |
---|
11 | */ |
---|
12 | |
---|
13 | #include "Behavioural/include/Statistics.h" |
---|
14 | |
---|
15 | namespace morpheo { |
---|
16 | namespace behavioural { |
---|
17 | |
---|
18 | #undef FUNCTION |
---|
19 | #define FUNCTION "Statistics::save" |
---|
20 | template <class Counters, class Parameters_Counters> |
---|
21 | void Statistics::save(Counters ** & counters, Parameters_Counters parameters) |
---|
22 | { |
---|
23 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
24 | |
---|
25 | // Allocation of a new slot -> take param a first count |
---|
26 | Counters ** counters_tmp; |
---|
27 | |
---|
28 | counters_tmp = new Counters * [_nb_statistics+1]; |
---|
29 | |
---|
30 | // Copy |
---|
31 | for (uint32_t i = 0; i < _nb_statistics; i ++) |
---|
32 | counters_tmp [i] = counters [i]; |
---|
33 | |
---|
34 | // New slot ! |
---|
35 | counters_tmp [_nb_statistics] = new Counters (parameters); |
---|
36 | |
---|
37 | // update pointer |
---|
38 | counters = counters_tmp; |
---|
39 | _nb_statistics ++; |
---|
40 | |
---|
41 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
42 | }; |
---|
43 | |
---|
44 | }; // end namespace behavioural |
---|
45 | }; // end namespace morpheo |
---|
46 | |
---|
47 | #endif |
---|
48 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.