TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::RingNode Class Reference

#include <tsRingNode.h>

Inheritance diagram for ts::RingNode:

Public Member Functions

 RingNode ()=default
virtual ~RingNode ()
bool ringAlone () const
void ringInsertAfter (RingNode *o)
void ringInsertBefore (RingNode *o)
template<typename T>
T * ringNext ()
template<typename T>
const T * ringNext () const
template<typename T>
T * ringPrevious ()
template<typename T>
const T * ringPrevious () const
void ringRemove ()
size_t ringSize () const
void ringSwap (RingNode *o)

Detailed Description

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.

Constructor & Destructor Documentation

◆ RingNode()

ts::RingNode::RingNode ( )
default

Default constructor.

◆ ~RingNode()

virtual ts::RingNode::~RingNode ( )
virtual

Destructor.

Member Function Documentation

◆ ringAlone()

bool ts::RingNode::ringAlone ( ) const
inline

Check if the node is alone in its own ring.

Returns
True if the node is alone in its own ring.

◆ ringRemove()

void ts::RingNode::ringRemove ( )

Remove the node from the ring it belongs to and creates its own ring.

◆ ringInsertAfter()

void ts::RingNode::ringInsertAfter ( RingNode * o)

Insert this object in a ring after the specified node.

Parameters
[in]oA node of a ring. This object is inserted after o in the ring.

◆ ringInsertBefore()

void ts::RingNode::ringInsertBefore ( RingNode * o)

Insert this object in a ring before the specified node.

Parameters
[in]oA node of a ring. This object is inserted before o in the ring.

◆ ringSwap()

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.

Parameters
[in]oThe node to swap with.

◆ ringNext() [1/2]

template<typename T>
T * ts::RingNode::ringNext ( )
inline

Get the next node in the ring.

Template Parameters
TA superclass of RingNode, the expected type of the next object in the ring.
Returns
Address of the next node in the ring or zero if the next node is not a subclass of T.

◆ ringNext() [2/2]

template<typename T>
const T * ts::RingNode::ringNext ( ) const
inline

Get the next node in the ring.

Template Parameters
TA superclass of RingNode, the expected type of the next object in the ring.
Returns
Address of the next node in the ring or zero if the next node is not a subclass of T.

◆ ringPrevious() [1/2]

template<typename T>
T * ts::RingNode::ringPrevious ( )
inline

Get the previous node in the ring.

Template Parameters
TA superclass of RingNode, the expected type of the previous object in the ring.
Returns
Address of the previous node in the ring or zero if the previous node is not a subclass of T.

◆ ringPrevious() [2/2]

template<typename T>
const T * ts::RingNode::ringPrevious ( ) const
inline

Get the previous node in the ring.

Template Parameters
TA superclass of RingNode, the expected type of the previous object in the ring.
Returns
Address of the previous node in the ring or zero if the previous node is not a subclass of T.

◆ ringSize()

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.

Returns
The number of nodes in the ring.

The documentation for this class was generated from the following file: