Changeset 162 for bdm/stat/loggers.h
- Timestamp:
- 09/04/08 20:27:01 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/stat/loggers.h
r145 r162 37 37 38 38 //! returns an identifier which will be later needed for calling the log() function 39 virtual int add ( RVrv, string name="" ) {39 virtual int add (const RV &rv, string name="" ) { 40 40 int id=entries.length(); 41 41 names=concat ( names, name ); // diff … … 48 48 virtual void logit ( int id, vec v ) =0; 49 49 50 //! consider this record to be complete 51 virtual void step(bool final=false) =0; 50 //! Shifts storage position for another time step. 51 virtual void step() =0; 52 53 //! Finalize storing information 54 virtual void finalize() {}; 52 55 53 56 //! for future use … … 82 85 ; 83 86 } 84 void step(bool final=false) {if ( ind<maxlen ) ind++; else it_error ( "memlog::ind is too high;" );} 85 void logit ( int id, vec v ) {vectors ( id ).set_row ( ind,v );} 87 void step() {if ( ind<maxlen ) ind++; else it_error ( "memlog::ind is too high;" );} 88 void logit ( int id, vec v ) { 89 it_assert_debug(id<vectors.length(),"Logger was not initialized, run init()."); 90 vectors ( id ).set_row ( ind,v );} 86 91 //! Save values into an itfile named after \c fname. 87 92 void itsave(const char* fname); … … 110 115 //! Initialize storage 111 116 void init(); 112 void step(bool final=false); 117 void step(); 118 void finalize(); 113 119 /*! \brief Write memory storage to disk. 114 120 @param Len length of buffer to be written, if 0 the file is truncated at 0.