hexed 0.3.0
 
Loading...
Searching...
No Matches
hexed::Ptr_base< T, U > Class Template Referenceabstract

Abstract base class for implementing mutually-connected pointers. More...

#include <Mutual_ptr.hpp>

Inheritance diagram for hexed::Ptr_base< T, U >:
hexed::Multiple_ptr< T, U > hexed::Mutual_ptr< T, U >

Public Member Functions

virtual T & mine ()=0
 Obtain the object I am permanently associated with.
 
virtual const T & mine () const =0
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Protected Member Functions

virtual void connect_self (Ptr_base< U, T > *)=0
 Do whatever I need to do to connect myself to this Ptr_base without worrying about the other side.
 
virtual void disconnect_self (Ptr_base< U, T > *)=0
 Do whatever I need to do to disconnect myself from this Ptr_base without worrying about the other side.
 
void connect (Ptr_base< U, T > *other)
 Mutually connect us by calling both our connect_self.
 
void disconnect (Ptr_base< U, T > *other)
 Mutually disconnect us by calling both our disconnect_self.
 

Friends

class Ptr_base< U, T >
 

Detailed Description

template<typename T, typename U>
class hexed::Ptr_base< T, U >

Abstract base class for implementing mutually-connected pointers.

Specifies an interface that has a reference to a T (mine()), as well as a mechanism to connect with and disconnect from a Ptr_base<T, U>. Implements the mechanics of mutual connection and disconnection. Derived classes should implement mine(), connect_self(Ptr_base<U, T>*), and disconnect_self(Ptr_base<U, T>*) and then implement their own interface that calls connect(Ptr_base<U, T>*) and disconnect(Ptr_base<U, T>*).

Member Function Documentation

◆ disconnect_self()

template<typename T , typename U >
virtual void hexed::Ptr_base< T, U >::disconnect_self ( Ptr_base< U, T > * )
protectedpure virtual

Do whatever I need to do to disconnect myself from this Ptr_base without worrying about the other side.

What happends if I'm not already connected to the Ptr_base is up to the derived class.

◆ mine() [1/2]

template<typename T , typename U >
virtual const T & hexed::Ptr_base< T, U >::mine ( ) const
pure virtual

◆ mine() [2/2]


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