hexed 0.3.0
 
Loading...
Searching...
No Matches
hexed::mutual::Single< T, U > Class Template Reference

an object which is mutually connected ("paired") with only one other object More...

#include <mutual.hpp>

Inheritance diagram for hexed::mutual::Single< T, U >:
hexed::mutual::Base< T, U > hexed::Reciprocal_ptr< T, U >

Public Member Functions

 Single ()
 Constructs a Single with no partner (it is "unpaired")
 
 Single (const Single &)=delete
 
 Single (Single &&that)
 steals that's partner, if it has one, leaving that unpaired
 
Singleoperator= (const Single &)=delete
 
Singleoperator= (Single &&that)
 disconnects this from its partner, if it has one, and steals that's, if it has one
 
void pair (Base< U, T > &that)
 mutually connects this with that
 
void unpair ()
 mutually disconnects this from that
 
bool paired () const
 returns true iff this is currently paired with a partner
 
Base< U, T > * partner ()
 provides access to this's partner
 
const Base< U, T > * partner () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Additional Inherited Members

- Protected Member Functions inherited from hexed::mutual::Base< T, U >
virtual T * _mine ()
 may be overridden by derrived classes to provide partners to data of some arbitrary type T
 
virtual const T * _mine () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void _connect (Base< U, T > &that)
 mutually connects this and that by calling both of their _set() member functions
 
void _disconnect (Base< U, T > &that)
 mutually disconnects this and that by calling both of their _unset() member functions
 
- Static Protected Member Functions inherited from hexed::mutual::Base< T, U >
static U * _yours (Base< U, T > &that)
 Accesses the _mine() of that
 
static const U * _yours (const Base< U, T > &that)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Detailed Description

template<typename T, typename U>
class hexed::mutual::Single< T, U >

an object which is mutually connected ("paired") with only one other object

Member Function Documentation

◆ operator=()

template<typename T , typename U >
Single & hexed::mutual::Single< T, U >::operator= ( Single< T, U > && that)
inline

disconnects this from its partner, if it has one, and steals that's, if it has one

leaves that unpaired


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