ost::Engine(3)
π ost::Engine(3) π
okay bestie, so this one comes straight out of the Library Functions Manual and it's lowkey iconic. we're talking about ost::Engine β a whole class that eats C++ STL streams for breakfast and turns your persistent classes into bytes. let's get into it. π
πΈ NAME πΈ
ost::Engine β it's an Engine. that's the whole vibe. no notes. π
β¨ SYNOPSIS β¨
#include <persist.h>
π¦ Public Types
enum EngineMode { modeRead, modeWrite }β these are the modes thePersistence::Enginecan work in. pick your fighter.
π Public Member Functions
Engine (std::iostream &stream, EngineMode mode, bool compress=true)βTHROWS(PersistException). constructs aPersistence::Enginewith the specified stream in the given mode.void sync ()β this Flushes the buffers and closes thePersistence::Engine. this must happen before the underlying stream is shut down, fr fr.bool more ()β this says there are more objects to deserialize.virtual ~Engine ()void write (const BaseObject &object)βTHROWS(PersistException). writes aBaseObjectfrom a reference.void write (const BaseObject *object)βTHROWS(PersistException). writes aBaseObjectfrom a pointer.void write (int8 i)βTHROWS(PersistException)void write (uint8 i)βTHROWS(PersistException)void write (int16 i)βTHROWS(PersistException)void write (uint16 i)βTHROWS(PersistException)void write (int32 i)βTHROWS(PersistException)void write (uint32 i)βTHROWS(PersistException)void write (float i)βTHROWS(PersistException)void write (double i)βTHROWS(PersistException)void write (const String &str)βTHROWS(PersistException)void write (const std::string &str)βTHROWS(PersistException)void writeBinary (const uint8 *data, const uint32 size)βTHROWS(PersistException)void read (BaseObject &object)βTHROWS(PersistException). reads aBaseObjectinto a reference, overwriting the object.void read (BaseObject *&object)βTHROWS(PersistException). reads aBaseObjectinto a pointer, allocating memory for the object if necessary.void read (int8 &i)βTHROWS(PersistException)void read (uint8 &i)βTHROWS(PersistException)void read (int16 &i)βTHROWS(PersistException)void read (uint16 &i)βTHROWS(PersistException)void read (int32 &i)βTHROWS(PersistException)void read (uint32 &i)βTHROWS(PersistException)void read (float &i)βTHROWS(PersistException)void read (double &i)βTHROWS(PersistException)void read (String &str)βTHROWS(PersistException)void read (std::string &str)βTHROWS(PersistException)void readBinary (uint8 *data, uint32 size)βTHROWS(PersistException)
π Related Functions
bestie listen β these are not member functions. they're just vibing nearby. don't get it twisted. π
__EXPORT Engine & operator>> (Engine &ar, BaseObject &ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, BaseObject *&ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, BaseObject const &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, BaseObject const *ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, int8 &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, int8 ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, uint8 &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, uint8 ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, int16 &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, int16 ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, uint16 &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, uint16 ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, int32 &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, int32 ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, uint32 &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, uint32 ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, float &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, float ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, double &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, double ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, String &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, String ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, std::string &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, std::string ob)βTHROWS(PersistException)__EXPORT Engine & operator>> (Engine &ar, bool &ob)βTHROWS(PersistException)__EXPORT Engine & operator<< (Engine &ar, bool ob)βTHROWS(PersistException)template<class T > Engine & operator<< (Engine &ar, typename std::vector< T > const &ob)βTHROWS(PersistException). The following are templated classes.template<class T > Engine & operator>> (Engine &ar, typename std::vector< T > &ob)βTHROWS(PersistException). deserialize a vector of deserializable content from an engine.template<class T > Engine & operator<< (Engine &ar, typename std::deque< T > const &ob)βTHROWS(PersistException). serialize a deque of some serializable content to the enginetemplate<class T > Engine & operator>> (Engine &ar, typename std::deque< T > &ob)βTHROWS(PersistException). deserialize a deque of deserializable content from an engine.template<class Key , class Value > Engine & operator<< (Engine &ar, typename std::map< Key, Value > const &ob)βTHROWS(PersistException). serialize a map with keys/values which both are serializeable to an engine.template<class Key , class Value > Engine & operator>> (Engine &ar, typename std::map< Key, Value > &ob)βTHROWS(PersistException). deserialize a map with keys/values which both are serializeable from an engine.template<class x , class y > Engine & operator<< (Engine &ar, std::pair< x, y > &ob)βTHROWS(PersistException). serialize a pair of some serializable content to the engine.template<class x , class y > Engine & operator>> (Engine &ar, std::pair< x, y > &ob)βTHROWS(PersistException). deserialize a pair of some serializable content to the engine.
π DETAILED DESCRIPTION π
Engine.
this class constructs on a standard C++ STL stream and then operates in the mode specified. the stream passed into the constructor must be a binary mode to function properly. no cap β if it's not binary, it's not gonna work. π
π Author
Daniel Silverstone
stream serialization of persistent classes. β¨
π§ MEMBER ENUMERATION DOCUMENTATION π§
enum ost::Engine::EngineMode
these are the modes the Persistence::Engine can work in.
Enumerator
modeReadmodeWrite
π CONSTRUCTOR & DESTRUCTOR DOCUMENTATION π
ost::Engine::Engine (std::iostream & stream, EngineMode mode, bool compress = true)
constructs a Persistence::Engine with the specified stream in the given mode. the stream must be initialised properly prior to this call or problems will ensue. if built using zlib, compress can be used to enable compression. π«Ά
virtual ost::Engine::~Engine () [virtual]
π₯ MEMBER FUNCTION DOCUMENTATION π₯
bool ost::Engine::more ()β this says there are more objects to deserialize.void ost::Engine::read (BaseObject & object)β reads aBaseObjectinto a reference overwriting the object.void ost::Engine::read (BaseObject *& object)β reads aBaseObjectinto a pointer allocating memory for the object if necessary.void ost::Engine::read (double & i) [inline]β ReferencesCCXX_ENGINEREAD_REF.void ost::Engine::read (float & i) [inline]β ReferencesCCXX_ENGINEREAD_REF.void ost::Engine::read (int16 & i) [inline]β ReferencesCCXX_ENGINEREAD_REF.void ost::Engine::read (int32 & i) [inline]β ReferencesCCXX_ENGINEREAD_REF.void ost::Engine::read (int8 & i) [inline]β ReferencesCCXX_ENGINEREAD_REF.void ost::Engine::read (std::string & str)void ost::Engine::read (String & str)void ost::Engine::read (uint16 & i) [inline]β ReferencesCCXX_ENGINEREAD_REF.void ost::Engine::read (uint32 & i) [inline]β ReferencesCCXX_ENGINEREAD_REF.void ost::Engine::read (uint8 & i) [inline]β ReferencesCCXX_ENGINEREAD_REF.void ost::Engine::readBinary (uint8 * data, uint32 size)void ost::Engine::sync ()β this Flushes the buffers and closes thePersistence::Engine. this must happen before the underlying stream is shut down.void ost::Engine::write (const BaseObject & object) [inline]β writes aBaseObjectfrom a reference.void ost::Engine::write (const BaseObject * object)β writes aBaseObjectfrom a pointer.void ost::Engine::write (const std::string & str)void ost::Engine::write (const String & str)void ost::Engine::write (double i) [inline]β ReferencesCCXX_ENGINEWRITE_REF.void ost::Engine::write (float i) [inline]β ReferencesCCXX_ENGINEWRITE_REF.void ost::Engine::write (int16 i) [inline]β ReferencesCCXX_ENGINEWRITE_REF.void ost::Engine::write (int32 i) [inline]β ReferencesCCXX_ENGINEWRITE_REF.void ost::Engine::write (int8 i) [inline]β ReferencesCCXX_ENGINEWRITE_REF.void ost::Engine::write (uint16 i) [inline]β ReferencesCCXX_ENGINEWRITE_REF.void ost::Engine::write (uint32 i) [inline]β ReferencesCCXX_ENGINEWRITE_REF.void ost::Engine::write (uint8 i) [inline]β ReferencesCCXX_ENGINEWRITE_REF.void ost::Engine::writeBinary (const uint8 * data, const uint32 size)
part 1 wraps here bestieβ¦ part 2 is loading, don't go anywhere π
πΈ FRIENDS AND RELATED FUNCTION DOCUMENTATION π
okay bestie, this is the part where the <</>> overloads live β the ones that let you shove all your little values into an Engine and then pull them back out. Every single overload, no skips, no "and friends", we're listing all of them. Let's go π
β¨ operator<< β the "put it in the engine" crew π«Ά
__EXPORT Engine & operator<<(Engine & ar, BaseObject const & ob) [related]β the docs give this one no extra blurb, it's just doing its thing.__EXPORT Engine & operator<<(Engine & ar, BaseObject const * ob) [related]β pointer flavour. same, no extra notes in the docs.__EXPORT Engine & operator<<(Engine & ar, bool ob) [related]β bool go in, no commentary attached.__EXPORT Engine & operator<<(Engine & ar, double ob) [related]β no blurb, just vibes.__EXPORT Engine & operator<<(Engine & ar, float ob) [related]β also no blurb.__EXPORT Engine & operator<<(Engine & ar, int16 ob) [related]β nope, no blurb either.__EXPORT Engine & operator<<(Engine & ar, int32 ob) [related]β still no blurb, we move.__EXPORT Engine & operator<<(Engine & ar, int8 ob) [related]β no blurb, moving on fr fr.template<class x , class y > Engine & operator<<(Engine & ar, std::pair< x, y > & ob) [related]β serialize a pair of some serializable content to the engine. π―__EXPORT Engine & operator<<(Engine & ar, std::string ob) [related]β no extra description given.__EXPORT Engine & operator<<(Engine & ar, String ob) [related]β also no extra description given.template<class T > Engine & operator<<(Engine & ar, typename std::deque< T > const & ob) [related]β serialize a deque of some serializable content to the engine π§Ίtemplate<class Key , class Value > Engine & operator<<(Engine & ar, typename std::map< Key, Value > const & ob) [related]β serialize a map with keys/values which both are serializeable to an engine. πΊοΈtemplate<class T > Engine & operator<<(Engine & ar, typename std::vector< T > const & ob) [related]β The following are templated classes. serialize a vector of some serializable content to the engine π¦__EXPORT Engine & operator<<(Engine & ar, uint16 ob) [related]β no blurb in the docs.__EXPORT Engine & operator<<(Engine & ar, uint32 ob) [related]β no blurb in the docs.__EXPORT Engine & operator<<(Engine & ar, uint8 ob) [related]β no blurb in the docs.
β¨ operator>> β the "get it back out" crew π¦
__EXPORT Engine & operator>>(Engine & ar, BaseObject & ob) [related]β no extra blurb given.__EXPORT Engine & operator>>(Engine & ar, BaseObject *& ob) [related]β pointer-to-pointer, and still no extra blurb.__EXPORT Engine & operator>>(Engine & ar, bool & ob) [related]β no blurb.__EXPORT Engine & operator>>(Engine & ar, double & ob) [related]β no blurb.__EXPORT Engine & operator>>(Engine & ar, float & ob) [related]β no blurb.__EXPORT Engine & operator>>(Engine & ar, int16 & ob) [related]β no blurb.__EXPORT Engine & operator>>(Engine & ar, int32 & ob) [related]β no blurb.__EXPORT Engine & operator>>(Engine & ar, int8 & ob) [related]β no blurb, bestie.template<class x , class y > Engine & operator>>(Engine & ar, std::pair< x, y > & ob) [related]β deserialize a pair of some serializable content to the engine. π__EXPORT Engine & operator>>(Engine & ar, std::string & ob) [related]β no extra description given.__EXPORT Engine & operator>>(Engine & ar, String & ob) [related]β no extra description given.template<class T > Engine & operator>>(Engine & ar, typename std::deque< T > & ob) [related]β deserialize a deque of deserializable content from an engine. π§Ίtemplate<class Key , class Value > Engine & operator>>(Engine & ar, typename std::map< Key, Value > & ob) [related]β deserialize a map with keys/values which both are serializeable from an engine. πΊοΈtemplate<class T > Engine & operator>>(Engine & ar, typename std::vector< T > & ob) [related]β deserialize a vector of deserializable content from an engine. π¦__EXPORT Engine & operator>>(Engine & ar, uint16 & ob) [related]β no blurb in the docs.__EXPORT Engine & operator>>(Engine & ar, uint32 & ob) [related]β no blurb in the docs.__EXPORT Engine & operator>>(Engine & ar, uint8 & ob) [related]β no blurb in the docs.
π that's the whole friend list, all 34 of them, exactly as the docs hand them over. no cap.
π AUTHOR
Generated automatically by Doxygen for GNU CommonC++ from the source code.
okay that's a wrap, bestie π this page came to you from GNU CommonC++, dated Sun Dec 27 2020, and it's page ost::Engine(3) β thanks for reading all the way to the end, you're literally the main character of this manpage π«Άβ¨πΈ
π¦ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms