[#SizeComputer]
= SizeComputer
:mrdocs:

Stream&hyphen;like object that only records how many bytes a serialization would write&period;

== Synopsis

Declared in `&lt;serialize&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class SizeComputer;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:SizeComputer/2constructor.adoc[`SizeComputer`]         [.small]#[constructor]#
| Construct a size computer with a zero byte count&period;
| xref:SizeComputer/seek.adoc[`seek`] 
| Pretend this many bytes are written, without specifying them&period;
| xref:SizeComputer/size.adoc[`size`] 
| Return the total number of bytes recorded so far&period;
| xref:SizeComputer/write.adoc[`write`] 
| Add the size of a byte span to the running count&period;
| xref:SizeComputer/operator_lshift.adoc[`operator&lt;&lt;`] 
| Add the serialized size of an object to the running count&period;
|===


== Protected Data Members

[cols="1,4"]
|===
| Name| Description
| xref:SizeComputer/m_size.adoc[`m&lowbar;size`] 
| Running count of bytes that would be written&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:WriteCompactSize-08.adoc[`WriteCompactSize`]
| Account for a CompactSize encoding when computing a serialized size&period;
| xref:WriteVarInt-022.adoc[`WriteVarInt`]
| Account for a VarInt encoding when computing a serialized size&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
