openDAQ
Open data acquisition platform
Factories
+ Collaboration diagram for Factories:

Detailed Description

Functions

DataPacketPtr BinaryDataPacket (const DataPacketPtr &domainPacket, const DataDescriptorPtr &descriptor, uint64_t sampleSize)
 Creates a data packet with binary sample type with a given descriptor and memory size of a sample. More...
 
DataPacketPtr BinaryDataPacketWithExternalMemory (const DataPacketPtr &domainPacket, const DataDescriptorPtr &descriptor, uint64_t sampleSize, void *data, const DeleterPtr &deleter)
 Creates a data packet with binary sample type with a given descriptor, memory size of a sample, pointer to an existing memory location and a deleter. More...
 
DataPacketPtr DataPacket (const DataDescriptorPtr &descriptor, uint64_t sampleCount, const NumberPtr &offset=nullptr)
 Creates a Data packet with a given descriptor, sample count, and an optional packet offset. More...
 
DataPacketPtr DataPacketWithDomain (const DataPacketPtr &domainPacket, const DataDescriptorPtr &descriptor, uint64_t sampleCount, NumberPtr offset=nullptr)
 Creates a Data packet with a given descriptor, sample count, a reference to a packet that describes the domain (time) data, and an optional packet offset. More...
 
template<class T >
DataPacketPtr ConstantDataPacketWithDomain (const DataPacketPtr &domainPacket, const DataDescriptorPtr &descriptor, uint64_t sampleCount, T initialValue, const std::vector< ConstantPosAndValue< T >> &otherValues={})
 Creates a Data packet with a given constat rule descriptor, initial constant value, and other constant values. More...
 
DataPacketPtr DataPacketWithExternalMemory (const DataPacketPtr &domainPacket, const DataDescriptorPtr &descriptor, uint64_t sampleCount, void *data, const DeleterPtr &deleter, NumberPtr offset=nullptr, SizeT bufferSize=std::numeric_limits< SizeT >::max())
 Creates a Data packet with a given descriptor, sample count, a reference to a packet that describes the domain (time) data, pointer to an existing memory location and a deleter, and an optional packet offset. More...
 
EventPacketPtr EventPacket (const StringPtr &id, const DictPtr< IString, IBaseObject > &parameters)
 Creates and Event packet with a given id and parameter dictionary. More...
 
EventPacketPtr DataDescriptorChangedEventPacket (const DataDescriptorPtr &dataDescriptor, const DataDescriptorPtr &domainDataDescriptor)
 Creates a DataDescriptorChanged Event packet. More...
 
EventPacketPtr ImplicitDomainGapDetectedEventPacket (const NumberPtr &diff)
 Creates a ImplicitDomainGapDetected Event packet. More...
 

Function Documentation

◆ BinaryDataPacket()

DataPacketPtr BinaryDataPacket ( const DataPacketPtr &  domainPacket,
const DataDescriptorPtr descriptor,
uint64_t  sampleSize 
)
inline

Creates a data packet with binary sample type with a given descriptor and memory size of a sample.

Parameters
descriptorThe descriptor of the signal sending the data.
sampleSizethe memory size of the binary sample.

Binary value packet contains exactly one sample of binary type. The size of the sample is provided with sampleSize argument.

◆ BinaryDataPacketWithExternalMemory()

DataPacketPtr BinaryDataPacketWithExternalMemory ( const DataPacketPtr &  domainPacket,
const DataDescriptorPtr descriptor,
uint64_t  sampleSize,
void *  data,
const DeleterPtr deleter 
)
inline

Creates a data packet with binary sample type with a given descriptor, memory size of a sample, pointer to an existing memory location and a deleter.

Parameters
descriptorThe descriptor of the signal sending the data.
sampleSizethe memory size of the binary sample.
dataPointer to a custom memory location
delterDeleter callback to free the memory

Binary data packet contains exactly one sample of binary type. The size of the sample is provided with sampleSize argument. This factory does not allocate any memory for the data. Instead the memory is provided through data parameter. Deleter callback is called when the packet is destroyed. The callback should free the memory.

◆ ConstantDataPacketWithDomain()

DataPacketPtr ConstantDataPacketWithDomain ( const DataPacketPtr &  domainPacket,
const DataDescriptorPtr descriptor,
uint64_t  sampleCount,
initialValue,
const std::vector< ConstantPosAndValue< T >> &  otherValues = {} 
)

