9 #ifndef BLOCKFACTORY_CORE_SIGNAL_H 10 #define BLOCKFACTORY_CORE_SIGNAL_H 190 template <
typename T>
198 template <
typename T>
214 template <
typename T>
215 T
get(
const size_t i)
const;
226 bool set(
const size_t index,
const double data);
242 template <
typename T>
243 bool setBuffer(
const T* data,
const size_t length);
245 #ifndef DOXYGEN_SHOULD_SKIP_THIS 250 void* m_bufferPtr =
nullptr;
252 template <
typename T>
253 T* getBufferImpl()
const;
256 void allocateBuffer(
const void*
const bufferInput,
void*& bufferOutput,
size_t length);
269 extern template double* Signal::getBuffer<double>();
270 extern template const double* Signal::getBuffer<double>()
const;
271 extern template double Signal::get<double>(
const size_t i)
const;
272 extern template bool Signal::setBuffer<double>(
const double* data,
const size_t length);
276 #endif // BLOCKFACTORY_CORE_SIGNAL_H bool initializeBufferFromNonContiguous(const void *const *bufferPtrs, size_t len)
Initialize the signal from a non-contiguous buffer.
DataFormat getDataFormat() const
Read the core::Signal::DataFormat of the signal.
Class to access data shared by blocks, represented as signals.
Definition: Signal.h:36
DataFormat
Definition: Signal.h:56
bool initializeBufferFromContiguous(const void *buffer, size_t len)
Initialize the signal from a contiguous buffer.
bool setBuffer(const T *data, const size_t length)
Set the pointer to the buffer storing signal's data.
Port::DataType getPortDataType() const
Read the Port::DataType of the signal.
Signal & operator=(const Signal &other)=delete
bool isValid() const
Check if the signal is valid.
DataType
Defines allowed port data types.
Definition: Port.h:62
bool initializeBufferFromContiguousZeroCopy(const void *buffer, size_t len)
Initialize the signal from a contiguous buffer without copying data.
T * getBuffer()
Get the pointer to the buffer storing signal's data.
size_t getWidth() const
Read the width of the signal.
Signal(const DataFormat &dataFormat=DataFormat::CONTIGUOUS_ZEROCOPY, const Port::DataType &dataType=Port::DataType::DOUBLE)