TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Base class for objects being part of a ring, ie. More...
#include <tsRingNode.h>
Public Member Functions | |
RingNode ()=default | |
Default constructor. | |
virtual | ~RingNode () |
Destructor. | |
bool | ringAlone () const |
Check if the node is alone in its own ring. | |
void | ringInsertAfter (RingNode *o) |
Insert this object in a ring after the specified node. | |
void | ringInsertBefore (RingNode *o) |
Insert this object in a ring before the specified node. | |
template<typename T > | |
T * | ringNext () |
Get the next node in the ring. | |
template<typename T > | |
const T * | ringNext () const |
Get the next node in the ring. | |
template<typename T > | |
T * | ringPrevious () |
Get the previous node in the ring. | |
template<typename T > | |
const T * | ringPrevious () const |
Get the previous node in the ring. | |
void | ringRemove () |
Remove the node from the ring it belongs to and creates its own ring. | |
size_t | ringSize () const |
Count the number of element in the ring. | |
void | ringSwap (RingNode *o) |
Swap this object and another one in their rings. | |
Base class for objects being part of a ring, ie.
a double-linked list with no begin or end.
This class is not thread-safe. Access to all objects which are part of the same ring shall be synchronized.
|
inline |
Check if the node is alone in its own ring.
void ts::RingNode::ringInsertAfter | ( | RingNode * | o | ) |
Insert this object in a ring after the specified node.
[in] | o | A node of a ring. This object is inserted after o in the ring. |
void ts::RingNode::ringInsertBefore | ( | RingNode * | o | ) |
Insert this object in a ring before the specified node.
[in] | o | A node of a ring. This object is inserted before o in the ring. |
void ts::RingNode::ringSwap | ( | RingNode * | o | ) |
Swap this object and another one in their rings.
If the two objects belong to the same ring, their positions are swapped. If they belong to distinct rings, they also move to each other's ring.
[in] | o | The node to swap with. |
|
inline |
Get the next node in the ring.
T | A superclass of RingNode, the expected type of the next object in the ring. |
|
inline |
Get the next node in the ring.
T | A superclass of RingNode, the expected type of the next object in the ring. |
|
inline |
Get the previous node in the ring.
T | A superclass of RingNode, the expected type of the previous object in the ring. |
|
inline |
Get the previous node in the ring.
T | A superclass of RingNode, the expected type of the previous object in the ring. |
size_t ts::RingNode::ringSize | ( | ) | const |
Count the number of element in the ring.
Warning: This method has a linear response time, avoid using it when possible.