TSDuck Version 3.15-964 (TSDuck - The MPEG Transport Stream Toolkit)
ts::ResidentBuffer< T > Class Template Reference

Implementation of memory buffer locked in physical memory. More...

Public Member Functions

 ResidentBuffer (size_t elem_count)
 Constructor, based on required amount of elements. More...
 
 ~ResidentBuffer ()
 Destructor.
 
T * base () const
 Return base address of the buffer. More...
 
size_t count () const
 Return the number of elements in the buffer. More...
 
bool isLocked () const
 Check if the buffer is actually locked. More...
 
ErrorCode lockErrorCode () const
 Get error code when not locked. More...
 

Detailed Description

template<typename T = uint8_t>
class ts::ResidentBuffer< T >

Implementation of memory buffer locked in physical memory.

Template Parameters
TType of the buffer element.

Constructor & Destructor Documentation

◆ ResidentBuffer()

template<typename T = uint8_t>
ts::ResidentBuffer< T >::ResidentBuffer ( size_t  elem_count)

Constructor, based on required amount of elements.

Abort application if memory allocation fails. Do not abort if memory locking fails.

Parameters
[in]elem_countNumber of T elements.

Member Function Documentation

◆ isLocked()

template<typename T = uint8_t>
bool ts::ResidentBuffer< T >::isLocked ( ) const
inline

Check if the buffer is actually locked.

Returns
True if the buffer is actually locked, false if locking failed.

◆ lockErrorCode()

template<typename T = uint8_t>
ErrorCode ts::ResidentBuffer< T >::lockErrorCode ( ) const
inline

Get error code when not locked.

Returns
The system error code when locking failed.

◆ base()

template<typename T = uint8_t>
T* ts::ResidentBuffer< T >::base ( ) const
inline

Return base address of the buffer.

Returns
The address of the first T element in the buffer.

◆ count()

template<typename T = uint8_t>
size_t ts::ResidentBuffer< T >::count ( ) const
inline

Return the number of elements in the buffer.

Returns
The number of T elements in the buffer.

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