Updatables

An updatable can be readable or writable, depending on its definition in the Processing block interface definition. Use updatables to exchange bulk data, such as lookup table data or data calculated by a processing block. The data can be produced periodically or sporadically. If an updatable is defined as ‘Read’, a CQueue is created in the C++ base-class and the processing block can write the data and the PMP API can read the data. If it is defined as ‘Write’, a CUpdatable is created in the C++ base-class and the processing block can read the data. The data can be written to or read from through the PMP Updatable interface.

class CUpdatable

Readable file to communicate bulk data, for example the data of a lookup table.

template<typename T>
T ReadEntry(const size_t index) const

Reads the value of the specified index.

Parameters

index – The index of the entry that is read.

Returns

T – The value of index in the specified data type.

size_t GetCount() const

Get the maximum size of the updatable.

Returns

size_t – The maximum size of the updatable when read as the specified data type.

class CQueue

Writeable file to communicate bulk data, for example data calculated by the processingblock. This can be both periodical data as sporadically generated data.

template<typename T>
bool Append(const T &value)

Appends a value to the queue. Append will fail if the queue is full and in the PreInit state.

Parameters

value – The value to append.

Returns

bool – True if the value was successfully appended, false otherwise.

size_t GetUsedBytes() const

Get the number of bytes currently used in the queue.

Returns

size_t – The number of bytes currently used in the queue.

size_t GetFreeBytes() const

Get the number of bytes currently available in the queue.

Returns

size_t – The number of bytes currently available in the queue.

size_t GetCapacity() const

Get the maximum size of the queue.

Returns

size_t – The maximum size of the queue when read as the specified data type.