CircularList< T > Class Template Reference¶
|
Simu5G
|
#include <Circular.h>
Public Member Functions | |
| CircularList () | |
| Create an empty circular list. | |
| CircularList (const CircularList< T > &cl) | |
| Copy constructor. | |
| CircularList & | operator= (const CircularList< T > &cl) |
| Assignment operator. | |
| bool | empty () |
| Return true if the list is empty. | |
| unsigned int | size () |
| Return the number of elements. | |
| void | clear () |
| Removes all the elements in the list. | |
| bool | find (const T &t) |
| Return true if a given element is in the list. | |
| T & | find (T &t, bool &valid) |
| Finds an element in the list and return it. | |
| void | insert (const T &t) |
| Insert a new element before the current position. | |
| void | erase () |
| Removes the element at the current position. | |
| void | eraseElem (T &t) |
| Erases the specified element (eventually the current position is shifted) | |
| void | rewind () |
| Goes back to the beginning of the circular list. | |
| void | move () |
| Moves the pointer to the next element in a circular fashion. | |
| const T & | current () const |
| Return the current element. | |
| T & | current () |
| Return the current element. | |
| void | insertFront (const T &t) |
| Insert a new element after the current position. | |
Detailed Description
class simu5g::CircularList< T >
Circular list of elements.
Constructor & Destructor Documentation
◆ CircularList() [1/2]
|
inline |
Create an empty circular list.
◆ CircularList() [2/2]
|
inline |
Copy constructor.
Member Function Documentation
◆ operator=()
|
inline |
Assignment operator.
◆ empty()
|
inline |
Return true if the list is empty.
◆ size()
|
inline |
Return the number of elements.
◆ clear()
|
inline |
Removes all the elements in the list.
◆ find() [1/2]
|
inline |
Return true if a given element is in the list.
◆ find() [2/2]
|
inline |
Finds an element in the list and return it.
The element returned is only meaningful if valid == true.
◆ insert()
|
inline |
Insert a new element before the current position.
◆ erase()
|
inline |
Removes the element at the current position.
◆ eraseElem()
|
inline |
Erases the specified element (eventually the current position is shifted)
◆ rewind()
|
inline |
Goes back to the beginning of the circular list.
◆ move()
|
inline |
Moves the pointer to the next element in a circular fashion.
◆ current() [1/2]
|
inline |
Return the current element.
If the size is 0, then the return value is not meaningful, and may also crash program execution. We use an assert here since we do not want to use exceptions, which would be the right thing to do.
◆ current() [2/2]
|
inline |
Return the current element.
◆ insertFront()
|
inline |
Insert a new element after the current position.
Generated by