123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #pragma once
- #include "arc.hpp"
- namespace rotor {
- struct actor_base_t;
- struct supervisor_t;
- struct address_t : public arc_base_t<address_t> {
-
- supervisor_t &supervisor;
-
- const void *locality;
- address_t(const address_t &) = delete;
- address_t(address_t &&) = delete;
-
- inline bool operator==(const address_t &other) const noexcept { return this == &other; }
-
- inline bool same_locality(const address_t &other) const noexcept { return this->locality == other.locality; }
- private:
- friend struct supervisor_t;
- address_t(supervisor_t &sup, const void *locality_) : supervisor{sup}, locality{locality_} {}
- };
- using address_ptr_t = intrusive_ptr_t<address_t>;
- }
- namespace std {
- template <> struct hash<rotor::address_ptr_t> {
-
- inline size_t operator()(const rotor::address_ptr_t &address) const noexcept {
- return reinterpret_cast<size_t>(address.get());
- }
- };
- }
|