TSDuck Version 3.24-2004 (TSDuck - The MPEG Transport Stream Toolkit)
tsMemory.h File Reference

Utility routines for memory operations. More...

Namespaces

 ts
 TSDuck namespace, containing all TSDuck classes and functions.
 

Macros

#define TS_ZERO(var)   ts::Zero(&(var), sizeof(var))
 Zeroing an plain memory variable. More...
 

Functions

template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
INT ts::GetInt (const void *p)
 Template function getting an integer from serialized data in big endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::GetInt (const void *p, INT &i)
 Template function getting an integer from serialized data in big endian representation. More...
 
int16_t ts::GetInt16 (const void *p)
 Function getting a 16-bit signed integer from serialized data in big endian representation. More...
 
void ts::GetInt16 (const void *p, int16_t &i)
 Function getting a 16-bit signed integer from serialized data in big endian representation. More...
 
int16_t ts::GetInt16BE (const void *p)
 Function getting a 16-bit signed integer from serialized data in big endian representation. More...
 
void ts::GetInt16BE (const void *p, int16_t &i)
 Function getting a 16-bit signed integer from serialized data in big endian representation. More...
 
int16_t ts::GetInt16LE (const void *p)
 Function getting a 16-bit signed integer from serialized data in little endian representation. More...
 
void ts::GetInt16LE (const void *p, int16_t &i)
 Function getting a 16-bit signed integer from serialized data in little endian representation. More...
 
int32_t ts::GetInt24 (const void *p)
 Function getting a 24-bit signed integer from serialized data in big endian representation. More...
 
void ts::GetInt24 (const void *p, int32_t &i)
 Function getting a 24-bit signed integer from serialized data in big endian representation. More...
 
int32_t ts::GetInt24BE (const void *p)
 Function getting a 24-bit signed integer from serialized data in big endian representation. More...
 
void ts::GetInt24BE (const void *p, int32_t &i)
 Function getting a 24-bit signed integer from serialized data in big endian representation. More...
 
int32_t ts::GetInt24LE (const void *p)
 Function getting a 24-bit signed integer from serialized data in little endian representation. More...
 
void ts::GetInt24LE (const void *p, int32_t &i)
 Function getting a 24-bit signed integer from serialized data in little endian representation. More...
 
int32_t ts::GetInt32 (const void *p)
 Function getting a 32-bit signed integer from serialized data in big endian representation. More...
 
void ts::GetInt32 (const void *p, int32_t &i)
 Function getting a 32-bit signed integer from serialized data in big endian representation. More...
 
int32_t ts::GetInt32BE (const void *p)
 Function getting a 32-bit signed integer from serialized data in big endian representation. More...
 
void ts::GetInt32BE (const void *p, int32_t &i)
 Function getting a 32-bit signed integer from serialized data in big endian representation. More...
 
int32_t ts::GetInt32LE (const void *p)
 Function getting a 32-bit signed integer from serialized data in little endian representation. More...
 
void ts::GetInt32LE (const void *p, int32_t &i)
 Function getting a 32-bit signed integer from serialized data in little endian representation. More...
 
int64_t ts::GetInt40BE (const void *p)
 Function getting a 40-bit signed integer from serialized data in big endian representation. More...
 
int64_t ts::GetInt40LE (const void *p)
 Function getting a 40-bit signed integer from serialized data in little endian representation. More...
 
int64_t ts::GetInt48BE (const void *p)
 Function getting a 48-bit signed integer from serialized data in big endian representation. More...
 
int64_t ts::GetInt48LE (const void *p)
 Function getting a 48-bit signed integer from serialized data in little endian representation. More...
 
int64_t ts::GetInt64 (const void *p)
 Function getting a 64-bit signed integer from serialized data in big endian representation. More...
 
void ts::GetInt64 (const void *p, int64_t &i)
 Function getting a 64-bit signed integer from serialized data in big endian representation. More...
 
int64_t ts::GetInt64BE (const void *p)
 Function getting a 64-bit signed integer from serialized data in big endian representation. More...
 
