source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Statistics_save.cpp @ 2

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 936 bytes
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
15namespace morpheo              {
16namespace behavioural          {
17
18  template <class Counters, class Parameters_Counters>
19  void Statistics::save(Counters ** & counters, Parameters_Counters parameters)
20  {
21    // Allocation of a new slot -> take param a first count
22    Counters ** counters_tmp;
23   
24    counters_tmp = new Counters * [_nb_statistics+1];
25   
26    // Copy
27    for (uint32_t i = 0; i < _nb_statistics; i ++)
28      counters_tmp [i] = counters [i];
29   
30    // New slot !
31    counters_tmp [_nb_statistics] = new Counters (parameters);
32   
33    // update pointer
34    counters = counters_tmp;
35    _nb_statistics ++;
36  };
37
38
39}; // end namespace behavioural         
40}; // end namespace morpheo             
41
42#endif
43#endif
Note: See TracBrowser for help on using the repository browser.