openMSX
|
#include <serialize.hh>
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, std::span< const uint8_t > data, 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> requires (SerializeAsMemcpy<T>::value) | |
ALWAYS_INLINE void | serialize (const char *, const std::array< T, N > &t) |
void | beginSection () |
void | endSection () |
MemBuffer< uint8_t > | releaseBuffer () && |
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, std::span< const uint8_t > data, 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. | |
template<typename Base , typename T > | |
void | serializeInlinedBase (T &t, unsigned version) |
Serialize the base class of this classtype. | |
template<typename T > | |
void | serialize_blob (const char *tag, std::span< T > data, bool diff=true) |
template<typename T > | |
void | serialize_blob (const char *tag, std::span< const T > data, bool diff=true) |
bool | isReverseSnapshot () const |
Is this a reverse-snapshot? | |
template<typename T > | |
void | attribute (const char *name, T &t) |
Load/store an attribute from/in the archive. | |
void | attribute (const char *name, const char *value) |
bool | hasAttribute (const char *) const |
Check the presence of a (optional) attribute. | |
template<typename T > | |
std::optional< T > | findAttributeAs (const char *) |
Optimization: combination of hasAttribute() and getAttribute(). | |
int | countChildren () const |
Count the number of child tags. | |
void | beginTag (const char *) const |
Indicate begin of a tag. | |
void | endTag (const char *) const |
Indicate begin of a tag. | |
Public Member Functions inherited from openmsx::OutputArchiveBase2 | |
bool | versionAtLeast (unsigned, unsigned) const |
bool | versionBelow (unsigned, unsigned) const |
void | skipSection (bool) const |
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. | |
static constexpr bool | TRANSLATE_ENUM_TO_STRING = false |
Does this archive store enums as strings. | |
static constexpr bool | CAN_HAVE_OPTIONAL_ATTRIBUTES = false |
Some archives (like XML archives) can store optional attributes. | |
static constexpr bool | CAN_COUNT_CHILDREN = false |
Some archives (like XML archives) can count the number of subtags that belong to the current tag. | |
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. | |
Protected Member Functions inherited from openmsx::OutputArchiveBase2 | |
OutputArchiveBase2 ()=default | |
Definition at line 654 of file serialize.hh.
|
inline |
Definition at line 657 of file serialize.hh.
|
inline |
Definition at line 666 of file serialize.hh.
|
inline |
Definition at line 706 of file serialize.hh.
References openmsx::OutputBuffer::getPosition(), and save().
|
inline |
Definition at line 713 of file serialize.hh.
References openmsx::OutputBuffer::getPosition(), and openmsx::OutputBuffer::insertAt().
|
inline |
Definition at line 672 of file serialize.hh.
|
inline |
Definition at line 724 of file serialize.hh.
|
inline |
|
inline |
Definition at line 674 of file serialize.hh.
References openmsx::OutputBuffer::insert(), and t.
Referenced by beginSection(), saveChar(), openmsx::XMLDocument::serialize(), and serialize_blob().
void openmsx::MemOutputArchive::save | ( | std::string_view | s | ) |
Definition at line 176 of file serialize.cc.
References openmsx::OutputBuffer::allocate(), ranges::copy(), and subspan().
|
inline |
Definition at line 678 of file serialize.hh.
References save().
|
inline |
Definition at line 700 of file serialize.hh.
References openmsx::OutputBuffer::insert(), and t.
|
inline |
Definition at line 689 of file serialize.hh.
References t.
void openmsx::MemOutputArchive::serialize_blob | ( | const char * | tag, |
std::span< const uint8_t > | data, | ||
bool | diff = true |
||
) |
Definition at line 213 of file serialize.cc.
References openmsx::OutputBuffer::allocate(), ranges::copy(), openmsx::LastDeltaBlocks::createNew(), openmsx::LastDeltaBlocks::createNullDiff(), and save().
|
staticconstexpr |
Definition at line 671 of file serialize.hh.