Unravel Engine C++ Reference
Loading...
Searching...
No Matches
serialization.h File Reference
#include "ser20/access.hpp"
#include "ser20/ser20.hpp"
#include "ser20/types/polymorphic.hpp"
#include "ser20/types/vector.hpp"
#include <hpp/source_location.hpp>
#include <functional>
#include <string>
#include <vector>
#include <stack>

Go to the source code of this file.

Classes

struct  serialization::path_context
 
struct  serialization::path_segment_guard
 

Namespaces

namespace  serialization
 

Macros

#define SERIALIZE_FUNCTION_NAME   SER20_SERIALIZE_FUNCTION_NAME
 
#define SAVE_FUNCTION_NAME   SER20_SAVE_FUNCTION_NAME
 
#define LOAD_FUNCTION_NAME   SER20_LOAD_FUNCTION_NAME
 
#define SAVE_MINIMAL_FUNCTION_NAME   SER20_SAVE_MINIMAL_FUNCTION_NAME
 
#define LOAD_MINIMAL_FUNCTION_NAME   SER20_LOAD_MINIMAL_FUNCTION_NAME
 
#define SERIALIZE_REGISTER_TYPE_WITH_NAME(T, Name)
 
#define SERIALIZABLE(T)
 
#define SERIALIZE_INLINE(cls)
 
#define SAVE_INLINE(cls)
 
#define LOAD_INLINE(cls)
 
#define SERIALIZE_EXTERN(cls)
 
#define SAVE_EXTERN(cls)
 
#define LOAD_EXTERN(cls)
 
#define SERIALIZE(cls)
 
#define SAVE(cls)
 
#define LOAD(cls)
 
#define SERIALIZE_INSTANTIATE(cls, Archive)
 
#define SAVE_INSTANTIATE(cls, Archive)
 
#define LOAD_INSTANTIATE(cls, Archive)
 

Typedefs

using serialization::log_callback_t = std::function<void(const std::string&, const hpp::source_location& loc)>
 

Functions

void serialization::set_warning_logger (const log_callback_t &logger)
 
void serialization::log_warning (const std::string &log_msg, const hpp::source_location &loc)
 
auto serialization::get_path_context () -> path_context *
 
void serialization::set_path_context (path_context *ctx)
 
auto serialization::get_current_deserialization_path () -> std::string
 
template<typename Archive >
constexpr auto is_binary_archive () -> bool
 
