![]() |
Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
|
Class that represents a stack of references to other nodes. More...
Public Member Functions | |
| SwappableNodeRefStack () | |
| const NodeRef< T, _Compare > & | operator[] (size_t level) const |
| NodeRef< T, _Compare > & | operator[] (size_t level) |
| size_t | height () const |
| Number of nodes referenced. | |
| size_t | swapLevel () const |
| The current swap level. | |
| bool | canSwap () const |
| true if a swap can take place _swapLevel < height() | |
| bool | noNodePointerMatches (const Node< T, _Compare > *p) const |
| bool | allNodePointerMatch (const Node< T, _Compare > *p) const |
| void | push_back (Node< T, _Compare > *p, size_t w) |
| Add a new reference. | |
| void | pop_back () |
| Remove top reference. | |
| void | swap (SwappableNodeRefStack< T, _Compare > &val) |
| void | resetSwapLevel () |
| Reset the swap level (for example before starting a remove). | |
| void | incSwapLevel () |
| IntegrityCheck | lacksIntegrity () const |
| size_t | size_of () const |
| void | clear () |
Protected Attributes | |
| std::vector< struct NodeRef< T, _Compare > > | _nodes |
| Stack of NodeRef node references. | |
| size_t | _swapLevel |
| The current swap level. | |
Private Member Functions | |
| SwappableNodeRefStack (const SwappableNodeRefStack &that) | |
| Prevent cctor. | |
| SwappableNodeRefStack & | operator= (const SwappableNodeRefStack &that) const |
| Prevent operator=. | |
Class that represents a stack of references to other nodes.
Each reference is a NodeRef so a pointer to a Node and a width. This just does simple bookkeeping on this stack.
It also facilitates swapping references with another SwappableNodeRefStack when inserting or removing a Node.
| T | The type of the Skip List Node values. |
| _Compare | A comparison function for type T. |
|
inline |
Constructor. Initialises the swap level to 0.

| const NodeRef< T, _Compare > & duckdb_skiplistlib::skip_list::SwappableNodeRefStack< T, _Compare >::operator[] | ( | size_t | level | ) | const |
The readable NodeRef at the given level.
| T | The type of the Skip List Node values. |
| _Compare | A comparison function for type T. |
| level | The level. |
| NodeRef< T, _Compare > & duckdb_skiplistlib::skip_list::SwappableNodeRefStack< T, _Compare >::operator[] | ( | size_t | level | ) |
|
inline |
Number of nodes referenced.

|
inline |
The current swap level.

|
inline |
true if a swap can take place _swapLevel < height()


| bool duckdb_skiplistlib::skip_list::SwappableNodeRefStack< T, _Compare >::noNodePointerMatches | ( | const Node< T, _Compare > * | p | ) | const |
Whether all node references are swapped. Should be true after an insert operation.
| T | The type of the Skip List Node values. |
| _Compare | A comparison function for type T. |
| p | The Node. |


| bool duckdb_skiplistlib::skip_list::SwappableNodeRefStack< T, _Compare >::allNodePointerMatch | ( | const Node< T, _Compare > * | p | ) | const |
Returns true if all pointers in my data are equal to p. Should be true after a remove operation.
| T | The type of the Skip List Node values. |
| _Compare | A comparison function for type T. |
| p | The Node. |


|
inline |
|
inline |
Remove top reference.
| void duckdb_skiplistlib::skip_list::SwappableNodeRefStack< T, _Compare >::swap | ( | SwappableNodeRefStack< T, _Compare > & | val | ) |
Swap references with another SwappableNodeRefStack at the current swap level. This also increments the swap level.
| T | The type of the Skip List Node values. |
| _Compare | A comparison function for type T. |
| val | The SwappableNodeRefStack. |


|
inline |
Reset the swap level (for example before starting a remove).
|
inline |
Increment the swap level. This is used when removing nodes where the parent node can record to what level it has made its adjustments so the grand parent knows where to start.
For this reason the _swapLevel can easily be >= _nodes.size().

| IntegrityCheck duckdb_skiplistlib::skip_list::SwappableNodeRefStack< T, _Compare >::lacksIntegrity | ( | ) | const |
This checks the internal consistency of the object. It returns INTEGRITY_SUCCESS [0] if successful or non-zero on error. The tests are:
| T | The type of the Skip List Node values. |
| _Compare | A comparison function for type T. |

| size_t duckdb_skiplistlib::skip_list::SwappableNodeRefStack< T, _Compare >::size_of | ( | ) | const |
|
inline |