![]() |
Bitcoin ABC 0.32.4
P2P Digital Currency
|
GetSerializeSize implementations More...
#include <serialize.h>
Public Member Functions | |
| CSizeComputer (int nVersionIn) | |
| void | write (Span< const std::byte > src) |
| void | seek (size_t _nSize) |
| Pretend _nSize bytes are written, without specifying them. More... | |
| template<typename T > | |
| CSizeComputer & | operator<< (const T &obj) |
| size_t | size () const |
| int | GetVersion () const |
Protected Attributes | |
| size_t | nSize |
| const int | nVersion |
GetSerializeSize implementations
Computing the serialized size of objects is done through a special stream object of type CSizeComputer, which only records the number of bytes written to it.
If your Serialize or SerializationOp method has non-trivial overhead for serialization, it may be worthwhile to implement a specialized version for CSizeComputer, which uses the s.seek() method to record bytes that would be written instead.
Definition at line 1127 of file serialize.h.
|
inlineexplicit |
Definition at line 1134 of file serialize.h.
|
inline |
Definition at line 1148 of file serialize.h.
|
inline |
|
inline |
Pretend _nSize bytes are written, without specifying them.
Definition at line 1139 of file serialize.h.
|
inline |
|
inline |
|
protected |
Definition at line 1129 of file serialize.h.
|
protected |
Definition at line 1131 of file serialize.h.