|
SObjectizer
5.7
|
Type of smart handle for a cooperation. More...
#include <coop_handle.hpp>
Public Member Functions | |
| coop_handle_t () | |
| operator bool () const noexcept | |
| Is this handle empty? More... | |
| bool | operator! () const noexcept |
| Is this non-empty handle? More... | |
| auto | id () const noexcept |
| Get the ID of the coop. More... | |
Static Public Attributes | |
| static constexpr const coop_id_t | invalid_coop_id = 0u |
Private Member Functions | |
| coop_handle_t (coop_id_t id, std::shared_ptr< coop_t > coop) | |
| Initializing constructor. More... | |
Private Attributes | |
| coop_id_t | m_id |
| ID of cooperation. More... | |
| std::weak_ptr< coop_t > | m_coop |
| Pointer for cooperation. More... | |
Friends | |
| class | so_5::coop_t |
| coop_shptr_t | low_level_api::to_shptr (const coop_handle_t &) |
| coop_shptr_t | low_level_api::to_shptr_noexcept (const coop_handle_t &) noexcept |
| std::ostream & | operator<< (std::ostream &to, const coop_handle_t &what) |
| A tool for dumping coop_handle to ostream. More... | |
| bool | operator== (const coop_handle_t &a, const coop_handle_t &b) noexcept |
| bool | operator!= (const coop_handle_t &a, const coop_handle_t &b) noexcept |
| bool | operator< (const coop_handle_t &a, const coop_handle_t &b) noexcept |
| bool | operator<= (const coop_handle_t &a, const coop_handle_t &b) noexcept |
| bool | operator> (const coop_handle_t &a, const coop_handle_t &b) noexcept |
| bool | operator>= (const coop_handle_t &a, const coop_handle_t &b) noexcept |
Type of smart handle for a cooperation.
Type coop_handle_t is used for references to registered coops. Before v.5.6 coops in SObjectizer-5 were identified via strings. Every coop had its own name.
Since v.5.6.0 names are no more used for identificators of coops. SObjectizer's environment_t returns instances of coop_handle_t for every registered coop. This handle can be used for deregistration of the coop at the appropriate time. For example:
Note that coop_handle_t is somewhat like (smart)pointer. It can be empty, e.g. do not point to any coop. Or it can be not-empty. In that case coop_handle_t is very similar to std::weak_ptr.
Initializing constructor.
|
inline |
|
inlinenoexcept |
Get the ID of the coop.
|
inlinenoexcept |
Is this handle empty?
Handle is empty if there is no underlying coop.
| true | if handle is not empty |
|
inlinenoexcept |
Is this non-empty handle?
Handle is empty if there is no underlying coop.
| true | if handle is empty |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
A tool for dumping coop_handle to ostream.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
static |
|
private |
Pointer for cooperation.
|
private |
ID of cooperation.
1.8.14