Creates a Data packet with a given constat rule descriptor, initial constant value, and other constant values.

Parameters
domainPacketThe Data packet carrying domain data.
descriptorThe descriptor of the signal sending the data.
initialValueThe initial constant value.
otherValuesThe other constant values.

The values in the packet are calculated by constant rule. The initial value is taken as a constant. Other values are used to change the constant value within the packet. Any number of other constant values can be used. Other values are passed as an array of struct with uint32_t sample position field and value field. Value field (as well as initial value) are of type defined as sample type in the descriptor.

◆ DataDescriptorChangedEventPacket()

EventPacketPtr DataDescriptorChangedEventPacket ( const DataDescriptorPtr dataDescriptor,
const DataDescriptorPtr domainDataDescriptor 
)
inline

Creates a DataDescriptorChanged Event packet.

Parameters
dataDescriptorThe data descriptor of the value signal.
domainDataDescriptorThe data descriptor of the domain signal that carries domain data of the value signal.

If the descriptor has not been modified, the parameter should be set to nullptr. If the descriptor itself becomes unassigned (i.e., nullptr), a stub descriptor created within the 'NullDataDescriptor()' factory having SampleType set to Null should be used as the corresponding parameter.

The ID of the packet is "DATA_DESCRIPTOR_CHANGED". Its parameters dictionary contains the keys "DataDescriptor" and "DomainDataDescriptor", carrying their respective data descriptor objects as values.

◆ DataPacket()

DataPacketPtr DataPacket ( const DataDescriptorPtr descriptor,
uint64_t  sampleCount,
const NumberPtr offset = nullptr 
)
inline

Creates a Data packet with a given descriptor, sample count, and an optional packet offset.

Parameters
descriptorThe descriptor of the signal sending the data.
sampleCountThe number of samples in the packet.
offsetOptional packet offset parameter, used to calculate the data of the packet if the Data rule of the Signal descriptor is not explicit.

◆ DataPacketWithDomain()

DataPacketPtr DataPacketWithDomain ( const DataPacketPtr &  domainPacket,
const DataDescriptorPtr descriptor,
uint64_t  sampleCount,
NumberPtr  offset = nullptr 
)
inline

Creates a Data packet with a given descriptor, sample count, a reference to a packet that describes the domain (time) data, and an optional packet offset.

Parameters
domainPacketThe Data packet carrying domain data.
descriptorThe descriptor of the signal sending the data.
sampleCountThe number of samples in the packet.
offsetOptional packet offset parameter, used to calculate the data of the packet if the Data rule of the Signal descriptor is not explicit.

◆ DataPacketWithExternalMemory()

DataPacketPtr DataPacketWithExternalMemory ( const DataPacketPtr &  domainPacket,
const DataDescriptorPtr descriptor,
uint64_t  sampleCount,
void *  data,
const DeleterPtr deleter,
NumberPtr  offset = nullptr,
SizeT  bufferSize = std::numeric_limits<SizeT>::max() 
)
inline

Creates a Data packet with a given descriptor, sample count, a reference to a packet that describes the domain (time) data, pointer to an existing memory location and a deleter, and an optional packet offset.

Parameters
domainPacketThe Data packet carrying domain data.
descriptorThe descriptor of the signal sending the data.
sampleCountThe number of samples in the packet.
dataPointer to a custom memory location
deleterDeleter callback to free the memory
offsetOptional packet offset parameter, used to calculate the data of the packet if the Data rule of the Signal descriptor is not explicit.

◆ EventPacket()

EventPacketPtr EventPacket ( const StringPtr id,
const DictPtr< IString, IBaseObject > &  parameters 
)
inline

Creates and Event packet with a given id and parameter dictionary.

Parameters
idThe ID of the event.
parametersThe <String, BaseObject> dictionary containing the event parameters.

◆ ImplicitDomainGapDetectedEventPacket()

EventPacketPtr ImplicitDomainGapDetectedEventPacket ( const NumberPtr diff)
inline

Creates a ImplicitDomainGapDetected Event packet.

Parameters
diffThe size of the gap in ticks or value

The ID of the packet is "IMPLICIT_DOMAIN_GAP_DETECTED". Its parameters dictionary contains the key "GapDiff", which holds the size of the gap. The size can be negative, in which case it is an overlap of samples.