24 #ifndef ASLABDFORMAT_H 25 #define ASLABDFORMAT_H 142 ABDFileIn::ABDFileIn():ifstream()
145 ifstream(name,ios::
in | ios::binary)
151 ofstream(name,ios::out | ios::binary)
156 f.write((
char*)&a,
sizeof(
int));
162 f.read((
char*)&a,
sizeof(
int));
168 f.write((
char*)&a,
sizeof(
unsigned int));
174 f.read((
char*)&a,
sizeof(
unsigned int));
180 f.write((
char*)&a,
sizeof(
float));
186 f.read((
char*)&a,
sizeof(
float));
192 f.write((
char*)&a,
sizeof(
double));
198 f.read((
char*)&a,
sizeof(
double));
205 f.write((
char*)a.first,
sizeof(T)*a.second);
210 f.read((
char*)a.first,
sizeof(T)*a.second);
215 unsigned int n=a.size();
216 f<<n<<make_pair(&a[0],n);
223 f>>make_pair(a.data(),n);
230 f<<n<<make_pair(&(a[0]),n);
239 f>>make_pair(&(a[0]),n);
246 #endif //ASLVTKFORMAT_H Advanced Simulation Library.
ABDFileIn & operator>>(ABDFileIn &f, int &a)
ABDFileOut & operator<<(ABDFileOut &f, const AVec< T > &a)
ABDFileIn & operator>>(ABDFileIn &f, AVec< T > &a)
bool in(const T &xx, const T &x1, const T &x2)
Checks the belonging to a closed interval [x1,x2], .
std::ostream & operator<<(std::ostream &output, const std::vector< T > &vector)
Prints elements of the vector separated by space.
ABD (ASL Binary Dump) file, output.
const unsigned int & getSize() const
ABD (ASL Binary Dump) file, input.
void resize(unsigned int newSize)