Commit 9c59fe34 authored by Isaak Lim's avatar Isaak Lim

added serialize and deserialize function to bool property specialization

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@284 66977474-1d4b-4f09-8fe9-267525286df2
parent 3a70bdc7
......@@ -293,6 +293,23 @@ public:
return _n_elem / 8 + ((_n_elem % 8) != 0);
}
// Function to serialize a property
virtual void serialize(std::ostream& _ostr) const {
for(typename vector_type::const_iterator it = data_.begin();
it != data_.end(); ++it) {
_ostr << *it << std::endl;
}
}
// Function to deserialize a property
virtual void deserialize(std::istream& _istr) {
for(unsigned int i = 0; i < n_elements(); ++i) {
value_type val;
_istr >> val;
data_[i] = val;
}
}
public:
/// Access the i'th element. No range check is performed!
......
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