20 #ifndef CO_DATASTREAMARCHIVEEXCEPTION_H
21 #define CO_DATASTREAMARCHIVEEXCEPTION_H
23 #include <boost/lexical_cast.hpp>
24 #include <boost/archive/archive_exception.hpp>
29 namespace serialization
32 const unsigned no_infnan = 64;
56 : boost::archive::archive_exception(other_exception)
57 , msg(
"requested integer size exceeds type size: ")
59 msg += boost::lexical_cast<std::string,
int>(invalid_size);
64 : boost::archive::archive_exception(other_exception)
65 , msg(
"cannot read a negative number into an unsigned type")
72 : boost::archive::archive_exception(other_exception)
73 , msg(
"serialization of illegal floating point value: ")
75 msg += boost::lexical_cast<std::string>(abnormal);
79 const char*
what()
const throw() {
return msg.c_str(); }
85 #endif //CO_DATAOSTREAMARCHIVE_H
Exception thrown when serialization cannot proceed.
DataStreamArchiveException(const T &abnormal)
serialization of inf, nan and denormals
DataStreamArchiveException()
negative number in unsigned type
const char * what() const
override the base class function with our message
DataStreamArchiveException(signed char invalid_size)
type size is not large enough for deserialized number