hexed 0.3.0
 
Loading...
Searching...
No Matches
hexed::Mortal Class Reference

represents an object that could die at any moment More...

#include <Mortal.hpp>

Inheritance diagram for hexed::Mortal:
hexed::mutual::Multiple< void, void > hexed::mutual::Base< void, void >

Additional Inherited Members

- Public Member Functions inherited from hexed::mutual::Multiple< void, void >
 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< void, void > & > partners ()
 provides access to the list of partners
 
next::Sequence< const Base< void, void > & > partners () const
 provides access to the list of partners
 
- Public Attributes inherited from hexed::mutual::Multiple< void, void >
std::vector< Base< void, void > * > _partners
 
- Protected Member Functions inherited from hexed::mutual::Base< void, void >
virtual void * _mine ()
 may be overridden by derrived classes to provide partners to data of some arbitrary type T
 
virtual const void * _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< void, void > &that)
 mutually connects this and that by calling both of their _set() member functions
 
void _disconnect (Base< void, void > &that)
 mutually disconnects this and that by calling both of their _unset() member functions
 
- Static Protected Member Functions inherited from hexed::mutual::Base< void, void >
static void * _yours (Base< void, void > &that)
 Accesses the _mine() of that
 
static const void * _yours (const Base< void, void > &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

represents an object that could die at any moment

As described in the documentation for the mutual namespace, sometimes it is useful to have pointers to an object, where when that object is destroyed or moved the pointers are updated. You can obtain this by deriving a class from Mortal and creating Mortal_ptrs to it.

Warning
You may not move any object derived from Mortal to an object of a different type. This is undefined behavior. For example, the following is illegal:
class Derived : hexed::Mortal {};
Derived d;
Mortal m(std::move(d));
represents an object that could die at any moment
Definition Mortal.hpp:31
However, the following is OK:
class Derived : hexed::Mortal {};
Derived d;
Derived d1(std::move(d));

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