void ts::GetInt64BE (const void *p, int64_t &i)
 Function getting a 64-bit signed integer from serialized data in big endian representation. More...
 
int64_t ts::GetInt64LE (const void *p)
 Function getting a 64-bit signed integer from serialized data in little endian representation. More...
 
void ts::GetInt64LE (const void *p, int64_t &i)
 Function getting a 64-bit signed integer from serialized data in little endian representation. More...
 
int8_t ts::GetInt8 (const void *p)
 Function getting an 8-bit signed integer from serialized data. More...
 
void ts::GetInt8 (const void *p, int8_t &i)
 Function getting an 8-bit signed integer from serialized data. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
INT ts::GetIntBE (const void *p)
 Template function getting an integer from serialized data in big endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::GetIntBE (const void *p, INT &i)
 Template function getting an integer from serialized data in big endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
INT ts::GetIntLE (const void *p)
 Template function getting an integer from serialized data in little endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::GetIntLE (const void *p, INT &i)
 Template function getting an integer from serialized data in little endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
INT ts::GetIntVar (const void *p, size_t size)
 Template function getting a variable-length integer from serialized data in big endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::GetIntVar (const void *p, size_t size, INT &i)
 Template function getting a variable-length integer from serialized data in big endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
INT ts::GetIntVarBE (const void *p, size_t size)
 Template function getting a variable-length integer from serialized data in big endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::GetIntVarBE (const void *p, size_t size, INT &i)
 Template function getting a variable-length integer from serialized data in big endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
INT ts::GetIntVarLE (const void *p, size_t size)
 Template function getting a variable-length integer from serialized data in little endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::GetIntVarLE (const void *p, size_t size, INT &i)
 Template function getting a variable-length integer from serialized data in little endian representation. More...
 
uint16_t ts::GetUInt16 (const void *p)
 Function getting a 16-bit unsigned integer from serialized data in big endian representation. More...
 
void ts::GetUInt16 (const void *p, uint16_t &i)
 Function getting a 16-bit unsigned integer from serialized data in big endian representation. More...
 
uint16_t ts::GetUInt16BE (const void *p)
 Function getting a 16-bit unsigned integer from serialized data in big endian representation. More...
 
void ts::GetUInt16BE (const void *p, uint16_t &i)
 Function getting a 16-bit unsigned integer from serialized data in big endian representation. More...
 
uint16_t ts::GetUInt16LE (const void *p)
 Function getting a 16-bit unsigned integer from serialized data in little endian representation. More...
 
void ts::GetUInt16LE (const void *p, uint16_t &i)
 Function getting a 16-bit unsigned integer from serialized data in little endian representation. More...
 
uint32_t ts::GetUInt24 (const void *p)
 Function getting a 24-bit unsigned integer from serialized data in big endian representation. More...
 
void ts::GetUInt24 (const void *p, uint32_t &i)
 Function getting a 24-bit unsigned integer from serialized data in big endian representation. More...
 
uint32_t ts::GetUInt24BE (const void *p)
 Function getting a 24-bit unsigned integer from serialized data in big endian representation. More...
 
void ts::GetUInt24BE (const void *p, uint32_t &i)
 Function getting a 24-bit unsigned integer from serialized data in big endian representation. More...
 
uint32_t ts::GetUInt24LE (const void *p)
 Function getting a 24-bit unsigned integer from serialized data in little endian representation. More...
 
void ts::GetUInt24LE (const void *p, uint32_t &i)
 Function getting a 24-bit unsigned integer from serialized data in little endian representation. More...
 
uint32_t ts::GetUInt32 (const void *p)
 Function getting a 32-bit unsigned integer from serialized data in big endian representation. More...
 
void ts::GetUInt32 (const void *p, uint32_t &i)
 Function getting a 32-bit unsigned integer from serialized data in big endian representation. More...
 
uint32_t ts::GetUInt32BE (const void *p)
 Function getting a 32-bit unsigned integer from serialized data in big endian representation. More...
 
void ts::GetUInt32BE (const void *p, uint32_t &i)
 Function getting a 32-bit unsigned integer from serialized data in big endian representation. More...
 
