ZeroBuf
0.2.0
Zero-copy, zero-serialize, zero-hassle protocol buffers
|
Base class for all Zerobuf serializable objects. More...
#include <Zerobuf.h>
Public Member Functions | |
virtual size_t | getZerobufStaticSize () const =0 |
virtual size_t | getZerobufNumDynamics () const =0 |
virtual void | notifyChanging () |
Called if any data in this object is about to change. More... | |
virtual void | compact (float threshold=0.1f) |
Remove unused holes from the zerobuf. More... | |
Zerobuf & | operator= (const Zerobuf &rhs) |
Assignment operator. More... | |
Zerobuf (Zerobuf &&rhs) | |
Move ctor. More... | |
Zerobuf & | operator= (Zerobuf &&rhs) |
Move operator. More... | |
bool | operator== (const Zerobuf &rhs) const |
bool | operator!= (const Zerobuf &rhs) const |
void | reset (AllocatorPtr allocator) |
void | check () const |
Protected Member Functions | |
Zerobuf (AllocatorPtr alloc) | |
const Allocator & | getAllocator () const |
Allocator & | getAllocator () |
void | _copyZerobufArray (const void *data, size_t size, size_t arrayNum) |
virtual void | _parseJSON (const Json::Value &json) |
virtual void | _createJSON (Json::Value &json) const |
Friends | |
void | fromJSON (const Json::Value &, Zerobuf &) |
void | toJSON (const Zerobuf &, Json::Value &) |
Base class for all Zerobuf serializable objects.
The zerobufCxx.py code generator creates subclasses of this class. Zerobuf objects can serialize/deserialize directly from their member storage and from and to JSON. All members are zero-initialized, unless they do have a default value. fromJSON() will compact the Zerobuf.
zerobuf::Zerobuf::Zerobuf | ( | Zerobuf && | rhs | ) |
Move ctor.
|
virtual |
Remove unused holes from the zerobuf.
Compaction only occurs if the current allocation exceeds the relative threshold to the optimal size, that is, if unusedMemory divided by optimalMemory is above the threshold.
threshold | the compaction threshold |
Reimplemented in zerobuf::render::ImageJPEG.
Referenced by notifyChanging().
|
pure virtual |
Implemented in zerobuf::render::Camera, zerobuf::render::ImageJPEG, zerobuf::render::Vector3f, and zerobuf::render::LookupTable1D.
|
pure virtual |
Implemented in zerobuf::render::Camera, zerobuf::render::ImageJPEG, zerobuf::render::Vector3f, and zerobuf::render::LookupTable1D.
|
inlinevirtual |
Called if any data in this object is about to change.
Definition at line 38 of file Zerobuf.h.
References compact(), operator!=(), operator=(), and operator==().
bool zerobuf::Zerobuf::operator!= | ( | const Zerobuf & | rhs | ) | const |
Referenced by notifyChanging().
Move operator.
May copy data if zerobuf is not movable
bool zerobuf::Zerobuf::operator== | ( | const Zerobuf & | rhs | ) | const |
Referenced by notifyChanging().