39 #ifndef MQ_CHANNEL_ELEMENT_H 40 #define MQ_CHANNEL_ELEMENT_H 43 #include "../../Logger.hpp" 44 #include "../../base/ChannelElement.hpp" 45 #include "../../internal/DataSource.hpp" 46 #include "../../internal/DataSources.hpp" 90 if (
mqReady(read_sample,
this) ) {
145 if (output &&
mqRead(read_sample))
158 throw std::runtime_error(
"not implemented");
199 return "MQChannelElement";
Implements the sending/receiving of mqueue messages.
virtual bool inputReady()
This is called by an input port when it is ready to receive data.
boost::call_traits< T >::param_type param_t
boost::intrusive_ptr< ChannelElement< T > > shared_ptr
virtual void mqNewSample(base::DataSourceBase::shared_ptr ds)
Adapts the mq send/receive buffer size according to the data in mqdata_source, or the value set in md...
bool mqRead(base::DataSourceBase::shared_ptr ds)
Read from the message queue.
bool mis_sender
True if this object is a sender.
boost::intrusive_ptr< LateConstReferenceDataSource< T > > shared_ptr
void setupStream(base::DataSourceBase::shared_ptr ds, base::PortInterface *port, ConnPolicy const &policy, bool is_sender)
FlowStatus
Returns the status of a data flow read.
std::string mqname
The name of the queue, as specified in the ConnPolicy when creating the stream, or self-calculated wh...
Implements the a ChannelElement using message queues.
virtual std::string getLocalURI() const
This function return the URI of this element.
FlowStatus read(typename base::ChannelElement< T >::reference_t sample, bool copy_old_data)
Read from the message queue.
virtual FlowStatus read(reference_t sample, bool copy_old_data)
Reads a sample from the connection.
virtual std::string getElementName() const
Returns the class name of this element.
virtual bool write(param_t sample)
Writes a new sample on this connection.
A connection policy object describes how a given connection should behave.
bool mqWrite(base::DataSourceBase::shared_ptr ds)
Write to the message queue.
void set(typename AssignableDataSource< T >::param_t t)
virtual bool mqReady(base::DataSourceBase::shared_ptr ds, base::ChannelElementBase *chan)
Works only in receive mode, waits for a new sample and adapts the receive buffer to match it's size...
A DataSource which is used to manipulate a const reference to an external value, by means of a pointe...
virtual bool data_sample(typename base::ChannelElement< T >::param_t sample)
virtual std::string getRemoteURI() const
This function returns the URI of the next channel element in the logical chain.
ChannelElementBase::shared_ptr getInput()
Returns the current input channel element.
Objects implementing this interface have the capability to convert data sources to and from a binary ...
A typed version of ChannelElementBase.
virtual std::string getLocalURI() const
This function return the URI of this element.
boost::call_traits< T >::reference reference_t
bool write(typename base::ChannelElement< T >::param_t sample)
Write to the message queue.
Notify the Logger in which 'module' the message occured.
void setPointer(const typename AssignableDataSource< T >::value_t *ptr)
bool signal()
Signal will cause a read-write cycle to transfer the data from the data/buffer element to the message...
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
AssignableDataSource< T >::const_reference_t rvalue() const
Get a const reference to the value of this DataSource.
In the data flow implementation, a channel is created by chaining ChannelElementBase objects...
The base class of every data flow port.
MQChannelElement(base::PortInterface *port, types::TypeMarshaller const &transport, const ConnPolicy &policy, bool is_sender)
Create a channel element for remote data exchange.
virtual bool isRemoteElement() const
This function may be used to identify, if the current element uses a network transport, to send the data to the next Element in the logical chain.
A simple, yet very useful DataSource, which keeps a value, and returns it in its get() method...
ChannelElementBase::shared_ptr getOutput()
Returns the next channel element in the channel's propagation direction.
virtual std::string getRemoteURI() const
This function returns the URI of the next channel element in the logical chain.
virtual bool data_sample(param_t sample)
Provides a data sample to initialize this connection.
boost::intrusive_ptr< ValueDataSource< T > > shared_ptr