ost::RefPointer(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸŽ€ 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* () const
  • void * operator-> () const
  • void * getObject (void) const
  • bool 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