53 ucom::ant::IClassInfo>
95 tResult Lock(ucom::ant::iobject_ptr_shared_locked<const
adtf::streaming::ant::
ISampleBuffer>& oSampleBuffer) const override;
96 tResult WriteLock(ucom::ant::iobject_ptr_locked<
ISampleBuffer>& oSampleBuffer,
size_t szPreAllocateSize) override;
102 uint32_t GetFlags() const override;
103 tResult SetFlags(uint32_t ui32Flags) override;
107 uint32_t ui32Flags=0) override;
115 base::flash::tNanoSeconds GetTimeNs() const override;
116 tResult SetTime(base::flash::tNanoSeconds tmTimeStamp) override;
117 tResult Set(base::flash::tNanoSeconds tmTimeStamp,
120 uint32_t ui32Flags=0) override;
123 uint32_t GetSubStreamId() const override;
124 void SetSubStreamId(uint32_t nSubStreamId) override;
345 template <
typename T>
348 static_assert(std::is_trivially_copyable<T>::value,
349 "You can only use plain types or structs without pointers or complex members.");
399 uint32_t nSubStreamId):
404 pSample->SetTime(tmSampleTime);
405 pSample->SetSubStreamId(nSubStreamId);
438 if (m_pBuffer->GetSize() !=
sizeof(T))
440 THROW_ERROR_DESC(ERR_INVALID_ARG,
"The sample passed to output_sample_data (%zu), does not match the size of the requested type (%zu).",
441 m_pBuffer->GetSize(),
488 "This output_sample_data instance is not valid. Maybe you tried to access it after you called Release()");
491 return reinterpret_cast<T*
>(m_pBuffer->GetPtr());
516 return *GetDataPtr();
525 return *GetDataPtr();
567 operator const T&()
const
587 "This output_sample_data instance is not valid. Maybe you tried to access it after you called Release()");
613 inline void AssignValue(
const T& oValue)
615 std::memcpy(this->GetDataPtr(), &oValue,
sizeof(T));
#define UCOM_RESOLVE(...)
Resolve a path to a base class which is inherited multiple times.
Copyright © Audi Electronics Venture GmbH.
tInt64 tTimeStamp
type definition for a time value.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
#define ADTF_CLASS_INFO_IMPL(_class)
Common macro to implement correct treatment of adtf::ucom::ant::IClassInfo.
A common result class usable as return value throughout.
adtf::util::cStringUtil::tHashKey32 tHashKey
Type for the HashKey of the Value.
The SampleBuffer factory manages and can create SampleBuffers.
The SampleBuffer is the memory block object for the data of a ISample.
The ISample interface sets and retrieves properties on samples .
Interface for additional sample information on a Additional Sample Information.
The ISampleLog interface defines an interface to trace and store Sample data- and timing flow.
Sample that uses samples buffers that do not copy the data, but only keep a reference to it.
The cSample class implements a basic sample which contains streaming data.
tResult SetSampleBufferFactory(const ucom::ant::iobject_ptr< ISampleBufferFactory > &pFactory)
Sets the reference to the buffer factory, which will be used to create the user data content in ISamp...
ADTF_CLASS_ID_NAME(cSample, "sample.streaming.adtf.cid", "ADTF Default Sample")
private d pointer
Wrapper class that facilitates the handling of output samples.
output_sample_data(const ant::ISample &oSampleToCopy)
Initializes the data from an existing sample.
tResult SetSampleInfo(const ISampleInfo::tHashKey &oHash, const adtf::util::cVariant oValue)
Sets a variant value for the hash key oHash into the current samples sample information.
void SetSubStreamId(uint32_t nSubStreamId)
Sets the Substream id of the generated sample.
const T & operator*() const
const T * operator->() const
output_sample_data(base::flash::tNanoSeconds tmSampleTime, const T &oValue)
Initializes the data timestamp and value.
output_sample_data & operator=(const T &oValue)
Assigns a new value to the data.
const T * GetDataPtr() const
const T & GetData() const
output_sample_data(tTimeStamp tmSampleTime, const T &oValue)
Initializes the data timestamp and value.
output_sample_data(base::flash::tNanoSeconds tmSampleTime)
Initializes the data timestamp.
output_sample_data(const ucom::ant::iobject_ptr< const ant::ISample > &pSampleToCopy)
Initializes the data from an existing sample.
output_sample_data(tTimeStamp tmSampleTime)
Initializes the data timestamp.
ucom::ant::object_ptr< ant::ISample > Release()
Returns a sample that contains the data and resets all internal data.
virtual T * Get() const =0
Get raw pointer to shared object.
Base object pointer to realize binary compatible reference counting in interface methods.
Implementation for a exclusive lock guard.
Object pointer implementation used for reference counting on objects of type IObject.
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
tResult set_sample_info(ISampleInfo &oSampleInfo, const ISampleInfo::tHashKey &oHash, const adtf::util::cVariant oValue)
Sets a variant value for the hash key oHash into the sample information oSampleInfo.
tResult alloc_sample(ucom::ant::iobject_ptr< ucom::ant::IObject > &pSampleObject, const char *strSampleCID)
Helper Function to get a Sample Instance through the adtf::ucom::ant::IRuntime.
tResult alloc_sample(ucom::ant::iobject_ptr< ucom::ant::IObject > &pSample)
Helper Function to get a ISample Instance through the adtf::ucom::ant::IRuntime.
base::flash::tNanoSeconds get_sample_time(const ucom::ant::iobject_ptr< const ant::ISample > &pSample)
Returns the sample time stamp with nanosecond precision.
base::flash::tNanoSeconds get_sample_time(const ant::ISample &oSample)
Returns the sample timestamp with nanosecond precision.
void set_sample_time(ant::ISample &oSample, base::flash::tNanoSeconds tmTimeStamp)
Sets the sample timestamp with nanosecond precision.
void set_sample_time(const ucom::ant::iobject_ptr< ant::ISample > &pSample, base::flash::tNanoSeconds tmTimeStamp)
Sets the sample timestamp with nanosecond precision.
void set_sample_substream_id(const ucom::ant::iobject_ptr< ant::ISample > &pSample, uint32_t nSubStreamId)
Sets the substream id of a given sample.
uint32_t get_sample_substream_id(const ant::ISample &oSample)
void set_sample_substream_id(ant::ISample &oSample, uint32_t nSubStreamId)
Sets the substream id of a given sample.
uint32_t get_sample_substream_id(const ucom::ant::iobject_ptr< const ant::ISample > &pSample)
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
ant::IObject IObject
Alias always bringing the latest version of ant::IObject into scope.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
A timestamp with nanosecond precision.
#define THROW_ERROR_DESC(_code,...)
throws a tResult exception
#define THROW_IF_FAILED(s)
throws if the expression returns a failed tResult