openMSX
Public Member Functions | Static Public Attributes | List of all members
openmsx::MemOutputArchive Class Referencefinal

#include <serialize.hh>

Inheritance diagram for openmsx::MemOutputArchive:
Inheritance graph
[legend]
Collaboration diagram for openmsx::MemOutputArchive:
Collaboration graph
[legend]

Public Member Functions

 MemOutputArchive (LastDeltaBlocks &lastDeltaBlocks_, std::vector< std::shared_ptr< DeltaBlock >> &deltaBlocks_, bool reverseSnapshot_)
 
 ~MemOutputArchive ()
 
bool isReverseSnapshot () const
 
template<typename T >
void save (const T &t)
 
void saveChar (char c)
 
void save (const std::string &s)
 
void save (std::string_view s)
 
void serialize_blob (const char *tag, const void *data, size_t len, bool diff=true)
 
template<typename T , typename ... Args>
ALWAYS_INLINE void serialize (const char *tag, const T &t, Args &&...args)
 
template<typename T , size_t N>
ALWAYS_INLINE void serialize (const char *, const T(&t)[N], std::enable_if_t< SerializeAsMemcpy< T >::value > *=nullptr)
 
void beginSection ()
 
void endSection ()
 
MemBuffer< uint8_t > releaseBuffer (size_t &size)
 
- Public Member Functions inherited from openmsx::OutputArchiveBase< MemOutputArchive >
void serializeInlinedBase (T &t, unsigned version)
 
void serializeWithID (const char *tag, const T &t, Args...)
 
void serialize_blob (const char *tag, const void *data, size_t len, bool diff=true)
 
void serialize (const char *tag, const T &t)
 
void serializePointerID (const char *tag, const T &t)
 
void serializePolymorphic (const char *tag, const T &t)
 
void serializeOnlyOnce (const char *tag, const T &t)
 
void serializeChar (const char *tag, char c)
 
- Public Member Functions inherited from openmsx::ArchiveBase< Derived >
template<typename Base , typename T >
void serializeBase (T &t)
 Is this archive a loader or a saver. More...
 
template<typename Base , typename T >
void serializeInlinedBase (T &t, unsigned version)
 Serialize the base class of this classtype. More...
 
bool isReverseSnapshot () const
 Is this a reverse-snapshot? More...
 
template<typename T >
void attribute (const char *name, T &t)
 Load/store an attribute from/in the archive. More...
 
void attribute (const char *name, const char *value)
 
bool hasAttribute (const char *)
 Check the presence of a (optional) attribute. More...
 
bool findAttribute (const char *, unsigned &)
 Optimization: combination of hasAttribute() and getAttribute(). More...
 
int countChildren () const
 Count the number of child tags. More...
 
void beginTag (const char *)
 Indicate begin of a tag. More...
 
void endTag (const char *)
 Indicate begin of a tag. More...
 
- Public Member Functions inherited from openmsx::OutputArchiveBase2
bool versionAtLeast (unsigned, unsigned) const
 
bool versionBelow (unsigned, unsigned) const
 
void skipSection (bool)
 
template<typename T >
unsigned generateId (const T *p)
 
template<typename T >
unsigned getId (const T *p)
 

Static Public Attributes

static constexpr bool NEED_VERSION = false
 
- Static Public Attributes inherited from openmsx::ArchiveBase< Derived >
static constexpr bool NEED_VERSION = true
 Does this archive store version information. More...
 
static constexpr bool TRANSLATE_ENUM_TO_STRING = false
 Does this archive store enums as strings. More...
 
static constexpr bool CAN_HAVE_OPTIONAL_ATTRIBUTES = false
 Some archives (like XML archives) can store optional attributes. More...
 
static constexpr bool CAN_COUNT_CHILDREN = false
 Some archives (like XML archives) can count the number of subtags that belong to the current tag. More...
 
- Static Public Attributes inherited from openmsx::OutputArchiveBase2
static constexpr bool IS_LOADER = false
 

Additional Inherited Members

- Protected Member Functions inherited from openmsx::OutputArchiveBase< MemOutputArchive >
 OutputArchiveBase ()=default
 
- Protected Member Functions inherited from openmsx::ArchiveBase< Derived >
Derived & self ()
 Returns a reference to the most derived class. More...
 
- Protected Member Functions inherited from openmsx::OutputArchiveBase2
 OutputArchiveBase2 ()=default
 

Detailed Description

Definition at line 639 of file serialize.hh.

Constructor & Destructor Documentation

◆ MemOutputArchive()

openmsx::MemOutputArchive::MemOutputArchive ( LastDeltaBlocks lastDeltaBlocks_,
std::vector< std::shared_ptr< DeltaBlock >> &  deltaBlocks_,
bool  reverseSnapshot_ 
)
inline

Definition at line 642 of file serialize.hh.

◆ ~MemOutputArchive()

openmsx::MemOutputArchive::~MemOutputArchive ( )
inline

Definition at line 651 of file serialize.hh.

Member Function Documentation

◆ beginSection()

void openmsx::MemOutputArchive::beginSection ( )
inline

Definition at line 691 of file serialize.hh.

◆ endSection()

void openmsx::MemOutputArchive::endSection ( )
inline

Definition at line 698 of file serialize.hh.

References openmsx::OutputBuffer::getPosition().

◆ isReverseSnapshot()

bool openmsx::MemOutputArchive::isReverseSnapshot ( ) const
inline

Definition at line 657 of file serialize.hh.

◆ releaseBuffer()

MemBuffer< uint8_t > openmsx::MemOutputArchive::releaseBuffer ( size_t &  size)

Definition at line 184 of file serialize.cc.

References openmsx::OutputBuffer::release(), and utf8::unchecked::size().

◆ save() [1/3]

void openmsx::MemOutputArchive::save ( const std::string &  s)
inline

Definition at line 667 of file serialize.hh.

References save().

Referenced by save().

◆ save() [2/3]

template<typename T >
void openmsx::MemOutputArchive::save ( const T &  t)
inline

Definition at line 659 of file serialize.hh.

References t.

Referenced by saveChar(), openmsx::XMLDocument::serialize(), and serialize_blob().

◆ save() [3/3]

void openmsx::MemOutputArchive::save ( std::string_view  s)

Definition at line 174 of file serialize.cc.

References openmsx::OutputBuffer::allocate(), and utf8::unchecked::size().

◆ saveChar()

void openmsx::MemOutputArchive::saveChar ( char  c)
inline

Definition at line 663 of file serialize.hh.

References save().

◆ serialize() [1/2]

template<typename T , size_t N>
ALWAYS_INLINE void openmsx::MemOutputArchive::serialize ( const char *  ,
const T(&)  t[N],
std::enable_if_t< SerializeAsMemcpy< T >::value > *  = nullptr 
)
inline

Definition at line 685 of file serialize.hh.

References openmsx::OutputBuffer::insert(), openmsx::N, and t.

◆ serialize() [2/2]

template<typename T , typename ... Args>
ALWAYS_INLINE void openmsx::MemOutputArchive::serialize ( const char *  tag,
const T &  t,
Args &&...  args 
)
inline

Definition at line 674 of file serialize.hh.

References t.

◆ serialize_blob()

void openmsx::MemOutputArchive::serialize_blob ( const char *  tag,
const void *  data,
size_t  len,
bool  diff = true 
)

Member Data Documentation

◆ NEED_VERSION

constexpr bool openmsx::MemOutputArchive::NEED_VERSION = false
staticconstexpr

Definition at line 656 of file serialize.hh.


The documentation for this class was generated from the following files: