7 #include "caf/abstract_actor.hpp" 8 #include "caf/actor_control_block.hpp" 9 #include "caf/detail/comparable.hpp" 10 #include "caf/detail/core_export.hpp" 11 #include "caf/fwd.hpp" 16 #include <type_traits> 33 template <
class,
class,
int>
37 static constexpr
bool has_weak_ptr_semantics =
true;
50 actor_id
id() const noexcept {
61 return *ptr_->home_system;
67 explicit operator bool()
const {
68 return static_cast<bool>(ptr_);
76 intptr_t compare(
const actor_addr& other)
const noexcept;
83 return compare(other.get());
87 return compare(other.get());
90 friend std::string to_string(
const actor_addr& x) {
91 return to_string(x.ptr_);
94 friend void append_to_string(std::string& x,
const actor_addr& y) {
95 return append_to_string(x, y.ptr_);
98 template <
class Inspector>
99 friend bool inspect(Inspector& f,
actor_addr& x) {
100 return inspect(f, x.ptr_);
119 return ptr_.release();
123 return ptr_.get_locked();
132 return x.get() ==
nullptr;
136 return x.get() ==
nullptr;
140 return x.get() !=
nullptr;
144 return x.get() !=
nullptr;
152 struct hash<
caf::actor_addr> {
154 return static_cast<size_t>(ref.
id());
node_id node() const noexcept
Returns the origin node of this actor.
Definition: actor_addr.hpp:55
Barton–Nackman trick implementation.
Definition: comparable.hpp:16
abstract_actor * get()
Returns a pointer to the actual actor instance.
Definition: actor_control_block.hpp:92
bool operator==(const action &lhs, const action &rhs) noexcept
Checks whether two actions are equal by comparing their pointers.
Definition: action.hpp:131
Definition: actor.hpp:178
Indicates that the thread has been launched by request of a user without using any of the default mec...
Actor environment including scheduler, registry, and optional components such as a middleman...
Definition: actor_system.hpp:87
Stores the address of typed as well as untyped actors.
Definition: actor_addr.hpp:21
bool operator!=(const action &lhs, const action &rhs) noexcept
Checks whether two actions are not equal by comparing their pointers.
Definition: action.hpp:136
actor_system & home_system() const noexcept
Returns the hosting actor system.
Definition: actor_addr.hpp:60
actor_id id() const noexcept
Returns the ID of this actor.
Definition: actor_addr.hpp:50
Definition: actor_cast.hpp:64
Base class for all actor implementations.
Definition: abstract_actor.hpp:48
A node ID is an opaque value for representing CAF instances in the network.
Definition: node_id.hpp:111
Actors are always allocated with a control block that stores its identity as well as strong and weak ...
Definition: actor_control_block.hpp:51
Root namespace of libcaf.
Definition: custom_types_4.cpp:139