OST_POINTER(3)
π 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. β¨ Referencesost::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. Referencesost::Pointer< T >::ptrCount, andost::Pointer< T >::ptrObject.template<class T > virtual ost::Pointer< T >::~Pointer ()[inline],[virtual]β the sad goodbye arc π. Referencesost::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. Referencesost::Pointer< T >::ptrObject.template<class T > bool ost::Pointer< T >::operator! () const[inline]β the vibe check: is this thing empty or not? Referencesost::Pointer< T >::ptrCount.template<class T > T& ost::Pointer< T >::operator* () const[inline]β dereference, she gives you the whole object. Referencesost::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.
bothoperator++andoperator--referenceost::Pointer< T >::ptrCount.
template<class T > T* ost::Pointer< T >::operator-> () const[inline]β the shortcut queen, straight to the member. Referencesost::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. Referencesost::Pointer< T >::ptrCount,ost::Pointer< T >::ptrDetach(), andost::Pointer< T >::ptrObject.template<class T > void ost::Pointer< T >::ptrDetach (void)[inline],[protected]β the internal cleanup bestie that keeps everything tidy. Referencesost::Pointer< T >::ptrCount, andost::Pointer< T >::ptrObject.
Referenced byost::Pointer< T >::operator=(), andost::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 byost::Pointer< T >::operator!(),ost::Pointer< T >::operator--(),ost::Pointer< T >::operator=(),ost::Pointer< T >::Pointer(), andost::Pointer< T >::ptrDetach().
template<class T > T* ost::Pointer< T >::ptrObject[protected]β the actual object, the moment, the star of the show. β
Referenced byost::Pointer< T >::getObject(),ost::Pointer< T >::operator*(),ost::Pointer< T >::operator->(),ost::Pointer< T >::operator=(),ost::Pointer< T >::Pointer(), andost::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
- 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