MIRA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ChannelReadWriteCommonBase< Derived > Class Template Reference

#include <fw/ChannelReadWrite.h>

Inheritance diagram for ChannelReadWriteCommonBase< Derived >:
Inheritance graph
[legend]

Public Types

typedef ChannelReadWriteShared
< Derived > 
Shared
 
typedef boost::shared_ptr< SharedSharedPtr
 
typedef Shared::ChannelType ChannelType
 
typedef Shared::ChannelTypePtr ChannelTypePtr
 
typedef Shared::Slot Slot
 
typedef Shared::ValueType ValueType
 

Public Member Functions

 ChannelReadWriteCommonBase ()
 Constructs an empty (invalid) ChannelReadWriteBase object. More...
 
 ChannelReadWriteCommonBase (ChannelTypePtr channel, Slot *slot)
 Constructs a valid ChannelReadWriteBase object that is assigned to a channel and slot. More...
 
bool isValid () const
 Returns true, if data was assigned to the ChannelRead or ChannelWrite and if this data is locked. More...
 
const std::string & getChannelID ()
 
std::string getTypename () const
 
TypeMetaPtr getTypeMeta () const
 
const TimegetTimestamp () const
 
int getUseCount () const
 Returns the number of shared instances for this data, may be useful for debugging purposes. More...
 
uint32 getFlags () const
 For internal use only. More...
 
void addFlags (uint32 moreFlags) const
 For internal use only. More...
 

Protected Member Functions

void checkValid () const
 checks if we are still locked, if not it throws a XAccessViolation More...
 
const Buffer< uint8 > & readSerializedValue ()
 
const Buffer< uint8 > & readSerializedValue (uint8 formatVersion, bool orLower)
 
Buffer< uint8 > readSerializedValue (std::list< BinarySerializerCodecPtr > &codecs)
 Same as above, but allows to specify codecs for serialization. More...
 
Buffer< uint8 > readSerializedValue (std::list< BinarySerializerCodecPtr > &codecs, uint8 formatVersion, bool orLower)
 
void readJSON (JSONValue &oValue)
 
void readJSON (JSONValue &oValue, JSONSerializer &serializer)
 
void writeSerializedValue (Buffer< uint8 > data)
 
void writeJSON (const JSONValue &value)
 
void writeJSON (JSONDeserializer &deserializer)
 

Protected Attributes

SharedPtr shared
 

Detailed Description

template<typename Derived>
class mira::ChannelReadWriteCommonBase< Derived >

Note
: NEVER EXPOSE THE CHANNELPTR OR CHANNEL DIRECTLY TO THE USER. The user is allowed to access the channel using the Channel<T> proxy ONLY!

Member Typedef Documentation

typedef ChannelReadWriteShared<Derived> Shared
typedef boost::shared_ptr<Shared> SharedPtr
typedef Shared::Slot Slot

Constructor & Destructor Documentation

Constructs an empty (invalid) ChannelReadWriteBase object.

ChannelReadWriteCommonBase ( ChannelTypePtr  channel,
Slot slot 
)
inline

Constructs a valid ChannelReadWriteBase object that is assigned to a channel and slot.

Member Function Documentation

bool isValid ( ) const
inline

Returns true, if data was assigned to the ChannelRead or ChannelWrite and if this data is locked.

If this method returns true, you can safely access the underlying data.

If this method returns false, no data was assigned to the ChannelRead / ChannelWrite or the lock on the data was lost. Hence, it is not safe to access the underlying data. If you try to access the data anyway you will get an XRuntime exception.

const std::string& getChannelID ( )
inline
std::string getTypename ( ) const
inline
TypeMetaPtr getTypeMeta ( ) const
inline
const Time& getTimestamp ( ) const
inline
int getUseCount ( ) const
inline

Returns the number of shared instances for this data, may be useful for debugging purposes.

uint32 getFlags ( ) const
inline

For internal use only.

Used by remote components of the framework and by player and recorder. Returns current flags of this slot;

void addFlags ( uint32  moreFlags) const
inline

For internal use only.

Used by remote components of the framework and by player and recorder. Add additional flags to the slots flags.

void checkValid ( ) const
inlineprotected

checks if we are still locked, if not it throws a XAccessViolation

const Buffer<uint8>& readSerializedValue ( )
inlineprotected
const Buffer<uint8>& readSerializedValue ( uint8  formatVersion,
bool  orLower 
)
inlineprotected
Buffer<uint8> readSerializedValue ( std::list< BinarySerializerCodecPtr > &  codecs)
inlineprotected

Same as above, but allows to specify codecs for serialization.

Buffer<uint8> readSerializedValue ( std::list< BinarySerializerCodecPtr > &  codecs,
uint8  formatVersion,
bool  orLower 
)
inlineprotected
void readJSON ( JSONValue oValue)
inlineprotected
void readJSON ( JSONValue oValue,
JSONSerializer serializer 
)
inlineprotected
void writeSerializedValue ( Buffer< uint8 >  data)
inlineprotected
void writeJSON ( const JSONValue value)
inlineprotected
void writeJSON ( JSONDeserializer deserializer)
inlineprotected

Member Data Documentation

SharedPtr shared
protected

The documentation for this class was generated from the following file: