Reflection for RapidJSON 0.0.16
Reflection for serializing/deserializing with RapidJSON
Loading...
Searching...
No Matches
ReflectiveRapidJSON::BinaryReflector Namespace Reference

The BinaryReflector namespace contains BinaryReader and BinaryWriter for automatic binary (de)serialization. More...

Classes

class  BinaryDeserializer
 The BinaryDeserializer class can read various data types, including custom ones, from an std::istream. More...
 
class  BinarySerializer
 The BinarySerializer class can write various data types, including custom ones, to an std::ostream. More...
 

Typedefs

template<typename Type >
using IsBuiltInType
 
template<typename Type >
using IsCustomType = Traits::Not<IsBuiltInType<Type>>
 

Functions

template<typename Type , Traits::EnableIf< IsCustomType< Type > > * = nullptr>
BinaryVersion readCustomType (BinaryDeserializer &deserializer, Type &customType, BinaryVersion version=0)
 Reads customType via deserializer.
 
template<typename Type , Traits::EnableIf< IsCustomType< Type > > * = nullptr>
void writeCustomType (BinarySerializer &serializer, const Type &customType, BinaryVersion version=0)
 Writes customType via serializer.
 
template<>
BinaryVersion readCustomType< CppUtilities::DateTime > (BinaryDeserializer &deserializer, CppUtilities::DateTime &dateTime, BinaryVersion version)
 
template<>
void writeCustomType< CppUtilities::DateTime > (BinarySerializer &serializer, const CppUtilities::DateTime &dateTime, BinaryVersion version)
 
template<>
BinaryVersion readCustomType< CppUtilities::TimeSpan > (BinaryDeserializer &deserializer, CppUtilities::TimeSpan &timeSpan, BinaryVersion version)
 
template<>
void writeCustomType< CppUtilities::TimeSpan > (BinarySerializer &serializer, const CppUtilities::TimeSpan &timeSpan, BinaryVersion version)
 

Detailed Description

The BinaryReflector namespace contains BinaryReader and BinaryWriter for automatic binary (de)serialization.

Typedef Documentation

◆ IsBuiltInType

Initial value:
Traits::Any<Traits::IsAnyOf<Type, char, std::uint8_t, bool, std::string, std::int16_t, std::uint16_t, std::int32_t,
std::uint32_t, std::int64_t, std::uint64_t, float, double>,
Traits::IsIteratable<Type>, Traits::IsSpecializingAnyOf<Type, std::pair, std::unique_ptr, std::shared_ptr, std::optional>, std::is_enum<Type>,
IsVariant<Type>>

Definition at line 48 of file reflector.h.

◆ IsCustomType

template<typename Type >
using ReflectiveRapidJSON::BinaryReflector::IsCustomType = Traits::Not<IsBuiltInType<Type>>

Definition at line 52 of file reflector.h.

Function Documentation

◆ readCustomType()

template<typename Type , Traits::EnableIf< IsCustomType< Type > > * = nullptr>
BinaryVersion ReflectiveRapidJSON::BinaryReflector::readCustomType ( BinaryDeserializer & deserializer,
Type & customType,
BinaryVersion version = 0 )

Reads customType via deserializer.

Remarks
  • If \tp Type is versioned, the version is determined from the data. Otherwise version is assumed.
  • The determined or specified version shall be passed to nested invocations.
Returns
Returns the determined/assumed version.

Definition at line 28 of file reflector-boosthana.h.

◆ readCustomType< CppUtilities::DateTime >()

template<>
BinaryVersion ReflectiveRapidJSON::BinaryReflector::readCustomType< CppUtilities::DateTime > ( BinaryDeserializer & deserializer,
CppUtilities::DateTime & dateTime,
BinaryVersion version )
inline

Definition at line 20 of file reflector-chronoutilities.h.

◆ readCustomType< CppUtilities::TimeSpan >()

template<>
BinaryVersion ReflectiveRapidJSON::BinaryReflector::readCustomType< CppUtilities::TimeSpan > ( BinaryDeserializer & deserializer,
CppUtilities::TimeSpan & timeSpan,
BinaryVersion version )
inline

Definition at line 35 of file reflector-chronoutilities.h.

◆ writeCustomType()

template<typename Type , Traits::EnableIf< IsCustomType< Type > > * = nullptr>
void ReflectiveRapidJSON::BinaryReflector::writeCustomType ( BinarySerializer & serializer,
const Type & customType,
BinaryVersion version = 0 )

Writes customType via serializer.

Remarks
  • If \tp Type is versioned, version is prepended to the data.
  • The specified version shall be passed to nested invocations.

Definition at line 35 of file reflector-boosthana.h.

◆ writeCustomType< CppUtilities::DateTime >()

template<>
void ReflectiveRapidJSON::BinaryReflector::writeCustomType< CppUtilities::DateTime > ( BinarySerializer & serializer,
const CppUtilities::DateTime & dateTime,
BinaryVersion version )
inline

Definition at line 28 of file reflector-chronoutilities.h.

◆ writeCustomType< CppUtilities::TimeSpan >()

template<>
void ReflectiveRapidJSON::BinaryReflector::writeCustomType< CppUtilities::TimeSpan > ( BinarySerializer & serializer,
const CppUtilities::TimeSpan & timeSpan,
BinaryVersion version )
inline

Definition at line 43 of file reflector-chronoutilities.h.