#include <interfaces.h>
Inheritance diagram for simth::InputInterfaceT< T >:
Public Member Functions | |
InputInterfaceT (Device *const dev, int ID, size_t sequenceLength=undefinedLength, const typename T::value_type &default_val=typename T::value_type()) | |
InputInterfaceT (Device *const dev, int ID, const typename T::value_type &default_val) | |
virtual | ~InputInterfaceT () |
T * | externSequence (size_t size, size_t capacity) |
T * | internSequence () |
virtual void | reset () |
virtual void | acceptNewData (size_t size) |
virtual size_t | sequenceLength () const |
virtual void | setSequenceLength (size_t newLen) |
virtual bool | isFilled () const |
virtual void | flushProcessedSequence () |
virtual void | releaseProcessedSequence () |
virtual void | processFinished () |
Protected Member Functions | |
void | incrementRefCount () |
void | decrementRefCount () |
size_t | storedElements () const |
This generic class implements an input interface with the given template argument as data type. Classes that can be used as template argument are declared in signals.h. However, one can define own signals (or data) classes that can be used as template arguments. Of course these classes must define functions and operators used by the interface classes.
|
Class constructor. |
|
Class that requires all arguments explicitly. |
|
Class destructor. |
|
Returns a pointer to a sequence that can be used for connected devices as output sequence. The returned sequence is a shallow copy of a sub part from the internal buffer. Since a shallow copy can be receized to lengths that are smaller or equal the capacity only, the second parameter should be used, if the device will resize the sequence length interim. Until now, only one copy can exist per time. In future versions maybe it could be usefull to maintain several copies simultanouesly, e.g. to allow parallel computing.
|
|
Returns a sequence that is used from the parent device as input data. Actually, this sequence is only a shallow copy of a sub part of the internal buffer to which the connected devices wrote their output data at. If the sequence length equals 0 when calling this function, the sequence length is set to the number of received and so far not processed elements, i.e. it is set to the number of stored elements within the internal buffer (storedElements()). |
|
Resets the device. After calling that function the interface should behave as before any data had arrived. Implements simth::InputInterface. |
|
This function is invoked, when the interface got new data from the connected interface and the number of stored elements (including the number of the new data elements) is larger than the sequence length (see sequenceLenght()). Implements simth::InputInterface. |
|
Returns the sequence length of the input interface.
The sequence length specifies when the parent device (see device()) is informed about new incoming data, i.e. if the number of stored elements exceeds the sequence length, Implements simth::InputInterface. |
|
Sets the number of elements needed at least to fill the buffer. Implements simth::InputInterface. |
|
Returns true if the input buffer is filled (i.e. the buffer is filled with more than sequenceLength() elements) or if the interface is not connected with another device. Implements simth::InputInterface. |
|
Flushes the processed data elements. This function is called after input data elements had been passed by the function internSequence() to the parent device. The number of elements that had been passed and that are now flushed equals the sequence length number (see sequenceLength()). The reference counter of the inteface is subtracted by one. Implements simth::InputInterface. |
|
Releases the processed data elements. Like in flushProcessedSequence() the reference counter of the interface is subtracted by one to release the accessed sequence. Unlike in flushProcessedSequence() the data is not flushed from the internal buffer. Implements simth::InputInterface. |
|
This function is called by the connected device if it finished writing new data to this input interface. Implements simth::InputInterface. |
|
|
|
|
|
|