Cell class with links to other cells.
More...
#include <cell.h>
|
| | cell (std::int32_t index=0) |
| | Constructs a cell object with an optional index.
|
| |
|
| ~cell () |
| | Destroys the cell object and releases any associated resources.
|
| |
| | cell (const cell &other) |
| | Copy constructor for the cell class.
|
| |
| cell & | operator= (const cell &other) |
| | Assigns the value of another cell to this cell.
|
| |
| | cell (cell &&other) noexcept |
| | Move constructor for the cell class. Transfers the resources from another cell to this one.
|
| |
| cell & | operator= (cell &&other) noexcept |
| | Move assignment operator for the cell class.
|
| |
| void | add_link (const std::shared_ptr< cell > &other) |
| | Add a link to another cell (passage between cells)
|
| |
| void | remove_link (const std::shared_ptr< cell > &other) |
| | Remove a link to another cell.
|
| |
| std::vector< std::pair< std::shared_ptr< cell >, bool > > | get_links () const |
| | Retrieves links to other cells.
|
| |
| bool | is_linked (const std::shared_ptr< cell > &c) |
| | Checks if a cell is linked.
|
| |
| int32_t | get_index () const noexcept |
| | Retrieves the index of the current cell.
|
| |
| void | set_index (std::int32_t next_index) noexcept |
| | Sets the index to the specified value.
|
| |
|
void | cleanup_links () |
| | Cleans up or removes links, typically as part of a resource management or shutdown process.
|
| |
Cell class with links to other cells.
◆ cell() [1/3]
| mazes::cell::cell |
( |
std::int32_t | index = 0 | ) |
|
|
explicit |
Constructs a cell object with an optional index.
- Parameters
-
| index | The index to initialize the cell with. Defaults to 0. |
◆ cell() [2/3]
| mazes::cell::cell |
( |
const cell & | other | ) |
|
Copy constructor for the cell class.
- Parameters
-
| other | The cell object to copy from. |
◆ cell() [3/3]
| mazes::cell::cell |
( |
cell && | other | ) |
|
|
noexcept |
Move constructor for the cell class. Transfers the resources from another cell to this one.
- Parameters
-
| other | The cell object to move from. |
◆ add_link()
| void mazes::cell::add_link |
( |
const std::shared_ptr< cell > & | other | ) |
|
Add a link to another cell (passage between cells)
- Parameters
-
◆ get_index()
| int32_t mazes::cell::get_index |
( |
| ) |
const |
|
noexcept |
Retrieves the index of the current cell.
- Returns
- The index of the current cell.
◆ get_links()
| std::vector< std::pair< std::shared_ptr< cell >, bool > > mazes::cell::get_links |
( |
| ) |
const |
Retrieves links to other cells.
- Returns
- A vector of pairs containing linked cells and their link status
◆ is_linked()
| bool mazes::cell::is_linked |
( |
const std::shared_ptr< cell > & | c | ) |
|
Checks if a cell is linked.
- Parameters
-
| c | A shared pointer to the cell to check. |
- Returns
- True if the cell is linked, false otherwise.
◆ operator=() [1/2]
| cell & mazes::cell::operator= |
( |
cell && | other | ) |
|
|
noexcept |
Move assignment operator for the cell class.
- Parameters
-
| other | The cell object to move from. |
- Returns
- A reference to the assigned cell object (*this).
◆ operator=() [2/2]
| cell & mazes::cell::operator= |
( |
const cell & | other | ) |
|
Assigns the value of another cell to this cell.
- Parameters
-
| other | The cell whose value will be assigned to this cell. |
- Returns
- A reference to this cell after assignment.
◆ remove_link()
| void mazes::cell::remove_link |
( |
const std::shared_ptr< cell > & | other | ) |
|
Remove a link to another cell.
- Parameters
-
| other | The cell to unlink from |
◆ set_index()
| void mazes::cell::set_index |
( |
std::int32_t | next_index | ) |
|
|
noexcept |
Sets the index to the specified value.
- Parameters
-
| next_index | The new index value to set. |
The documentation for this class was generated from the following file: