ost::BaseObject(3)
β¨ ost::BaseObject β¨ β from the ost library, section 3 of the Library Functions Manual π«Ά
okay bestie, sit down, hydrate, and let me tell you about the literal blueprint of persistence π
πΈ NAME πΈ
ost::BaseObject β it's givingβ¦ BaseObject. that's the whole name. iconic of it honestly π
π SYNOPSIS π
#include <persist.h>
π Public Member Functions π
BaseObject ()β the constructor that gets called when you're doing serialisation stuff. it's the oneCreateNewInstancerings up so it has an instance to callRead()on. very "let me create you so I can fill you in" energy.virtual ~BaseObject ()β default destructor. nothing dramatic, just a clean exit. she leaves the group chat politely πvirtual const char * getPersistenceID () constβ hands you back the ID of the persistent object, aka its type. like a little name tag at the party π·οΈvirtual bool write (Engine &archive) constβ writes out to aPersistence::Engine. β οΈ NOT the same as the<<operator, because it only writes the data, not the object type or any of that extra garnish. data only, no seasoning π§virtual bool read (Engine &archive)β reads in from aPersistence::Engine. β οΈ NOT the same as the>>operator either, because it does zero typesafety, not even a little bit. it trusts you completely. no cap π
π¦ DETAILED DESCRIPTION π¦
BaseObject. she's the base of it all, fr fr.
this object is the base for all persistent data that isn't natively serialised by the Persistence::Engine. the ones the engine can't handle on its own? they come to her. she's the mother of the misfits π
she registers herself with the Persistence::TypeManager using a global constructor function. and then β plot twist β a matching deregister call happens in a global destructor. why? so that DLL's can use the Persistence::Engine inside a main executable. teamwork, babe π€
important warning, bestie, listen up: persistable objects must never maintain bad pointers. if a pointer doesn't point to something valid, it must be NULL. this is non-negotiable. it's how the persistence engine knows whether it should allocate memory for an object or whether the memory was already pre-allocated. bad pointer = chaos = we don't do that here π
π Author π
- Daniel Silverstone
Base class for classes that will be persistent. that's her whole job description and she does it flawlessly β¨
π Constructor & Destructor Documentation π
π ost::BaseObject::BaseObject ()
this constructor is used in serialisation processes. specifically, it's called inside CreateNewInstance in order to create an instance of the class that's about to have Read() called on it. so likeβ¦ she's born, and immediately gets read to. relatable honestly π
π virtual ost::BaseObject::~BaseObject () [virtual]
default destructor. that's it. that's the whole thing. short and sweet, a queen of brevity π
β Member Function Documentation β
πΈ virtual const char* ost::BaseObject::getPersistenceID () const [virtual]
this returns the ID of the persistent object β which is its type. your object's government name, essentially π
π virtual bool ost::BaseObject::read (Engine & archive) [virtual]
this method is used to read from a Persistence::Engine. and NO, it is not equivalent to the >> operator, because it does no typesafety or anything. it does not check. it does not verify. it simply reads. wild behavior, but okay π
π§ virtual bool ost::BaseObject::write (Engine & archive) const [virtual]
this method is used to write to the Persistence::Engine. and NO again β it is not equivalent to the << operator, because it writes only the data and not the object type etc. just the data. the bare necessities. minimalism slay πΏ
π Author π
Generated automatically by Doxygen for GNU CommonC++ from the source code.
and that's the whole page, bestie!! you understood all of it, I know you did π
β¨ this was ost::BaseObject(3), from GNU CommonC++, dated Sun Dec 27 2020 β mwah, go forth and persist responsibly π«Άπ
π¦ 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