Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::SPWeakPtr< T > Class Template Referencefinal

A weak pointer to an SPObject: it nulls itself upon the object's destruction. More...

#include <weakptr.h>

Public Member Functions

 SPWeakPtr ()=default
 
 SPWeakPtr (T *obj)
 
SPWeakPtroperator= (T *obj)
 
 SPWeakPtr (SPWeakPtr const &other)
 
SPWeakPtroperator= (SPWeakPtr const &other)
 
 ~SPWeakPtr ()
 
void reset ()
 
void reset (T *obj)
 
 operator bool () const
 
T * get () const
 
T & operator* () const
 
T * operator-> () const
 

Private Member Functions

void attach ()
 
void detach ()
 

Private Attributes

T * _obj = nullptr
 
sigc::connection _conn
 

Detailed Description

template<typename T>
class Inkscape::SPWeakPtr< T >

A weak pointer to an SPObject: it nulls itself upon the object's destruction.

Definition at line 13 of file weakptr.h.

Constructor & Destructor Documentation

◆ SPWeakPtr() [1/3]

template<typename T >
Inkscape::SPWeakPtr< T >::SPWeakPtr ( )
default

◆ SPWeakPtr() [2/3]

template<typename T >
Inkscape::SPWeakPtr< T >::SPWeakPtr ( T *  obj)
inlineexplicit

Definition at line 17 of file weakptr.h.

References Inkscape::SPWeakPtr< T >::attach().

◆ SPWeakPtr() [3/3]

template<typename T >
Inkscape::SPWeakPtr< T >::SPWeakPtr ( SPWeakPtr< T > const &  other)
inline

Definition at line 19 of file weakptr.h.

◆ ~SPWeakPtr()

template<typename T >
Inkscape::SPWeakPtr< T >::~SPWeakPtr ( )
inline

Definition at line 21 of file weakptr.h.

References Inkscape::SPWeakPtr< T >::detach().

Member Function Documentation

◆ attach()

template<typename T >
void Inkscape::SPWeakPtr< T >::attach ( )
inlineprivate

◆ detach()

template<typename T >
void Inkscape::SPWeakPtr< T >::detach ( )
inlineprivate

◆ get()

◆ operator bool()

template<typename T >
Inkscape::SPWeakPtr< T >::operator bool ( ) const
inlineexplicit

Definition at line 25 of file weakptr.h.

References Inkscape::SPWeakPtr< T >::_obj.

◆ operator*()

template<typename T >
T & Inkscape::SPWeakPtr< T >::operator* ( ) const
inline

Definition at line 27 of file weakptr.h.

References Inkscape::SPWeakPtr< T >::_obj.

◆ operator->()

template<typename T >
T * Inkscape::SPWeakPtr< T >::operator-> ( ) const
inline

Definition at line 28 of file weakptr.h.

References Inkscape::SPWeakPtr< T >::_obj.

◆ operator=() [1/2]

template<typename T >
SPWeakPtr & Inkscape::SPWeakPtr< T >::operator= ( SPWeakPtr< T > const &  other)
inline

Definition at line 20 of file weakptr.h.

References Inkscape::SPWeakPtr< T >::_obj, and Inkscape::SPWeakPtr< T >::reset().

◆ operator=() [2/2]

template<typename T >
SPWeakPtr & Inkscape::SPWeakPtr< T >::operator= ( T *  obj)
inline

Definition at line 18 of file weakptr.h.

References Inkscape::SPWeakPtr< T >::reset().

◆ reset() [1/2]

template<typename T >
void Inkscape::SPWeakPtr< T >::reset ( )
inline

◆ reset() [2/2]

template<typename T >
void Inkscape::SPWeakPtr< T >::reset ( T *  obj)
inline

Member Data Documentation

◆ _conn

template<typename T >
sigc::connection Inkscape::SPWeakPtr< T >::_conn
private

Definition at line 32 of file weakptr.h.

Referenced by Inkscape::SPWeakPtr< T >::attach(), and Inkscape::SPWeakPtr< T >::detach().

◆ _obj


The documentation for this class was generated from the following file: