7#include <unordered_map>
22 explicit cell(std::int32_t index = 0);
47 void add_link(
const std::shared_ptr<cell> &other);
70 bool operator()(
const std::weak_ptr<T> &lhs,
const std::weak_ptr<T> &rhs)
const
72 return !lhs.owner_before(rhs) && !rhs.owner_before(lhs);
81 bool has_key(
const std::shared_ptr<cell> &c);
83 std::unordered_map<std::weak_ptr<cell>, bool,
weak_ptr_hash, weak_ptr_equal> m_links;
85 mutable std::shared_mutex m_links_mutex;
void add_link(const std::shared_ptr< cell > &other)
Add a link to another cell (passage between cells).
cell & operator=(const cell &other)
Assigns the value of another cell to this cell.
cell(const cell &other)
Copy constructor for the cell class.
~cell()
Destroys the cell object and releases any associated resources.
cell(std::int32_t index=0)
Constructs a cell object with an optional index.
cell(cell &&other) noexcept
Move constructor for the cell class. Transfers the resources from another cell to this one.
void set_index(std::int32_t next_index) noexcept
Sets the index to the specified value.
int32_t get_index() const noexcept
Retrieves the index of the current cell.
void remove_link(const std::shared_ptr< cell > &other)
Remove a link to another cell.
cell & operator=(cell &&other) noexcept
Move assignment operator for the cell class.
bool is_linked(const std::shared_ptr< cell > &c)
Checks if a cell is linked.
Hashing function to store a weak_ptr.
Definition hash_funcs.h:71