ADTF  3.18.2
samplelogentry.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include "samplelog_intf.h"
10 #include <adtfucom3/adtf_ucom3.h>
11 
12 namespace adtf
13 {
14 namespace streaming
15 {
16 namespace ant
17 {
23 {
24  public:
27  {
28  public:
35  virtual adtf_util::cString GetThreadName(uint64_t ui64ProcId,
36  int32_t i32ThreadId) const = 0;
42  virtual adtf_util::cString GetHandleName(tHandle hHandle) const = 0;
43  };
44 
45  public:
56 
70 
73 
76  public:
77 
89 
97  tResult ToStream(ucom::ant::IStream& oOutStream, size_t& nSizeWritten) const;
105  tResult FromStream(const ucom::ant::IStream& oInStream, size_t& nSizeRead);
106 
113  bool operator ==(const ISampleLog::tSampleLogEntry& sEntry) const;
120  bool operator ==(const cSampleLogEntry& oEntry) const;
121 
126  operator const ISampleLog::tSampleLogEntry*() const;
131  operator const ISampleLog::tSampleLogEntry&() const;
132 
143  tResult ToString(const adtf_util::cString& strSampleID,
144  adtf_util::cString& strResult,
145  const IHandleInfo* pHandleInfo=nullptr,
146  const adtf_util::cString& strSeparator=";") const;
147  public:
161  const ISampleLog::tSampleLogSampleID& sID2);
162  private:
164  tResult SetAdditionalData(const void* pData, size_t szAdditionalData);
165  bool IsEqual(const ISampleLog::tSampleLogEntry& sEntry) const;
166 
167  private:
170  adtf_util::cMemoryBlock m_oAdditionalData;
171 
172 };
173 
181 {
182  public:
214  const ISampleLog::tSampleLogEntryEventID& ui32EventID,
215  const tTimeStamp& tmEntryTime,
216  const ISampleLog::tSampleLogSampleID& sSampleId);
230  tResult MemoryLock(const bool& bLock);
231 
250  const tTimeStamp& tmCurrent,
251  ISampleLog& oLogSample);
258 
273  adtf_util::cString& strResult,
274  const cSampleLogEntry::IHandleInfo* pHandleInfo=nullptr,
275  const adtf_util::cString& strSeparator=";");
276 
277  private:
278  adtf_util::cMemoryBlock m_oBuffer;
279  std::unordered_map<ISampleLog::tSampleLogEntryCreatorID, size_t> m_oPositionMap;
281  size_t m_szCurrentSize;
282  bool m_bLocked;
283 };
284 
285 } // namespace ant
290 
291 } // namespace streaming
292 } // namespace adtf
Copyright © Audi Electronics Venture GmbH.
tVoid * tHandle
type definition for a handle value (platform and compiler dependent type).
The ISampleLog interface defines an interface to trace and store Sample data- and timing flow.
uint32_t tSampleLogEntryEventID
The Log Entry Event ID is defined by eSampleLogEntryEventID.
uint64_t tSampleLogEntryCreatorID
The Log Entry Creator ID will be unique in current system.
internal callback class to get valid names for the cSampleLogEntry::ToString function
virtual adtf_util::cString GetThreadName(uint64_t ui64ProcId, int32_t i32ThreadId) const =0
This function need to be implemented to get a valid name for a ThreadID.
virtual adtf_util::cString GetHandleName(tHandle hHandle) const =0
This function need to be implemented to get a valid name for a handle.
Helper Wrapper Class to handle a Sample Log Entry.
static bool IsEqualSampleID(const ISampleLog::tSampleLogSampleID &sID1, const ISampleLog::tSampleLogSampleID &sID2)
static helper to compare sample ids.
ISampleLog::tSampleLogEntry m_sEntry
internal use only
cSampleLogEntry & operator=(const cSampleLogEntry &oEntry)
Copy assignment.
tResult ToString(const adtf_util::cString &strSampleID, adtf_util::cString &strResult, const IHandleInfo *pHandleInfo=nullptr, const adtf_util::cString &strSeparator=";") const
Serializes the entry to a string value due to strSeparator.
cSampleLogEntry(const ISampleLog::tSampleLogEntry &sEntry)
Copy CTOR.
cSampleLogEntry()
Default CTOR.
const ISampleLog::tSampleLogEntry * GetEntry() const
Gets the internal structure.
static ISampleLog::tSampleLogSampleID GetEmptySampleID()
static helper to get an empty sample id.
bool operator==(const ISampleLog::tSampleLogEntry &sEntry) const
Compares the Entries.
~cSampleLogEntry()
DTOR.
tResult SetEntry(const ISampleLog::tSampleLogEntry *psEntry)
Sets the Values of the Entry by copying from psEntry.
tResult ToStream(ucom::ant::IStream &oOutStream, size_t &nSizeWritten) const
Serializes the internal entry to an output stream.
tResult SetAdditionalData(const void *pData, size_t szAdditionalData)
internal use only
tResult FromStream(const ucom::ant::IStream &oInStream, size_t &nSizeRead)
Deserializes the internal entry from an input stream.
cSampleLogEntry(const cSampleLogEntry &oEntry)
Copy CTOR.
Helper Wrapper Class to handle the additional Data entry of the Log Event ISampleLog::MSLEE_TransmitR...
tResult AddEntry(const ISampleLog::tSampleLogEntryCreatorID &ui64ID)
Adds an entry for the Creator ID ui64ID.
cSampleLogEntryTransmitReceiveStateBuffer()
Default CTOR.
tResult LogBuffer(const ISampleLog::tSampleLogEntryCreatorID &ui64ID, const tTimeStamp &tmCurrent, ISampleLog &oLogSample)
Logs current buffer as ISampleLog::MSLEE_TransmitReceiveState event to the given oLogSample.
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::tSampleLogTransmitRecei...
tResult Clear()
Clears the Buffer.
virtual ~cSampleLogEntryTransmitReceiveStateBuffer()
Default DTOR.
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.
tResult MemoryLock(const bool &bLock)
Locks the memory if bLock is set to true.
The IStream interface provides defines methods for streaming data.
Definition: stream_intf.h:84
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
Definition: string.h:2778
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Structure for one SampleLog Entry.
Sample ID to assure uniqueness of samples in system.
Storage structure for the Additional info buffer of an MSLEE_TransmitReceiveState.