template<typename Archive , typename T >
auto try_serialize_direct (Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
 
template<typename F >
auto serialize_check (const std::string &name, F &&serialize_callback) -> bool
 
template<typename Archive , typename T >
auto try_serialize (Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
 
template<typename Archive , typename T >
auto try_save (Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
 
template<typename Archive , typename T >
auto try_load (Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
 

Macro Definition Documentation

◆ LOAD

#define LOAD ( cls)
Value:
template<typename Archive> \
void LOAD_FUNCTION_NAME(Archive& ar, cls& obj)
#define LOAD_FUNCTION_NAME

Definition at line 118 of file serialization.h.

◆ LOAD_EXTERN

#define LOAD_EXTERN ( cls)
Value:
template<typename Archive> \
extern void LOAD_FUNCTION_NAME(Archive& ar, cls& obj)

Definition at line 106 of file serialization.h.

◆ LOAD_FUNCTION_NAME

#define LOAD_FUNCTION_NAME   SER20_LOAD_FUNCTION_NAME

Definition at line 15 of file serialization.h.

◆ LOAD_INLINE

#define LOAD_INLINE ( cls)
Value:
template<typename Archive> \
inline void LOAD_FUNCTION_NAME(Archive& ar, cls& obj)

Definition at line 94 of file serialization.h.

◆ LOAD_INSTANTIATE

#define LOAD_INSTANTIATE ( cls,
Archive )
Value:
template void LOAD_FUNCTION_NAME(Archive& archive, cls& obj)

Definition at line 126 of file serialization.h.

◆ LOAD_MINIMAL_FUNCTION_NAME

#define LOAD_MINIMAL_FUNCTION_NAME   SER20_LOAD_MINIMAL_FUNCTION_NAME

Definition at line 17 of file serialization.h.

◆ SAVE

#define SAVE ( cls)
Value:
template<typename Archive> \
void SAVE_FUNCTION_NAME(Archive& ar, cls const& obj)
#define SAVE_FUNCTION_NAME

Definition at line 114 of file serialization.h.

◆ SAVE_EXTERN

#define SAVE_EXTERN ( cls)
Value:
template<typename Archive> \
extern void SAVE_FUNCTION_NAME(Archive& ar, cls const& obj)

Definition at line 102 of file serialization.h.

◆ SAVE_FUNCTION_NAME

#define SAVE_FUNCTION_NAME   SER20_SAVE_FUNCTION_NAME

Definition at line 14 of file serialization.h.

◆ SAVE_INLINE

#define SAVE_INLINE ( cls)
Value:
template<typename Archive> \
inline void SAVE_FUNCTION_NAME(Archive& ar, cls const& obj)

Definition at line 90 of file serialization.h.

◆ SAVE_INSTANTIATE

#define SAVE_INSTANTIATE ( cls,
Archive )
Value:
template void SAVE_FUNCTION_NAME(Archive& archive, cls const& obj)

Definition at line 124 of file serialization.h.

◆ SAVE_MINIMAL_FUNCTION_NAME

#define SAVE_MINIMAL_FUNCTION_NAME   SER20_SAVE_MINIMAL_FUNCTION_NAME

Definition at line 16 of file serialization.h.

◆ SERIALIZABLE

#define SERIALIZABLE ( T)
Value:
\
public: \
friend class serialization::access; \
template<typename Archive> \
friend void SAVE_FUNCTION_NAME(Archive& ar, T const&); \
template<typename Archive> \
friend void LOAD_FUNCTION_NAME(Archive& ar, T&);

Definition at line 77 of file serialization.h.

◆ SERIALIZE

#define SERIALIZE ( cls)
Value:
template<typename Archive> \
void SERIALIZE_FUNCTION_NAME(Archive& ar, cls& obj)
#define SERIALIZE_FUNCTION_NAME

Definition at line 110 of file serialization.h.

◆ SERIALIZE_EXTERN

#define SERIALIZE_EXTERN ( cls)
Value:
template<typename Archive> \
extern void SERIALIZE_FUNCTION_NAME(Archive& ar, cls& obj)

Definition at line 98 of file serialization.h.

◆ SERIALIZE_FUNCTION_NAME

#define SERIALIZE_FUNCTION_NAME   SER20_SERIALIZE_FUNCTION_NAME

Definition at line 13 of file serialization.h.

◆ SERIALIZE_INLINE

#define SERIALIZE_INLINE ( cls)
Value:
template<typename Archive> \
inline void SERIALIZE_FUNCTION_NAME(Archive& ar, cls& obj)

Definition at line 86 of file serialization.h.

◆ SERIALIZE_INSTANTIATE

#define SERIALIZE_INSTANTIATE ( cls,
Archive )
Value:
template void SERIALIZE_FUNCTION_NAME(Archive& archive, cls& obj)

Definition at line 122 of file serialization.h.

◆ SERIALIZE_REGISTER_TYPE_WITH_NAME

#define SERIALIZE_REGISTER_TYPE_WITH_NAME ( T,
Name )
Value:
SER20_REGISTER_TYPE_WITH_NAME(T, Name)

Definition at line 18 of file serialization.h.

Function Documentation

◆ is_binary_archive()

template<typename Archive >
auto is_binary_archive ( ) -> bool
inlineconstexpr

Definition at line 129 of file serialization.h.

◆ serialize_check()

template<typename F >
auto serialize_check ( const std::string & name,
F && serialize_callback ) -> bool
inline

Definition at line 155 of file serialization.h.

◆ try_load()

template<typename Archive , typename T >
auto try_load ( Archive & ar,
ser20::NameValuePair< T > && t,
const hpp::source_location & loc = hpp::source_location::current() ) -> bool
inline

Definition at line 195 of file serialization.h.

◆ try_save()

template<typename Archive , typename T >
auto try_save ( Archive & ar,
ser20::NameValuePair< T > && t,
const hpp::source_location & loc = hpp::source_location::current() ) -> bool
inline

Definition at line 187 of file serialization.h.

◆ try_serialize()

template<typename Archive , typename T >
auto try_serialize ( Archive & ar,
ser20::NameValuePair< T > && t,
const hpp::source_location & loc = hpp::source_location::current() ) -> bool
inline

Definition at line 173 of file serialization.h.

◆ try_serialize_direct()

template<typename Archive , typename T >
auto try_serialize_direct ( Archive & ar,
ser20::NameValuePair< T > && t,
const hpp::source_location & loc = hpp::source_location::current() ) -> bool
inline

Definition at line 135 of file serialization.h.