uint32_t ts::GetUInt32LE (const void *p)
 Function getting a 32-bit unsigned integer from serialized data in little endian representation. More...
 
void ts::GetUInt32LE (const void *p, uint32_t &i)
 Function getting a 32-bit unsigned integer from serialized data in little endian representation. More...
 
uint64_t ts::GetUInt40 (const void *p)
 Function getting a 40-bit unsigned integer from serialized data in big endian representation. More...
 
void ts::GetUInt40 (const void *p, uint64_t &i)
 Function getting a 40-bit unsigned integer from serialized data in big endian representation. More...
 
uint64_t ts::GetUInt40BE (const void *p)
 Function getting a 40-bit unsigned integer from serialized data in big endian representation. More...
 
uint64_t ts::GetUInt40LE (const void *p)
 Function getting a 40-bit unsigned integer from serialized data in little endian representation. More...
 
uint64_t ts::GetUInt48 (const void *p)
 Function getting a 48-bit unsigned integer from serialized data in big endian representation. More...
 
void ts::GetUInt48 (const void *p, uint64_t &i)
 Function getting a 48-bit unsigned integer from serialized data in big endian representation. More...
 
uint64_t ts::GetUInt48BE (const void *p)
 Function getting a 48-bit unsigned integer from serialized data in big endian representation. More...
 
uint64_t ts::GetUInt48LE (const void *p)
 Function getting a 48-bit unsigned integer from serialized data in little endian representation. More...
 
uint64_t ts::GetUInt64 (const void *p)
 Function getting a 64-bit unsigned integer from serialized data in big endian representation. More...
 
void ts::GetUInt64 (const void *p, uint64_t &i)
 Function getting a 64-bit unsigned integer from serialized data in big endian representation. More...
 
uint64_t ts::GetUInt64BE (const void *p)
 Function getting a 64-bit unsigned integer from serialized data in big endian representation. More...
 
void ts::GetUInt64BE (const void *p, uint64_t &i)
 Function getting a 64-bit unsigned integer from serialized data in big endian representation. More...
 
uint64_t ts::GetUInt64LE (const void *p)
 Function getting a 64-bit unsigned integer from serialized data in little endian representation. More...
 
void ts::GetUInt64LE (const void *p, uint64_t &i)
 Function getting a 64-bit unsigned integer from serialized data in little endian representation. More...
 
uint8_t ts::GetUInt8 (const void *p)
 Function getting an 8-bit unsigned integer from serialized data. More...
 
void ts::GetUInt8 (const void *p, uint8_t &i)
 Function getting an 8-bit unsigned integer from serialized data. More...
 
bool ts::IdenticalBytes (const void *area, size_t area_size)
 Check if a memory area contains all identical byte values. More...
 
const void * ts::LocatePattern (const void *area, size_t area_size, const void *pattern, size_t pattern_size)
 Locate a pattern into a memory area. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::PutInt (void *p, INT i)
 Template function serializing an integer data in big endian representation. More...
 
void ts::PutInt16 (void *p, int16_t i)
 Function serializing a 16-bit signed integer data in big endian representation. More...
 
void ts::PutInt16BE (void *p, int16_t i)
 Function serializing a 16-bit signed integer data in big endian representation. More...
 
void ts::PutInt16LE (void *p, int16_t i)
 Function serializing a 16-bit signed integer data in little endian representation. More...
 
void ts::PutInt24 (void *p, int32_t i)
 Function serializing a 24-bit signed integer data in big endian representation. More...
 
void ts::PutInt24BE (void *p, int32_t i)
 Function serializing a 24-bit signed integer data in big endian representation. More...
 
void ts::PutInt24LE (void *p, int32_t i)
 Function serializing a 24-bit signed integer data in little endian representation. More...
 
void ts::PutInt32 (void *p, int32_t i)
 Function serializing a 32-bit signed integer data in big endian representation. More...
 
void ts::PutInt32BE (void *p, int32_t i)
 Function serializing a 32-bit signed integer data in big endian representation. More...
 
void ts::PutInt32LE (void *p, int32_t i)
 Function serializing a 32-bit signed integer data in little endian representation. More...
 
void ts::PutInt40BE (void *p, int64_t i)
 Function serializing a 40-bit signed integer data in big endian representation. More...
 
void ts::PutInt40LE (void *p, int64_t i)
 Function serializing a 40-bit signed integer data in little endian representation. More...
 
void ts::PutInt48BE (void *p, int64_t i)
 Function serializing a 48-bit signed integer data in big endian representation. More...
 
void ts::PutInt48LE (void *p, int64_t i)
 Function serializing a 48-bit signed integer data in little endian representation. More...
 
void ts::PutInt64 (void *p, int64_t i)
 Function serializing a 64-bit signed integer data in big endian representation. More...
 
void ts::PutInt64BE (void *p, int64_t i)
 Function serializing a 64-bit signed integer data in big endian representation. More...
 
void ts::PutInt64LE (void *p, int64_t i)
 Function serializing a 64-bit signed integer data in little endian representation. More...
 
void ts::PutInt8 (void *p, int8_t i)
 Function serializing an 8-bit signed integer data. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::PutIntBE (void *p, INT i)
 Template function serializing an integer data in big endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::PutIntLE (void *p, INT i)
 Template function serializing an integer data in little endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::PutIntVar (void *p, size_t size, INT i)
 Template function serializing a variable-length integer data in big endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::PutIntVarBE (void *p, size_t size, INT i)
 Template function serializing a variable-length integer data in big endian representation. More...
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::PutIntVarLE (void *p, size_t size, INT i)
 Template function serializing a variable-length integer data in little endian representation. More...
 
void ts::PutUInt16 (void *p, uint16_t i)
 Function serializing a 16-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt16BE (void *p, uint16_t i)
 Function serializing a 16-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt16LE (void *p, uint16_t i)
 Function serializing a 16-bit unsigned integer data in little endian representation. More...
 
void ts::PutUInt24 (void *p, uint32_t i)
 Function serializing a 24-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt24BE (void *p, uint32_t i)
 Function serializing a 24-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt24LE (void *p, uint32_t i)
 Function serializing a 24-bit unsigned integer data in little endian representation. More...
 
void ts::PutUInt32 (void *p, uint32_t i)
 Function serializing a 32-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt32BE (void *p, uint32_t i)
 Function serializing a 32-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt32LE (void *p, uint32_t i)
 Function serializing a 32-bit unsigned integer data in little endian representation. More...
 
void ts::PutUInt40 (void *p, uint64_t i)
 Function serializing a 40-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt40BE (void *p, uint64_t i)
 Function serializing a 40-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt40LE (void *p, uint64_t i)
 Function serializing a 40-bit unsigned integer data in little endian representation. More...
 
void ts::PutUInt48 (void *p, uint64_t i)
 Function serializing a 48-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt48BE (void *p, uint64_t i)
 Function serializing a 48-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt48LE (void *p, uint64_t i)
 Function serializing a 48-bit unsigned integer data in little endian representation. More...
 
void ts::PutUInt64 (void *p, uint64_t i)
 Function serializing a 64-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt64BE (void *p, uint64_t i)
 Function serializing a 64-bit unsigned integer data in big endian representation. More...
 
void ts::PutUInt64LE (void *p, uint64_t i)
 Function serializing a 64-bit unsigned integer data in little endian representation. More...
 
void ts::PutUInt8 (void *p, uint8_t i)
 Function serializing an 8-bit unsigned integer data. More...
 
bool ts::StartsWith (const void *area, size_t area_size, const void *prefix, size_t prefix_size)
 Check if a memory area starts with the specified prefix. More...
 
void ts::Zero (void *addr, size_t size)
 Zeroing a memory area. More...
 

Detailed Description

Utility routines for memory operations.

Macro Definition Documentation

◆ TS_ZERO

#define TS_ZERO (   var)    ts::Zero(&(var), sizeof(var))

Zeroing an plain memory variable.

Do not use with instances of C++ classes.

Parameters
[out]varName of a variable.