ADTF  3.18.2
cSampleLogEntryTransmitReceiveStateBuffer

Helper Wrapper Class to handle the additional Data entry of the Log Event ISampleLog::MSLEE_TransmitReceiveState . More...

Public Member Functions

 cSampleLogEntryTransmitReceiveStateBuffer ()
 Default CTOR.
 
virtual ~cSampleLogEntryTransmitReceiveStateBuffer ()
 Default DTOR.
 
tResult AddEntry (const ISampleLog::tSampleLogEntryCreatorID &ui64ID)
 Adds an entry for the Creator ID ui64ID. More...
 
tResult SetEntry (const ISampleLog::tSampleLogEntryCreatorID &ui64CreatorID, const ISampleLog::tSampleLogEntryEventID &ui32EventID, const tTimeStamp &tmEntryTime, const ISampleLog::tSampleLogSampleID &sSampleId)
 Sets the values of an entry for the Creator ID ui64CreatorID. More...
 
tResult MemoryLock (const bool &bLock)
 Locks the memory if bLock is set to true. More...
 
tResult LogBuffer (const ISampleLog::tSampleLogEntryCreatorID &ui64ID, const tTimeStamp &tmCurrent, ISampleLog &oLogSample)
 Logs current buffer as ISampleLog::MSLEE_TransmitReceiveState event to the given oLogSample. More...
 
tResult Clear ()
 Clears the Buffer. More...
 

Static Public Member Functions

static tResult ToString (const ISampleLog::tSampleLogTransmitReceiveState &sState, adtf_util::cString &strResult, const cSampleLogEntry::IHandleInfo *pHandleInfo=nullptr, const adtf_util::cString &strSeparator=";")
 static Helper function to serialize a single structure content of ISampleLog::tSampleLogTransmitReceiveState to a string strResult. More...
 

Private Attributes

adtf_util::cMemoryBlock m_oBuffer
 
std::unordered_map< ISampleLog::tSampleLogEntryCreatorID, size_t > m_oPositionMap
 
ISampleLog::tSampleLogTransmitReceiveStatem_pCurrentBuffer
 
size_t m_szCurrentSize
 
bool m_bLocked
 

Detailed Description

Helper Wrapper Class to handle the additional Data entry of the Log Event ISampleLog::MSLEE_TransmitReceiveState .

Storage class for the array of internal ISampleLog::tSampleLogTransmitReceiveState structure.

Definition at line 180 of file samplelogentry.h.

Member Function Documentation

◆ AddEntry()

tResult AddEntry ( const ISampleLog::tSampleLogEntryCreatorID ui64ID)

Adds an entry for the Creator ID ui64ID.

Remarks
This function fails if MemoryLock(true) was called.
Parameters
ui64ID[in] The creator identifier the entry belongs to. (commonly this is the "InputPin ID").
Return values
ERR_INVALID_STATEMemory is locked !
ERR_MEMORYno more memory available !
ERR_NOERRORno error.

◆ Clear()

tResult Clear ( )

Clears the Buffer.

Return values
ERR_INVALID_STATEMemoryLock(true) was called.
ERR_NOERRORsucceeded.

◆ LogBuffer()

tResult LogBuffer ( const ISampleLog::tSampleLogEntryCreatorID ui64ID,
const tTimeStamp tmCurrent,
ISampleLog oLogSample 
)

Logs current buffer as ISampleLog::MSLEE_TransmitReceiveState event to the given oLogSample.

Parameters
ui64ID[in] Creator ID of the Log entry creator (commonly the filter or the output pin of the filter).
tmCurrent[in] current time for the entry.
pLogSample[in] sample log where to add the entry.
Remarks
This function is not thread-safe! Commonly the MemoryLock call is made during Runlevel IRuntime::RL_Application after added every valid Entry by AddEntry(). SetEntry and LogBuffer is only called during adtf::base::tADTFRunLevel::RL_Running. ! This class will only handle this simple use case !
Return values
ERR_INVALID_STATEMemoryLock(true) was NOT called or no Entry in Buffer.
ERR_NOERRORSucceeded.

◆ MemoryLock()

tResult MemoryLock ( const bool &  bLock)

Locks the memory if bLock is set to true.

No AddEntry call can be made anymore.

Parameters
bLock[in] true - lock, false - unlock
Remarks
This function is not thread-safe! Commonly the MemoryLock call is made during Runlevel IRuntime::RL_Application after added every valid Entry by AddEntry(). SetEntry and LogBuffer is only called during adtf::base::tADTFRunLevel::RL_Running. ! This class will only handle this simple use case !
Returns
ERR_NOERROR Succeeded.

◆ SetEntry()

tResult SetEntry ( const ISampleLog::tSampleLogEntryCreatorID ui64CreatorID,
const ISampleLog::tSampleLogEntryEventID ui32EventID,
const tTimeStamp tmEntryTime,
const ISampleLog::tSampleLogSampleID sSampleId 
)

Sets the values of an entry for the Creator ID ui64CreatorID.

This ui64CreatorID must be unique !

Remarks
This cSampleLogEntryTransmitReceiveStateBuffer is only valid with a valid cSampleLogEntry, which has the id ISampleLog::MSLEE_TransmitReceiveState, and will commonly produced while a ISampleLog::MSLEE_Transmit occured.
Parameters
ui64CreatorID[in] The creator identifier the entry belongs to. (commonly this is the "InputPin ID").
ui32EventID[in] The eventID (commonly Receive or Received) of the event which is currently valid on ui64CreatorID.
tmEntryTime[in] Time of the event ui32EventID.
sSampleId[in] SampleID which was valid on ui64CreatorID.
Return values
ERR_INVALID_INDEXui64CreatorID is not valid. call AddEntry before !
ERR_NOERRORno error.

◆ ToString()

static tResult ToString ( const ISampleLog::tSampleLogTransmitReceiveState sState,
adtf_util::cString &  strResult,
const cSampleLogEntry::IHandleInfo pHandleInfo = nullptr,
const adtf_util::cString &  strSeparator = ";" 
)
static

static Helper function to serialize a single structure content of ISampleLog::tSampleLogTransmitReceiveState to a string strResult.

Parameters
sState[in] The sState entry to serialize as String.
strResult[in, out] The whole entry as String.
pHandleInfo[in] A handle info callback to get valid names for ThreadID and CreatorID.
strSeparator[in] if separator is not empty a comma separated list will be generated for this entry. if separator is empty a log formated string will be generated.
Return values
ERR_NOERRORsucceeded.