ost::RefPointer(3)
π ost::RefPointer π
okay so we're in section 3 of the Library Functions Manual and today's main character is ost::RefPointer, and bestie she is so good. smart pointers that count references?? we love to see it π
β¨ NAME β¨
ost::RefPointer β a Pointer to reference counted objects. that's it, that's the whole assignment. she ate and left no crumbs π
π¦ SYNOPSIS π¦
#include <object.h>
π Public Member Functions
RefPointer ()β creates an unattached pointer. no object, no commitment, just vibes.RefPointer (RefObject *obj)β creates a pointer that's attached to a reference counted object. now we're locked in πRefPointer (const RefPointer &ptr)β the copy constructor, obviously.virtual ~RefPointer ()β the destructor. she's virtual, she's graceful, she bows out beautifully.RefPointer & operator= (const RefObject &ref)void * operator* () constvoid * operator-> () constvoid * getObject (void) constbool operator! () const
π Protected Member Functions
void detach (void)β detaches the current object, like, for example, when you're changing pointer. glow-up era π¦virtual void enterLock (void)β a patch point for a mutex in a derived class.virtual void leaveLock (void)β a patch point for a mutex in a derived class.
πΈ Protected Attributes
RefObject * ref
π Detailed Description π
Pointer to reference counted objects. periodt.
so here's the tea: this is a non-template form of a reference count smart pointer, which means it uses common code instead of getting templated all over the place. and the fun part? you can subclass it to return explicit object types. main character energy for real π
Author β David Sugar dyfet@gnutelephony.org
Pointer to reference count managed objects. yes, again. she said it twice because it's that important, iykyk π
πΌ Constructor & Destructor Documentation πΌ
ost::RefPointer::RefPointer () [inline]
Create an unattached pointer. baby's first pointer, no object attached, living her free little life β¨
ost::RefPointer::RefPointer (RefObject * obj)
Create a pointer attached to a reference counted object. Object being referenced.
ost::RefPointer::RefPointer (const RefPointer & ptr)
A copy constructor. Pointer being copied.
virtual ost::RefPointer::~RefPointer () [virtual]
no description given, she's mysterious like that π
π Member Function Documentation π
void ost::RefPointer::detach (void) [protected]
Detach current object, for example, when changing pointer. it's giving "letting go of what no longer serves you" π
virtual void ost::RefPointer::enterLock (void) [protected], [virtual]
Patch point for mutex in derived class. and ngl, this may often be a single static mutex shared by a managed type. cute and efficient, we stan.
void* ost::RefPointer::getObject (void) const
no description in the source, bestie. she simply exists. π
virtual void ost::RefPointer::leaveLock (void) [protected], [virtual]
Patch point for a mutex in derived class. this one may often be a single static mutex shared by a managed type too β twins fr fr π«Ά
bool ost::RefPointer::operator! () const
no description, just a little guy doing his truthy/falsy thing β¨
void* ost::RefPointer::operator* () const [inline]
no description, but inline, so she's fast.
void* ost::RefPointer::operator-> () const [inline]
no description, also inline. the arrow that gets you there πΉ
RefPointer& ost::RefPointer::operator= (const RefObject & ref)
no description given. she assigns, she doesn't explain.
π§ Member Data Documentation π§
RefObject* ost::RefPointer::ref [protected]
that's the attribute right there. protected, so keep your hands to yourself π₯
π Author π
David Sugar dyfet@gnutelephony.org β we love a legend, we love a credit, we love a manpage that names names π«Ά
and that's the whole page bestie!! no cap, every last flag, member, default and signature is right here where it belongs. this gorgeous little doc was generated automatically by Doxygen for GNU CommonC++ straight from the source code, and it's dated Sun Dec 27 2020. slay, honestly. π πβ¨
π¦ 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