Commit b1c4c640 authored by stefanwessel's avatar stefanwessel
Browse files

added vector<bool> support (needs testing)


git-svn-id: https://svn.rwth-aachen.de/repos/sw440870_load_leveller/trunk@20 36cca2a8-63f0-4188-8a56-663e3b0d1cf3
parent 0c97f245
......@@ -16,3 +16,24 @@ void idump :: read(std::string& a)
a=ca;
}
void odump :: write(std::vector<bool>& v) {
luint n=v.size();
write(n);
for (uint i=0;i<n;++i) {
bool nel = v[i];
write(nel);
}
}
void idump :: read(std::vector<bool>& v) {
luint n;
read(n);
v.clear();
for (uint i=0;i<n;++i) {
bool nel;
read(nel);
v.push_back(nel);
}
}
......@@ -115,7 +115,7 @@ class odump
}
}
template <class Type> void write(std::vector<Type>&);
// void write(std::vector<bool>&);
void write(std::vector<bool>&);
template <class Type> void write(Type*, int);
template <class Type> void write(Type&);
void write(std::string&);
......@@ -151,7 +151,7 @@ class idump
bool good() {return !(!binary_file);}
void open(std::string filename) {if (!is_open) {binary_file.open(filename.c_str(),std::ios::in|std::ios::binary);is_open=1;}}
template <class Type> void read(std::vector<Type>&);
// void read(std::vector<bool>&);
void read(std::vector<bool>&);
template <class Type> void read(Type*, int);
template <class Type> void read(Type&);
// read data and swap endianness
......@@ -174,15 +174,6 @@ void odump :: write(std::vector<Type>& v) {
write(v[i]);
}
/*void odump :: write(std::vector<bool>& v) {
luint n=v.size();
write(n);
for (uint i=0;i<n;++i) {
bool nel = v[i];
write(nel);
}
}*/
template <class Type>
void odump :: write(Type *a, int size)
{
......@@ -207,17 +198,6 @@ void idump :: read(std::vector<Type>& v) {
}
}
/*void idump :: read(std::vector<bool>& v) {
luint n;
read(n);
v.clear();
for (uint i=0;i<n;++i) {
bool nel;
read(nel);
v.push_back(nel);
}
}*/
template <class Type>
void idump :: read_se(std::vector<Type>& v) {
luint n;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment