56 ucom::ant::IClassInfo>
74 ADTF3_DEPRECATED(
"The class 'cSample' is deprecated. Please use 'alloc_sample()' instead.")
100 tResult Lock(ucom::ant::iobject_ptr_shared_locked<const
adtf::streaming::ant::
ISampleBuffer>& oSampleBuffer) const override;
101 tResult WriteLock(ucom::ant::iobject_ptr_locked<
ISampleBuffer>& oSampleBuffer,
size_t szPreAllocateSize) override;
107 uint32_t GetFlags() const override;
108 tResult SetFlags(uint32_t ui32Flags) override;
112 uint32_t ui32Flags=0) override;
120 base::flash::tNanoSeconds GetTimeNs() const override;
121 tResult SetTime(base::flash::tNanoSeconds tmTimeStamp) override;
122 tResult Set(base::flash::tNanoSeconds tmTimeStamp,
125 uint32_t ui32Flags=0) override;
128 uint32_t GetSubStreamId() const override;
129 void SetSubStreamId(uint32_t nSubStreamId) override;
160 ADTF3_DEPRECATED(
"The class 'cReferenceSample' is deprecated because it is inherently unsafe. Please use 'alloc_sample()' in combination with 'ISample::SetSampleBuffer()' instead.")
351 template <
typename T>
354 static_assert(std::is_trivially_copyable<T>::value,
355 "You can only use plain types or structs without pointers or complex members.");
405 uint32_t nSubStreamId):
410 pSample->SetTime(tmSampleTime);
411 pSample->SetSubStreamId(nSubStreamId);
444 if (m_pBuffer->GetSize() !=
sizeof(T))
446 THROW_ERROR_DESC(ERR_INVALID_ARG,
"The sample passed to output_sample_data (%zu), does not match the size of the requested type (%zu).",
447 m_pBuffer->GetSize(),
494 "This output_sample_data instance is not valid. Maybe you tried to access it after you called Release()");
497 return reinterpret_cast<T*
>(m_pBuffer->GetPtr());
522 return *GetDataPtr();
531 return *GetDataPtr();
573 operator const T&()
const
593 "This output_sample_data instance is not valid. Maybe you tried to access it after you called Release()");
619 inline void AssignValue(
const T& oValue)
621 std::memcpy(this->GetDataPtr(), &oValue,
sizeof(T));
Copyright © Audi Electronics Venture GmbH.
#define ADTF3_DEPRECATED(_depr_message_)
Mark a function or variable as deprecated.
#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.
ADTF3_DEPRECATED("The class 'cReferenceSample' is deprecated because it is inherently unsafe. Please use 'alloc_sample()' in combination with 'ISample::SetSampleBuffer()' instead.") cReferenceSample()
CTOR.
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
cSample & operator=(const cSample &)=delete
delete copy operator (Samples will be treated only by ISample inferface)
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