ost::RefObject(3)
β¨ ost::RefObject β¨ β from the Library Functions Manual bestie π
okay so picture this: you're in ost::RefObject(3) territory, the library functions manual zone, and we're talking about a reference countable object. she's giving main character energy but make it memory management. π
π¦ NAME π¦
ost::RefObject β a reference countable object. that's it, that's the vibe. π«Ά
πΈ SYNOPSIS πΈ
#include <object.h>
π Public Member Functions π
virtual void * getObject (void)=0β the actual object being managed can be returned by this method as avoid, and then you recast it to the actual type. yes bestie, it's giving type-erasure realness. β¨
π Protected Member Functions π
RefObject ()β the constructor simply initializes the count. no cap, that's literally all she does.virtual ~RefObject ()β the destructor is called when the reference count returns to zero. iconic exit, truly. π
π Protected Attributes π
unsigned refCountβ the count itself. the moment. the number that decides everything. π
π«Ά Friends π«Ά
class RefPointer
π Detailed Description π
a reference countable object.
this is used in association with smart pointers (RefPointer). they're a duo, fr fr. π¦
Author David Sugar dyfet@gnutelephony.org
object managed by smart pointer reference count. periodt. π
β Constructor & Destructor Documentation β
πΈ ost::RefObject::RefObject () [inline], [protected] πΈ
the constructor simply initializes the count. lowkey humble, highkey essential.
π virtual ost::RefObject::~RefObject () [protected], [virtual] π
the destructor is called when the reference count returns to zero. this is done through a virtual destructor. so when the last reference dips out, she cleans up after herself β graceful. π
π₯ Member Function Documentation π₯
β¨ virtual void* ost::RefObject::getObject (void) [pure virtual] β¨
the actual object being managed can be returned by this method as a void and then recast to the actual type. this removes the need to dynamic cast from RefObject and the dependence on rtti this implies. not me dodging rtti entirely, we love a clean escape. π
Returns underlying object being referenced.
π§ Friends And Related Function Documentation π§
π friend class RefPointer [friend] π
π Member Data Documentation π
π unsigned ost::RefObject::refCount [protected] π
π Author π
generated automatically by Doxygen for GNU CommonC++ from the source code. so like, the robots wrote this one, but i'm here to make it cute. π€β¨
heads up bestie: this is a pure virtual situation up top (getObjectis=0), soRefObjectis not the one you instantiate directly β she's the blueprint, and her destructor is virtual on purpose so the count-to-zero cleanup actually reaches the right subclass. also the constructor and destructor andrefCountare all protected, so the outside world is not invited, onlyRefPointerand friends. iykyk. π
and that's the whole page, mwah. π this was rendered for GNU CommonC++, dated Sun Dec 27 2020, and yeah β it's ost::RefObject(3). slay, go manage your references 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