[#Serialize-055] = Serialize :mrdocs: `Serialize` overloads == Synopses Declared in `<serialize.h>` Serialize a boolean to a stream as a single byte. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Serialize-0c6.adoc[Serialize]( Stream& s, bool a); ---- [.small]#xref:Serialize-0c6.adoc[_» more..._]# Serialize a byte to a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Serialize-07.adoc[Serialize]( Stream& s, std::byte a); ---- [.small]#xref:Serialize-07.adoc[_» more..._]# Serialize a signed 16‐bit integer to a stream in little‐endian order. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Serialize-0f97.adoc[Serialize]( Stream& s, int16_t a); ---- [.small]#xref:Serialize-0f97.adoc[_» more..._]# Serialize a signed 32‐bit integer to a stream in little‐endian order. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Serialize-0ff.adoc[Serialize]( Stream& s, int32_t a); ---- [.small]#xref:Serialize-0ff.adoc[_» more..._]# Serialize a signed 64‐bit integer to a stream in little‐endian order. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Serialize-0ac.adoc[Serialize]( Stream& s, int64_t a); ---- [.small]#xref:Serialize-0ac.adoc[_» more..._]# Serialize a signed 8‐bit integer to a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Serialize-0cb.adoc[Serialize]( Stream& s, int8_t a); ---- [.small]#xref:Serialize-0cb.adoc[_» more..._]# Serialize an unsigned 16‐bit integer to a stream in little‐endian order. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Serialize-037.adoc[Serialize]( Stream& s, uint16_t a); ---- [.small]#xref:Serialize-037.adoc[_» more..._]# Serialize an unsigned 32‐bit integer to a stream in little‐endian order. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Serialize-030.adoc[Serialize]( Stream& s, uint32_t a); ---- [.small]#xref:Serialize-030.adoc[_» more..._]# Serialize an unsigned 64‐bit integer to a stream in little‐endian order. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Serialize-0c0.adoc[Serialize]( Stream& s, uint64_t a); ---- [.small]#xref:Serialize-0c0.adoc[_» more..._]# Serialize an unsigned 8‐bit integer to a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Serialize-065.adoc[Serialize]( Stream& s, uint8_t a); ---- [.small]#xref:Serialize-065.adoc[_» more..._]# Serialize any object that provides a Serialize member function. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename T> requires Serializable<T, Stream> void xref:Serialize-086.adoc[Serialize]( Stream& os, T const& a); ---- [.small]#xref:Serialize-086.adoc[_» more..._]# Serialize a string as a CompactSize length followed by its bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename C> void xref:Serialize-024.adoc[Serialize]( Stream& os, std::basic_string<C> const& str); ---- [.small]#xref:Serialize-024.adoc[_» more..._]# Serialize a string view as a CompactSize length followed by its bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename C> void xref:Serialize-00.adoc[Serialize]( Stream& os, std::basic_string_view<C> const& str); ---- [.small]#xref:Serialize-00.adoc[_» more..._]# Serialize the object pointed to by a shared_ptr. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename T> void xref:Serialize-06b.adoc[Serialize]( Stream& os, std::shared_ptr<T const> const& p); ---- [.small]#xref:Serialize-06b.adoc[_» more..._]# Serialize the object pointed to by a unique_ptr. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename T> void xref:Serialize-0a6.adoc[Serialize]( Stream& os, std::unique_ptr<T const> const& p); ---- [.small]#xref:Serialize-0a6.adoc[_» more..._]# Deleted overload that forbids serializing char; use uint8_t or int8_t instead. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, xref:CharNotInt8.adoc[CharNotInt8] V> void xref:Serialize-0ef.adoc[Serialize]( Stream& s, V v) = delete; ---- [.small]#xref:Serialize-0ef.adoc[_» more..._]# Serialize a dynamic‐extent span of basic bytes as raw bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, xref:BasicByte.adoc[BasicByte] B> void xref:Serialize-0fd.adoc[Serialize]( Stream& s, std::span<B> span); ---- [.small]#xref:Serialize-0fd.adoc[_» more..._]# Serialize a pair as its first then second element. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename K, typename T> void xref:Serialize-0e8.adoc[Serialize]( Stream& os, std::pair<K, T> const& item); ---- [.small]#xref:Serialize-0e8.adoc[_» more..._]# Serialize a prevector. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, unsigned int N, typename T> void xref:Serialize-057.adoc[Serialize]( Stream& os, xref:prevector-0c.adoc[prevector<N, T>] const& v); ---- [.small]#xref:Serialize-057.adoc[_» more..._]# Serialize a vector. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename T, typename A> void xref:Serialize-09d.adoc[Serialize]( Stream& os, std::vector<T, A> const& v); ---- [.small]#xref:Serialize-09d.adoc[_» more..._]# Serialize a fixed‐extent span of basic bytes as raw bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, xref:BasicByte.adoc[BasicByte] B, size_t N> void xref:Serialize-05f.adoc[Serialize]( Stream& s, std::span<B, N> span); ---- [.small]#xref:Serialize-05f.adoc[_» more..._]# Serialize a std::array of basic bytes as raw bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, xref:BasicByte.adoc[BasicByte] B, size_t N> void xref:Serialize-083.adoc[Serialize]( Stream& s, std::array<B, N> const& a); ---- [.small]#xref:Serialize-083.adoc[_» more..._]# Serialize a C array of basic bytes as raw bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, xref:BasicByte.adoc[BasicByte] B, size_t N> void xref:Serialize-09a.adoc[Serialize]( Stream& s, B const(& a)[]); ---- [.small]#xref:Serialize-09a.adoc[_» more..._]# Serialize a set as a CompactSize count followed by its elements. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename K, typename Pred, typename A> void xref:Serialize-0f9d.adoc[Serialize]( Stream& os, std::set<K, Pred, A> const& m); ---- [.small]#xref:Serialize-0f9d.adoc[_» more..._]# Serialize a map as a CompactSize count followed by its entries. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename K, typename T, typename Pred, typename A> void xref:Serialize-021.adoc[Serialize]( Stream& os, std::map<K, T, Pred, A> const& m); ---- [.small]#xref:Serialize-021.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *s* | The output stream. | *a* | The boolean value to serialize. | *os* | The output stream. | *str* | The string to serialize. | *p* | The shared pointer whose pointee is serialized. | *v* | The char value that must not be serialized. | *span* | The span of bytes to serialize. | *item* | The pair to serialize. | *m* | The set to serialize. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#