|
SObjectizer
5.8
|
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? | |
| bool | operator! () const noexcept |
| Is this non-empty handle? | |
| auto | id () const noexcept |
| Get the ID of the coop. | |
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. | |
Private Attributes | |
| coop_id_t | m_id |
| ID of cooperation. | |
| std::weak_ptr< coop_t > | m_coop |
| Pointer for cooperation. | |
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. | |
| 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.
Definition at line 86 of file coop_handle.hpp.
Initializing constructor.
Definition at line 108 of file coop_handle.hpp.
|
inline |
Definition at line 115 of file coop_handle.hpp.
|
inlinenoexcept |
Get the ID of the coop.
Definition at line 135 of file coop_handle.hpp.
|
inlinenoexcept |
Is this handle empty?
Handle is empty if there is no underlying coop.
| true | if handle is not empty |
Definition at line 124 of file coop_handle.hpp.
|
inlinenoexcept |
Is this non-empty handle?
Handle is empty if there is no underlying coop.
| true | if handle is empty |
Definition at line 132 of file coop_handle.hpp.
|
friend |
|
friend |
|
friend |
Definition at line 154 of file coop_handle.hpp.
|
friend |
Definition at line 159 of file coop_handle.hpp.
|
friend |
A tool for dumping coop_handle to ostream.
Definition at line 138 of file coop_handle.hpp.
|
friend |
Definition at line 165 of file coop_handle.hpp.
|
friend |
Definition at line 148 of file coop_handle.hpp.
|
friend |
Definition at line 172 of file coop_handle.hpp.
|
friend |
Definition at line 178 of file coop_handle.hpp.
|
friend |
Definition at line 88 of file coop_handle.hpp.
|
staticconstexpr |
Definition at line 113 of file coop_handle.hpp.
|
private |
Pointer for cooperation.
Definition at line 105 of file coop_handle.hpp.
|
private |
ID of cooperation.
Definition at line 97 of file coop_handle.hpp.