ost::Engine(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ‘‘ 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 the Persistence::Engine can work in. pick your fighter.

πŸŽ€ Public Member Functions

  • Engine (std::iostream &stream, EngineMode mode, bool compress=true) β€” THROWS(PersistException). constructs a Persistence::Engine with the specified stream in the given mode.
  • void sync () β€” this Flushes the buffers and closes the Persistence::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 a BaseObject from a reference.
  • void write (const BaseObject *object) β€” THROWS(PersistException). writes a BaseObject from 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 a BaseObject into a reference, overwriting the object.
  • void read (BaseObject *&object) β€” THROWS(PersistException). reads a BaseObject into 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)
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 engine
  • template<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

  • modeRead
  • modeWrite

πŸ’… 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 a BaseObject into a reference overwriting the object.
  • void ost::Engine::read (BaseObject *& object) β€” reads a BaseObject into a pointer allocating memory for the object if necessary.
  • void ost::Engine::read (double & i) [inline] β€” References CCXX_ENGINEREAD_REF.
  • void ost::Engine::read (float & i) [inline] β€” References CCXX_ENGINEREAD_REF.
  • void ost::Engine::read (int16 & i) [inline] β€” References CCXX_ENGINEREAD_REF.
  • void ost::Engine::read (int32 & i) [inline] β€” References CCXX_ENGINEREAD_REF.
  • void ost::Engine::read (int8 & i) [inline] β€” References CCXX_ENGINEREAD_REF.
  • void ost::Engine::read (std::string & str)
  • void ost::Engine::read (String & str)
  • void ost::Engine::read (uint16 & i) [inline] β€” References CCXX_ENGINEREAD_REF.
  • void ost::Engine::read (uint32 & i) [inline] β€” References CCXX_ENGINEREAD_REF.
  • void ost::Engine::read (uint8 & i) [inline] β€” References CCXX_ENGINEREAD_REF.
  • void ost::Engine::readBinary (uint8 * data, uint32 size)
  • void ost::Engine::sync () β€” this Flushes the buffers and closes the Persistence::Engine. this must happen before the underlying stream is shut down.
  • void ost::Engine::write (const BaseObject & object) [inline] β€” writes a BaseObject from a reference.
  • void ost::Engine::write (const BaseObject * object) β€” writes a BaseObject from a pointer.
  • void ost::Engine::write (const std::string & str)
  • void ost::Engine::write (const String & str)
  • void ost::Engine::write (double i) [inline] β€” References CCXX_ENGINEWRITE_REF.
  • void ost::Engine::write (float i) [inline] β€” References CCXX_ENGINEWRITE_REF.
  • void ost::Engine::write (int16 i) [inline] β€” References CCXX_ENGINEWRITE_REF.
  • void ost::Engine::write (int32 i) [inline] β€” References CCXX_ENGINEWRITE_REF.
  • void ost::Engine::write (int8 i) [inline] β€” References CCXX_ENGINEWRITE_REF.
  • void ost::Engine::write (uint16 i) [inline] β€” References CCXX_ENGINEWRITE_REF.
  • void ost::Engine::write (uint32 i) [inline] β€” References CCXX_ENGINEWRITE_REF.
  • void ost::Engine::write (uint8 i) [inline] β€” References CCXX_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 πŸ’–

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