- Timestamp:
- May 12, 2010, 7:34:01 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_type.h
r81 r138 6 6 #include <map> 7 7 #include <utility> 8 #include <cassert> 8 9 9 10 namespace morpheo { … … 19 20 //typedef std::pair<std::string, operator_t> pair_string_operator_t; 20 21 22 class counters_t 23 { 24 private : const uint32_t _nb_counter; 25 private : counter_t ** _counter; 26 27 public : counters_t (uint32_t nb_counter): 28 _nb_counter (nb_counter+1) 29 { 30 assert(nb_counter>0); 31 32 _counter = new counter_t * [_nb_counter]; 33 } 34 35 // public : counters_t (const counters_t & x): 36 // _nb_counter (x._nb_counter) 37 // { 38 // _counter = new counter_t [_nb_counter]; 39 40 // for (uint32_t i=0; i<_nb_counter; ++i) 41 // _counter[i] = x._counter[i]; 42 // } 43 44 public : ~counters_t (void) 45 { 46 delete [] _counter; 47 } 48 49 public : void set_counter (counter_t * counter, 50 uint32_t index) 51 { 52 assert((index >= 0) and (index < _nb_counter)); 53 54 _counter [index] = counter; 55 } 56 57 // public : friend const counters_t operator+ (const counters_t & left, 58 // const uint32_t right) 59 // { 60 // assert((right >= 0) and (right <= left._nb_counter)); 61 62 // counters_t tmp=left; 63 64 // tmp._counter[right] ++; 65 66 // return tmp; 67 // } 68 69 public : const counters_t & operator+= (const uint32_t value) 70 { 71 assert((value >= 0) and (value <= _nb_counter)); 72 73 (*_counter[value]) ++; 74 75 return *this; 76 } 77 78 }; 79 21 80 }; 22 81 };
Note: See TracChangeset
for help on using the changeset viewer.