Packet that contains data sent by a signal. The data can be either explicit, or implicit. More...
Packet that contains data sent by a signal. The data can be either explicit, or implicit.
Explicit data is contained within a signal's buffer, accessible through getRawData
, while implicit packets do not carry any data. Their values are calculated given a rule, packet offset, and the index of a sample within the data buffer.
To obtain implicitly calculated, or scaled values, getData
should be used. The data descriptor and sample count provide information about the type and amount of data available at the obtained address.
Public Member Functions | |
virtual ErrCode INTERFACE_FUNC | getDataDescriptor (IDataDescriptor **descriptor)=0 |
Gets the signal descriptor of the signal that sent the packet at the time of sending. More... | |
virtual ErrCode INTERFACE_FUNC | getSampleCount (SizeT *sampleCount)=0 |
Gets the number of samples in the packet. More... | |
virtual ErrCode INTERFACE_FUNC | getOffset (INumber **offset)=0 |
Gets current packet offset. This offset is later applied to the data rule used by a signal to calculate actual data value. This value is usually a time or other domain value. Packet offset is particularly useful when one wants to transfer a gap in otherwise equidistant samples. If we have a linear data rule, defined by equation f(x) = k*x + n, then the data value will be calculated by the equation g(x) = offset + f(x). More... | |
virtual ErrCode INTERFACE_FUNC | getData (void **address)=0 |
Gets the calculated/scaled data address of the packet. More... | |
virtual ErrCode INTERFACE_FUNC | getRawData (void **address)=0 |
Gets a pointer to the raw packet data. nullptr if the signal's data rule is implicit. More... | |
virtual ErrCode INTERFACE_FUNC | getDataSize (SizeT *dataSize)=0 |
Gets size of data buffer in bytes. More... | |
virtual ErrCode INTERFACE_FUNC | getRawDataSize (SizeT *rawDataSize)=0 |
Gets size of raw data buffer in bytes. More... | |
virtual ErrCode INTERFACE_FUNC | getDomainPacket (IDataPacket **packet)=0 |
Gets the associated domain Data packet. More... | |
virtual ErrCode INTERFACE_FUNC | getPacketId (Int *packetId)=0 |
Gets the unique packet id. More... | |
virtual ErrCode INTERFACE_FUNC | getLastValue (IBaseObject **value, ITypeManager *typeManager=nullptr)=0 |
Gets the data packet last value. More... | |
virtual ErrCode INTERFACE_FUNC | getValueByIndex (IBaseObject **value, SizeT index, ITypeManager *typeManager=nullptr)=0 |
Gets the data packet last value. More... | |
![]() | |
virtual ErrCode INTERFACE_FUNC | getType (PacketType *type)=0 |
Gets the packet's type. More... | |
virtual ErrCode INTERFACE_FUNC | subscribeForDestructNotification (IPacketDestructCallback *packetDestructCallback)=0 |
Subscribes for notification when the packet is destroyed. More... | |
virtual ErrCode INTERFACE_FUNC | getRefCount (SizeT *refCount)=0 |
Gets the reference count of the packet. More... | |
![]() | |
virtual ErrCode INTERFACE_FUNC | borrowInterface (const IntfID &intfID, void **obj) const =0 |
Returns another interface which is supported by the object without incrementing the reference count. More... | |
virtual ErrCode INTERFACE_FUNC | dispose ()=0 |
Disposes all references held by the object. More... | |
virtual ErrCode INTERFACE_FUNC | getHashCode (SizeT *hashCode)=0 |
Returns hash code of the object. More... | |
virtual ErrCode INTERFACE_FUNC | equals (IBaseObject *other, Bool *equal) const =0 |
Compares object to another object for equality. More... | |
virtual ErrCode INTERFACE_FUNC | toString (CharPtr *str)=0 |
Returns a string representation of the object. More... | |
![]() | |
virtual ErrCode INTERFACE_FUNC | queryInterface (const IntfID &intfID, void **obj)=0 |
Returns another interface which is supported by the object and increments the reference count. More... | |
virtual int INTERFACE_FUNC | addRef ()=0 |
Increments the reference count for an interface on an object. More... | |
virtual int INTERFACE_FUNC | releaseRef ()=0 |
Decrements the reference count for an interface on an object. More... | |
|
pure virtual |
Gets the calculated/scaled data address of the packet.
[out] | address | The address of the data. |
getData
uses the packet's data descriptor to calculate the values as follows:
The data should be cast to the appropriate type, as defined by the data descriptor, and read while keeping the data dimensions in mind.
|
pure virtual |
Gets the signal descriptor of the signal that sent the packet at the time of sending.
[out] | descriptor | The signal descriptor. |
|
pure virtual |
Gets size of data buffer in bytes.
[out] | dataSize | the size of data buffer in bytes. |
|
pure virtual |
Gets the associated domain Data packet.
[out] | packet | The domain data packet. |
|
pure virtual |
Gets the data packet last value.
[out] | value | The IBaseObject value can be a nullptr if there is no value, or if the data type is not supported by the function. |
typeManager | Optional ITypeManager value can be provided to enable getLastValue for IStruct. |
If a value is assigned, it can be cast based on the signal description to IFloat if the type is Float32 or Float64, to IInteger if the type is Int8 through Int64 or UInt8 through UInt64, to IComplexNumber if the type is ComplexFloat32 or ComplexFloat64, to IRange if the type is RangeInt64, to IStruct if the type is Struct, and to IList of the forementioned types if there is exactly one dimension.
Gets current packet offset. This offset is later applied to the data rule used by a signal to calculate actual data value. This value is usually a time or other domain value. Packet offset is particularly useful when one wants to transfer a gap in otherwise equidistant samples. If we have a linear data rule, defined by equation f(x) = k*x + n, then the data value will be calculated by the equation g(x) = offset + f(x).
[out] | offset | The packet offset |
|
pure virtual |
Gets the unique packet id.
[out] | packetId | The packet unique id. |
The packet id is automatically created on packet construction.
|
pure virtual |
Gets a pointer to the raw packet data. nullptr
if the signal's data rule is implicit.
[out] | address | Pointer to the raw packet data. |
|
pure virtual |
Gets size of raw data buffer in bytes.
[out] | dataSize | the size of raw data buffer in bytes. |
Raw data size is 0 if signal's data rule is implicit.
|
pure virtual |
Gets the number of samples in the packet.
[out] | sampleCount | the number of samples. |
|
pure virtual |
Gets the data packet last value.
[out] | value | The IBaseObject value can be a nullptr if there is no value, or if the data type is not supported by the function. |
[in] | index | Index of the sample to obtain. |
typeManager | Optional ITypeManager value can be provided to enable getLastValue for IStruct. |
If a value is assigned, it can be cast based on the signal description to IFloat if the type is Float32 or Float64, to IInteger if the type is Int8 through Int64 or UInt8 through UInt64, to IComplexNumber if the type is ComplexFloat32 or ComplexFloat64, to IRange if the type is RangeInt64, to IStruct if the type is Struct, and to IList of the forementioned types if there is exactly one dimension.