mirror of
https://github.com/USCiLab/cereal.git
synced 2025-10-18 01:45:52 +02:00
Minor docs
This commit is contained in:
@@ -41,7 +41,6 @@ namespace cereal
|
|||||||
|
|
||||||
if(readSize != size)
|
if(readSize != size)
|
||||||
throw 1; // TODO: something terrible
|
throw 1; // TODO: something terrible
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -49,7 +48,7 @@ namespace cereal
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//! Serialization for POD types to binary
|
//! Saving for POD types to binary
|
||||||
template<class T>
|
template<class T>
|
||||||
typename std::enable_if<std::is_arithmetic<T>::value, void>::type
|
typename std::enable_if<std::is_arithmetic<T>::value, void>::type
|
||||||
save(BinaryOutputArchive & ar, T const & t)
|
save(BinaryOutputArchive & ar, T const & t)
|
||||||
@@ -58,6 +57,7 @@ namespace cereal
|
|||||||
std::cout << "Saving POD size: " << sizeof(T) << " [" << t << "]" << std::endl;
|
std::cout << "Saving POD size: " << sizeof(T) << " [" << t << "]" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Loading for POD types from binary
|
||||||
template<class T>
|
template<class T>
|
||||||
typename std::enable_if<std::is_arithmetic<T>::value, void>::type
|
typename std::enable_if<std::is_arithmetic<T>::value, void>::type
|
||||||
load(BinaryInputArchive & ar, T & t)
|
load(BinaryInputArchive & ar, T & t)
|
||||||
@@ -66,7 +66,7 @@ namespace cereal
|
|||||||
std::cout << "Loading POD size: " << sizeof(T) << " [" << t << "]" << std::endl;
|
std::cout << "Loading POD size: " << sizeof(T) << " [" << t << "]" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Serialization for NVP types to binary
|
//! Saving for NVP types to binary
|
||||||
template<class T>
|
template<class T>
|
||||||
void save(BinaryOutputArchive & ar, NameValuePair<T> const & t)
|
void save(BinaryOutputArchive & ar, NameValuePair<T> const & t)
|
||||||
{
|
{
|
||||||
@@ -74,6 +74,7 @@ namespace cereal
|
|||||||
ar & t.value;
|
ar & t.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Loading for NVP types from binary
|
||||||
template<class T>
|
template<class T>
|
||||||
void load(BinaryInputArchive & ar, NameValuePair<T> t)
|
void load(BinaryInputArchive & ar, NameValuePair<T> t)
|
||||||
{
|
{
|
||||||
@@ -92,7 +93,7 @@ namespace cereal
|
|||||||
std::cout << "Saving string: " << str << std::endl;
|
std::cout << "Saving string: " << str << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Serialization for basic_string types to binary
|
//! Serialization for basic_string types from binary
|
||||||
template<class CharT, class Traits, class Alloc>
|
template<class CharT, class Traits, class Alloc>
|
||||||
void load(BinaryInputArchive & ar, std::basic_string<CharT, Traits, Alloc> & str)
|
void load(BinaryInputArchive & ar, std::basic_string<CharT, Traits, Alloc> & str)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ namespace cereal
|
|||||||
#define CEREAL_NVP(T) ::cereal::make_nvp(#T, T);
|
#define CEREAL_NVP(T) ::cereal::make_nvp(#T, T);
|
||||||
|
|
||||||
// ######################################################################
|
// ######################################################################
|
||||||
|
//! The base output archive class
|
||||||
template<class ArchiveType>
|
template<class ArchiveType>
|
||||||
class OutputArchive
|
class OutputArchive
|
||||||
{
|
{
|
||||||
@@ -100,6 +101,7 @@ namespace cereal
|
|||||||
}; // class OutputArchive
|
}; // class OutputArchive
|
||||||
|
|
||||||
// ######################################################################
|
// ######################################################################
|
||||||
|
//! The base input archive class
|
||||||
template<class ArchiveType>
|
template<class ArchiveType>
|
||||||
class InputArchive
|
class InputArchive
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user