OST_POINTER(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– ost::Pointer< T > πŸ’–

okay bestie, welcome to the Library Functions Manual section, page 3, and today we're talking about ost::Pointer< T > β€” the cutest little reference-counted smart pointer you ever did see. this one's from GNU CommonC++, and she serves. ✨


🌸 NAME 🌸

ost::Pointer< T > β€” used to create and manage referece counted pointers. (yes "referece", the original said it like that, we don't edit the ancestors πŸ’…)


✨ SYNOPSIS ✨

#include <pointer.h>

🫢 Public Member Functions

Pointer (T *ptr=NULL)
Pointer (const Pointer< T > &ref)
virtual ~Pointer ()
Pointer & operator= (const Pointer< T > &ref)
T & operator* () const
T * getObject () const
T * operator-> () const
bool operator! () const
int operator++ () const
int operator-- () const

πŸ™ˆ Protected Member Functions

void ptrDetach (void)

πŸ”’ Protected Attributes

unsigned * ptrCount
T * ptrObject

πŸ’… Detailed Description πŸ’…

template<class T>
class ost::Pointer< T >

"Used to create and manage referece counted pointers."

πŸ‘‘ Author

David Sugar dyfet@gnutelephony.org

reference counted pointer template. periodt. that's the whole vibe, and honestly? iconic.


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

  • template<class T > ost::Pointer< T >::Pointer (T * ptr = NULL) [inline], [explicit] β€” the glow-up moment where the pointer is born. ✨ References ost::Pointer< T >::ptrCount.
  • template<class T > ost::Pointer< T >::Pointer (const Pointer< T > & ref) [inline] β€” copy-constructor energy, she's literally the same as her bestie. References ost::Pointer< T >::ptrCount, and ost::Pointer< T >::ptrObject.
  • template<class T > virtual ost::Pointer< T >::~Pointer () [inline], [virtual] β€” the sad goodbye arc 😭. References ost::Pointer< T >::ptrDetach().

🌈 Member Function Documentation 🌈

  • template<class T > T* ost::Pointer< T >::getObject (void) const [inline] β€” hands you the raw object, no filter, no cap. References ost::Pointer< T >::ptrObject.
  • template<class T > bool ost::Pointer< T >::operator! () const [inline] β€” the vibe check: is this thing empty or not? References ost::Pointer< T >::ptrCount.
  • template<class T > T& ost::Pointer< T >::operator* () const [inline] β€” dereference, she gives you the whole object. References ost::Pointer< T >::ptrObject.
  • template<class T > int ost::Pointer< T >::operator++ () const [inline] β€” bumps the count up, main character energy only.
  • template<class T > int ost::Pointer< T >::operator-- () const [inline] β€” bumps the count down, we love a graceful exit.
both operator++ and operator-- reference ost::Pointer< T >::ptrCount.
  • template<class T > T* ost::Pointer< T >::operator-> () const [inline] β€” the shortcut queen, straight to the member. References ost::Pointer< T >::ptrObject.
  • template<class T > Pointer& ost::Pointer< T >::operator= (const Pointer< T > & ref) [inline] β€” the "actually let me be you instead" assignment moment. References ost::Pointer< T >::ptrCount, ost::Pointer< T >::ptrDetach(), and ost::Pointer< T >::ptrObject.
  • template<class T > void ost::Pointer< T >::ptrDetach (void) [inline], [protected] β€” the internal cleanup bestie that keeps everything tidy. References ost::Pointer< T >::ptrCount, and ost::Pointer< T >::ptrObject.
Referenced by ost::Pointer< T >::operator=(), and ost::Pointer< T >::~Pointer().

πŸ¦‹ Member Data Documentation πŸ¦‹

  • template<class T > unsigned* ost::Pointer< T >::ptrCount [protected] β€” the counter that keeps track of how many besties are holding on.
Referenced by ost::Pointer< T >::operator!(), ost::Pointer< T >::operator--(), ost::Pointer< T >::operator=(), ost::Pointer< T >::Pointer(), and ost::Pointer< T >::ptrDetach().
  • template<class T > T* ost::Pointer< T >::ptrObject [protected] β€” the actual object, the moment, the star of the show. ⭐
Referenced by ost::Pointer< T >::getObject(), ost::Pointer< T >::operator*(), ost::Pointer< T >::operator->(), ost::Pointer< T >::operator=(), ost::Pointer< T >::Pointer(), and ost::Pointer< T >::ptrDetach().

πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for GNU CommonC++ from the source code.


and that's the whole page, babe 🫢 this gem is brought to you by GNU CommonC++, dated Sun Dec 27 2020 β€” shoutout to the compiler gods for auto-generating this one with Doxygen, we love an automated slay. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from