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

Like Reciprocal_ptr, put it can be connected with multiple partners. More...

#include <reciprocal.hpp>

Inheritance diagram for hexed::Reciprocal_list< T, U >:
hexed::mutual::Multiple< T, U > hexed::mutual::Base< T, U >

Public Member Functions

 Reciprocal_list (T *data)
 Constructs a Reciprocal_list and sets its mine to data (which can be null).
 
void add (mutual::Base< U, T > &that)
 Reciprocally connects this with that.
 
void clear ()
 disconnects all partners
 
void remove (mutual::Base< U, T > &that)
 Reciprocally disconnects this from that.
 
next::Sequence< U * > theirs ()
 Obtains all of this's partners' mines as a next::Sequence
 
next::Sequence< const U * > theirs () const
 Obtains all of this's partners' mines as a next::Sequence
 
- Public Member Functions inherited from hexed::mutual::Multiple< T, U >
 Multiple (const Multiple &)=delete
 
 Multiple (Multiple &&that)
 steals all of that's partners, leaving that unconnected
 
Multipleoperator= (const Multiple &)=delete
 
Multipleoperator= (Multiple &&that)
 steals all of that's partners, leaving that unconnected
 
next::Sequence< Base< U, T > & > partners ()
 provides access to the list of partners
 
next::Sequence< const Base< U, T > & > partners () const
 provides access to the list of partners
 

Public Attributes

Mortal_ptr< T > mine
 The object that this is a proxy for in reciprocal connections.
 
- Public Attributes inherited from hexed::mutual::Multiple< T, U >
std::vector< Base< U, T > * > _partners
 

Additional Inherited Members

- Protected Member Functions inherited from hexed::mutual::Base< T, U >
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::Reciprocal_list< T, U >

Like Reciprocal_ptr, put it can be connected with multiple partners.

Reciprocal_lists can be connected with other Reciprocal_lists or with Reciprocal_ptrs. Of course, in both cases connections are reciprocated.

Member Function Documentation

◆ add()

template<typename T , typename U >
void hexed::Reciprocal_list< T, U >::add ( mutual::Base< U, T > & that)
inline

Reciprocally connects this with that.

In other words, adds that to this's list of partners.

◆ remove()

template<typename T , typename U >
void hexed::Reciprocal_list< T, U >::remove ( mutual::Base< U, T > & that)
inline

Reciprocally disconnects this from that.

In other words, removes that from this's list of partners.

Member Data Documentation

◆ mine

template<typename T , typename U >
Mortal_ptr<T> hexed::Reciprocal_list< T, U >::mine

The object that this is a proxy for in reciprocal connections.

See also
Reciprocal_ptr::mine

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