#include <CPersistentVector.h>
Public Member Functions | |
| CPersistentVector (long inLength) | |
| bool | read (istream &inStream) |
| bool | read (istream &inStream, long inNumRecords) |
| bool | write (ostream &outStream) const |
| void | init (T const &inDefaultValue) |
Private Attributes | |
| long | mLength |
Definition at line 50 of file CPersistentVector.h.
| CPersistentVector< T >::CPersistentVector | ( | long | inLength | ) | [inline] |
Definition at line 68 of file CPersistentVector.h.
00068 : 00069 mLength(inLength), 00070 vector<T>(inLength) 00071 { 00072 }
| bool CPersistentVector< T >::read | ( | istream & | inStream | ) | [inline] |
Definition at line 94 of file CPersistentVector.h.
References CPersistentVector< T >::mLength.
Referenced by CPersistentMatrix< T >::getLineVector().
| bool CPersistentVector< T >::read | ( | istream & | inStream, | |
| long | inNumRecords | |||
| ) | [inline] |
Definition at line 100 of file CPersistentVector.h.
References binary_reader(), and CPersistentVector< T >::mLength.
00101 { 00102 this->reserve(inLength); 00103 this->clear(); 00104 for(long i=0; 00105 i<inLength; 00106 i++){ 00107 T lToBeRead; 00108 binary_reader(inStream, 00109 lToBeRead); 00110 00111 assert(lToBeRead>=0 && lToBeRead<=1); 00112 00113 push_back(lToBeRead); 00114 } 00115 mLength=inLength; 00116 return inStream; 00117 }
| bool CPersistentVector< T >::write | ( | ostream & | outStream | ) | const [inline] |
Definition at line 120 of file CPersistentVector.h.
References binary_writer().
Referenced by CPersistentMatrix< T >::create(), and CPersistentMatrix< T >::putLineVector().
00120 { 00121 for(typename CPersistentVector<T>::const_iterator i=this->begin(); 00122 i!=this->end(); 00123 i++){ 00124 binary_writer(outStream, 00125 *i); 00126 } 00127 outStream << flush; 00128 return outStream; 00129 }
| void CPersistentVector< T >::init | ( | T const & | inDefaultValue | ) | [inline] |
Definition at line 75 of file CPersistentVector.h.
References CPersistentVector< T >::mLength.
00075 { 00076 #ifdef V295 00077 constant_void_fun<T> f(inDefaultValue); 00078 00079 this->clear(); 00080 this->reserve(mLength); 00081 for(long i=0; 00082 i<mLength; 00083 i++){ 00084 push_back(f()); 00085 } 00086 #else 00087 this->clear(); 00088 this->resize(mLength); 00089 fill(this->begin(),this->end(),inDefaultValue); 00090 #endif 00091 }
long CPersistentVector< T >::mLength [private] |
Definition at line 52 of file CPersistentVector.h.
Referenced by CPersistentVector< T >::init(), and CPersistentVector< T >::read().
1.5.6