MIRA
|
#include <fw/AbstractChannel.h>
Public Types | |
typedef ChannelBufferBase::Slot | Slot |
Public Member Functions | |
AbstractChannel (const std::string &id, ChannelBufferBase *buffer) | |
Constructs a new channel with the given id and the specified underlying channel buffer. More... | |
~AbstractChannel () | |
Destructor (KEEP NON VIRTUAL!) More... | |
const std::string & | getID () const |
Returns the channel id of this channel. More... | |
int | getTypeId () const |
Returns the non-portable typeid of the items that are stored in the slots of the underlying channel buffer. More... | |
Typename | getTypename () const |
Returns the platform independent typename of the items that are stored in the slots of the underlying channel buffer. More... | |
void | setTypename (const Typename &name) |
Sets the typename of the items that are stored in the slots of the underlying channel buffer. More... | |
TypeMetaPtr | getTypeMeta () const |
Returns the type meta information for the slots of the underlying channel buffer. More... | |
void | setTypeMeta (TypeMetaPtr meta) |
Sets the type meta information for the slots of the underlying channel buffer. More... | |
void | fixateType () |
Calling this method will fix the type of the underlying ChannelBuffer. More... | |
bool | isTyped () const |
Returns true, if the channel is typed and false, if it is untyped. More... | |
ChannelBufferBase * | getBuffer () |
Returns the underlying channel buffer. More... | |
std::size_t | getNrOfSlots () const |
Returns the number of slots this channel contains. More... | |
Time | getLastSlotTime () const |
Returns the timestamp of the data in the slot that was last written to this channel or an invalid time when there was no data written at all. More... | |
uint64 | getNrOfDataChanges () const |
Returns the number of times data was written to this channel. More... | |
bool | hasSubscriber () const |
Returns true, if this channel has at least one subscriber. More... | |
bool | hasPublisher () const |
Returns true, if this channel has at least one publisher. More... | |
void | removeSubscriber () |
Removes a subscriber that has not subscribed using a channel subscriber, (i.e. More... | |
void | removeSubscriber (AbstractChannelSubscriberPtr subscriber) |
Removes the specified subscriber from this channel and calls its detach() method. More... | |
void | finishWrite (Slot *s) |
Is called by ChannelWrite to signal that data was changed. More... | |
void | discardWrite (Slot *s) |
Is called by ChannelWrite to signal that this slot is discarded. More... | |
template<typename TargetType > | |
void | promote () |
Promote the channel to TargetType. More... | |
void | dbgDump (bool brief=true) |
Output the current buffer to console for debugging. More... | |
Protected Attributes | |
std::string | mID |
ChannelBufferBase * | mBuffer |
ChannelBufferBase * | mUntypedBuffer |
boost::mutex | mPromoteMutex |
boost::mutex | mSubscribersMutex |
std::list< AbstractChannelSubscriberPtr > | mSubscribers |
uint32 | mNrOfSubscribersWithoutChannelSubscriber |
Time | mLastSlotTime |
uint64 | mNrOfDataChanges |
Abstract base class for all typed Channel. It allows to store different typed channels within one container.
typedef ChannelBufferBase::Slot Slot |
AbstractChannel | ( | const std::string & | id, |
ChannelBufferBase * | buffer | ||
) |
Constructs a new channel with the given id and the specified underlying channel buffer.
~AbstractChannel | ( | ) |
Destructor (KEEP NON VIRTUAL!)
|
inline |
Returns the channel id of this channel.
|
inline |
Returns the non-portable typeid of the items that are stored in the slots of the underlying channel buffer.
If the buffer is untyped this method will return -1.
|
inline |
Returns the platform independent typename of the items that are stored in the slots of the underlying channel buffer.
If the channel is untyped the typename that was set using setTypename() is returned.
|
inline |
Sets the typename of the items that are stored in the slots of the underlying channel buffer.
Calling this method is allowed for untyped channels only. Calling it for typed channels will result in a XRuntime exception.
XRuntime | If the channel already is a typed channel. |
[in] | name | The new type name |
|
inline |
Returns the type meta information for the slots of the underlying channel buffer.
|
inline |
Sets the type meta information for the slots of the underlying channel buffer.
|
inline |
Calling this method will fix the type of the underlying ChannelBuffer.
This method currently is used by the polymorphic buffer only. It will set the type of the buffer and hence the channel 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.
|
inline |
Returns true, if the channel is typed and false, if it is untyped.
|
inline |
Returns the underlying channel buffer.
Note that the buffer may change if the channel is promoted.
|
inline |
Returns the number of slots this channel contains.
|
inline |
Returns the timestamp of the data in the slot that was last written to this channel or an invalid time when there was no data written at all.
|
inline |
Returns the number of times data was written to this channel.
|
inline |
Returns true, if this channel has at least one subscriber.
bool hasPublisher | ( | ) | const |
Returns true, if this channel has at least one publisher.
void removeSubscriber | ( | ) |
Removes a subscriber that has not subscribed using a channel subscriber, (i.e.
without a callback)
void removeSubscriber | ( | AbstractChannelSubscriberPtr | subscriber | ) |
Removes the specified subscriber from this channel and calls its detach() method.
void finishWrite | ( | Slot * | s | ) |
Is called by ChannelWrite to signal that data was changed.
[in] | s | Slot to be written into internal queue. |
void discardWrite | ( | Slot * | s | ) |
Is called by ChannelWrite to signal that this slot is discarded.
s | Slot to be discarded |
|
inline |
Promote the channel to TargetType.
|
inline |
Output the current buffer to console for debugging.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |