X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fstlplus%2Fpersistence%2Fpersistent_float.hpp;fp=src%2Fstlplus%2Fpersistence%2Fpersistent_float.hpp;h=4a01e301b7223b927612d7241a83d961d0d4f934;hb=6b0a0d0efafe34d48ab344fca3b479553bd4e62c;hp=0000000000000000000000000000000000000000;hpb=85783316365181491a3e3c0c63659972477cebba;p=chaz%2Fyoink diff --git a/src/stlplus/persistence/persistent_float.hpp b/src/stlplus/persistence/persistent_float.hpp new file mode 100644 index 0000000..4a01e30 --- /dev/null +++ b/src/stlplus/persistence/persistent_float.hpp @@ -0,0 +1,37 @@ +#ifndef STLPLUS_PERSISTENT_FLOAT +#define STLPLUS_PERSISTENT_FLOAT +//////////////////////////////////////////////////////////////////////////////// + +// Author: Andy Rushton +// Copyright: (c) Southampton University 1999-2004 +// (c) Andy Rushton 2004-2009 +// License: BSD License, see ../docs/license.html + +// Persistence of floating-point types + +// Note: despite years and years of IEEE standardisation, not all +// architectures use IEEE-standard representations of floating-point numbers. +// Therefore a binary dump is not necessarily portable between platforms. +// Solving this is (currently) beyond the scope of the STLplus project. + +// If you want to be strictly portable to all platforms, do not dump/restore float + +//////////////////////////////////////////////////////////////////////////////// +#include "persistence_fixes.hpp" +#include "persistent_contexts.hpp" + +//////////////////////////////////////////////////////////////////////////////// + +namespace stlplus +{ + + void dump_float(dump_context&, const float& data) throw(persistent_dump_failed); + void restore_float(restore_context&, float& data) throw(persistent_restore_failed); + + void dump_double(dump_context&, const double& data) throw(persistent_dump_failed); + void restore_double(restore_context&, double& data) throw(persistent_restore_failed); + +} // end namespace stlplus + + //////////////////////////////////////////////////////////////////////////////// +#endif