MIRA
|
Specialization for polymorphic types (only classes derived from mira::Object are supported!) More...
#include <fw/ChannelBuffer.h>
Public Types | |
typedef Stamped< T * > | ValueType |
Public Member Functions | |
ChannelBuffer () | |
void | promote (const Class *promotionClass) |
Promotes the polymorphic type of the channel to the given class type. More... | |
template<typename TargetType > | |
ChannelBufferBase * | promote () |
Promotes this buffer to the specified target type (if required). More... | |
void | cloneParameters (const ChannelBufferBase &other) |
Copies the parameters of other to this. More... | |
void | setStorageDuration (const Duration &storageDuration) |
Sets the desired storage duration (the history). More... | |
void | setAutoIncreaseStorageDuration (bool increase) |
Sets whether the storage duration is automatically increased on read accesses. More... | |
void | setMinSlots (std::size_t minSlots) |
Sets the desired min. More... | |
void | setMaxSlots (std::size_t maxSlots) |
Sets the max. More... | |
std::size_t | getSize () const |
Returns the size of the buffer. More... | |
std::size_t | getMaxSlots () const |
Returns the size of the max number of slots. More... | |
std::size_t | getMinSlots () const |
Returns the size of the min number of slots. More... | |
Duration | getStorageDuration () const |
Returns the storage duration. More... | |
bool | isAutoIncreasingStorageDuration () const |
Returns whether the storage duration is automatically increased. More... | |
TypeMetaPtr | getTypeMeta () const |
Returns the meta information for the slots type. More... | |
void | setTypeMeta (TypeMetaPtr meta) |
Sets the meta information of the slot's type. More... | |
Slot * | requestWriteSlot () |
Returns a slot for writing, where the shared_mutex is already write locked. More... | |
bool | finishWriteSlot (Slot *n, bool *dropped=NULL) |
Adds written slot into buffer at the right time position. More... | |
void | discardWriteSlot (Slot *n) |
Discards written slot. More... | |
Slot * | readNewestSlot () |
Returns the newest(latest) slot for reading, where the shared_mutex is already read locked. More... | |
Slot * | readSlotAtTime (const Time ×tamp, SlotQueryMode mode) |
Returns a slot at the given time according to mode. More... | |
void | readInterval (const Time ×tamp, std::size_t nrSlots, std::size_t olderSlots, std::size_t newerSlots, IntervalFillMode fillMode, std::list< Slot *> &oSlots) |
Reads an interval of slots. More... | |
void | readInterval (const Time &from, const Time &to, std::list< Slot *> &oSlots) |
Reads an interval of slots. More... | |
void | dbgDump (const std::string &prefix, bool brief=true) |
void | dbgCheckIntegrity () |
Implementation of TypedChannelBufferBase<Object*> | |
virtual bool | isPolymorphic () const |
Returns true if the channel has a polymorphic type. More... | |
virtual int | getTypeId () const |
Returns typeid of the slot values, the allocator creates. More... | |
virtual Typename | getTypename () const |
Returns the Typename of the slot values, in contrast to getTypeId() the Typename is portable and unique between different processes and operating systems. More... | |
virtual ChannelBufferBase::Slot * | allocateSlot () |
Creates and returns a new slot. More... | |
virtual void | freeSlot (ChannelBufferBase::Slot *s) |
Called to destroy the slot and free the used memory. More... | |
virtual void | fixateType () |
Calling this method will fix the type of the ChannelBuffer. More... | |
virtual void | writeSerializedValue (ChannelBufferBase::Slot *s, Buffer< uint8 > data) |
Write the given buffer (that contains binary serialized data WITHOUT the StampedHeader) to the slot. More... | |
Implementation of ChannelBufferBase | |
virtual bool | isTyped () const |
Returns true, if the channel is typed and false, if it is untyped. More... | |
virtual void | setTypename (const Typename &name) |
Sets the Typename of the slot values. More... | |
virtual TypeMetaPtr | createTypeMeta (ChannelBufferBase::Slot *s, MetaTypeDatabase &ioDB) |
Creates meta information for data in slot and stores all meta information in the given database. More... | |
virtual StampedHeader & | getStampedHeader (ChannelBufferBase::Slot *s) |
Returns a reference to the stamped header information. More... | |
virtual const Buffer< uint8 > & | readSerializedValue (ChannelBufferBase::Slot *s) |
Returns a buffer containing the binary serialized data of the slot. More... | |
virtual const Buffer< uint8 > & | readSerializedValue (ChannelBufferBase::Slot *s, uint8 formatVersion, bool orLower) |
Returns a buffer containing the binary serialized data of the slot. More... | |
virtual Buffer< uint8 > | readSerializedValue (ChannelBufferBase::Slot *s, std::list< BinarySerializerCodecPtr > &codecs) |
Returns a buffer containing the binary serialized data of the slot. More... | |
virtual Buffer< uint8 > | readSerializedValue (ChannelBufferBase::Slot *s, std::list< BinarySerializerCodecPtr > &codecs, uint8 formatVersion, bool orLower) |
Returns a buffer containing the binary serialized data of the slot. More... | |
virtual void | readJSON (ChannelBufferBase::Slot *s, JSONValue &oValue) |
Reads data of that slot as json representation using a default-instantiated JSONSerializer. More... | |
virtual void | readJSON (ChannelBufferBase::Slot *s, JSONValue &oValue, JSONSerializer &serializer) |
Reads data of that slot as json representation using the provided JSONSerializer. More... | |
virtual void | writeJSON (ChannelBufferBase::Slot *s, const JSONValue &value) |
Writes data in json representation into the slot, using a default-instantiated JSONDeserializer. More... | |
virtual void | writeJSON (ChannelBufferBase::Slot *s, JSONDeserializer &deserializer) |
Writes data from an initialized json deserializer into the slot. More... | |
void | writeXML (ChannelBufferBase::Slot *s, const XMLDom::const_iterator &node) override |
Writes data in xml representation into the slot, using a default-instantiated XMLDeserializer and the name of the provided node. More... | |
Static Public Member Functions | |
static void | dbgCheckListIntegrity (const ListItem &list) |
Protected Member Functions | |
Slot * | castSlot (ChannelBufferBase::Slot *s) |
Cast an abstract slot to a typed slot. More... | |
void | clear () |
Deletes all slots in all lists and therefore clears the whole buffer. More... | |
Protected Attributes | |
const Class * | mMostDerivedClass |
const Class * | mFixatedClass |
Specialization for polymorphic types (only classes derived from mira::Object are supported!)
|
inline |
|
inlinevirtualinherited |
Returns true if the channel has a polymorphic type.
Reimplemented from TypedChannelBufferBase< Object *>.
|
virtualinherited |
Returns typeid of the slot values, the allocator creates.
Reimplemented from TypedChannelBufferBase< Object *>.
|
virtualinherited |
Returns the Typename of the slot values, in contrast to getTypeId() the Typename is portable and unique between different processes and operating systems.
Reimplemented from TypedChannelBufferBase< Object *>.
|
virtualinherited |
Creates and returns a new slot.
Reimplemented from TypedChannelBufferBase< Object *>.
|
virtualinherited |
Called to destroy the slot and free the used memory.
Reimplemented from TypedChannelBufferBase< Object *>.
|
virtualinherited |
Calling this method will fix the type of the ChannelBuffer.
This method currently is used by the polymorphic buffer only. It will set the type of the buffer to the type that the buffer currently has, hence it fixates the type of the buffer and the buffer can not be promoted to any other type of a derived class.
Reimplemented from TypedChannelBufferBase< Object *>.
|
virtualinherited |
Write the given buffer (that contains binary serialized data WITHOUT the StampedHeader) to the slot.
Reimplemented from TypedChannelBufferBase< Object *>.
|
inherited |
Promotes the polymorphic type of the channel to the given class type.
|
inherited |
Promotes this buffer to the specified target type (if required).
This method may create and return a new ChannelBuffer of the desired TargetType. In this case the original buffer should be destroyed by the caller. In some other cases when no new buffer needs to be created the method returns a pointer to this buffer itself.
|
inlineprotectedinherited |
Cast an abstract slot to a typed slot.
|
inlinevirtualinherited |
Returns true, if the channel is typed and false, if it is untyped.
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Sets the Typename of the slot values.
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Creates meta information for data in slot and stores all meta information in the given database.
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Returns a reference to the stamped header information.
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Returns a buffer containing the binary serialized data of the slot.
The serialized data does NOT contain any StampedHeader information.
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Returns a buffer containing the binary serialized data of the slot.
The serialized data does NOT contain any StampedHeader information.
formatVersion | The binary format version requested |
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Returns a buffer containing the binary serialized data of the slot.
The serialized data does NOT contain any StampedHeader information. For serialization it will use the specified codecs.
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Returns a buffer containing the binary serialized data of the slot.
The serialized data does NOT contain any StampedHeader information. For serialization it will use the specified codecs.
formatVersion | The binary format version requested |
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Reads data of that slot as json representation using a default-instantiated JSONSerializer.
XNotImplemented | if not supported by the channel |
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Reads data of that slot as json representation using the provided JSONSerializer.
XNotImplemented | if not supported by the channel |
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Writes data in json representation into the slot, using a default-instantiated JSONDeserializer.
XNotImplemented | if not supported by the channel |
Implements ChannelBufferBase.
|
inlinevirtualinherited |
Writes data from an initialized json deserializer into the slot.
XNotImplemented | if not supported by the channel |
Implements ChannelBufferBase.
|
inlineoverridevirtualinherited |
Writes data in xml representation into the slot, using a default-instantiated XMLDeserializer and the name of the provided node.
XNotImplemented | if not supported by the channel |
Implements ChannelBufferBase.
|
inlineinherited |
Copies the parameters of other to this.
|
inherited |
Sets the desired storage duration (the history).
This method can increase the duration only. If the specified duration is smaller than a previous set duration the call will be ignored.
|
inherited |
Sets whether the storage duration is automatically increased on read accesses.
If true, any read access specifying a timestamp will automatically increase the storage duration to the time difference between the timestamp and the most recent data (trying to ensure data is kept long enough for further such requests). The default is true.
|
inherited |
Sets the desired min.
number of slots for storing the history of a channel. This method can increase the min. number of slots only. Instead of specifying the min. number of slots you can also specify the desired storage duration using the setStorageDuration() method.
|
inherited |
Sets the max.
number of slots that are used for storing the history of a channel. maxSlots must at least be 1. The default is 100.
|
inherited |
Returns the size of the buffer.
|
inherited |
Returns the size of the max number of slots.
|
inherited |
Returns the size of the min number of slots.
|
inherited |
Returns the storage duration.
|
inherited |
Returns whether the storage duration is automatically increased.
|
inlineinherited |
Returns the meta information for the slots type.
|
inlineinherited |
Sets the meta information of the slot's type.
|
inherited |
Returns a slot for writing, where the shared_mutex is already write locked.
Implementation details:
|
inherited |
Adds written slot into buffer at the right time position.
Returns true, if the new Slot value is now the newest value in the buffer. dropped is set to true, if a slot with the same timestamp already exists and hence the slot was discarded.
|
inherited |
Discards written slot.
|
inherited |
Returns the newest(latest) slot for reading, where the shared_mutex is already read locked.
Returns NULL if no slot for reading is available.
|
inherited |
Returns a slot at the given time according to mode.
Returns NULL if no slot exists. See mira::Channel::read() for more informations. Increases storage duration (history) automatically to serve future requests.
|
inherited |
Reads an interval of slots.
See mira::Channel::readInterval for more information. Increases storage duration (history) automatically to serve future requests.
XInvalidRead | if not enough data slots available in channel |
Reads an interval of slots.
See mira::Channel::readInterval for more informations. Increases storage duration (history) automatically to serve future requests.
XInvalidParameter | if from > to |
|
protectedinherited |
Deletes all slots in all lists and therefore clears the whole buffer.
|
inherited |
|
staticinherited |
|
inherited |
|
protectedinherited |
|
protectedinherited |