39 #ifndef ORO_INPUT_PORT_HPP 40 #define ORO_INPUT_PORT_HPP 104 {
return read(source,
true); }
112 log(
Error) <<
"trying to read to an incompatible data source" << endlog();
115 return read(ds->
set(), copy_old_data);
130 log(
Error) <<
"trying to read to an incompatible data source" << endlog();
138 {
return read(sample,
true); }
223 #ifndef ORO_DISABLE_PORT_DATA_SCRIPTING 234 object->addSynchronousOperation(
"read", read_m,
this).
doc(
"Reads a sample from the port.").arg(
"sample",
"");
235 object->addSynchronousOperation(
"clear", &
InputPortInterface::clear,
this).
doc(
"Clears any remaining data in this port. After a clear, a read() will return NoData if no writes happened in between.");
boost::intrusive_ptr< ChannelElement< T > > shared_ptr
This is a channel element that represents the output endpoint of a connection, i.e.
The base class for all internal data representations.
base::ChannelElementBase * getCurrentChannel() const
Returns the first added channel or if select_if was called, the selected channel. ...
virtual void set(param_t t)=0
Set this DataSource with a value.
FlowStatus
Returns the status of a data flow read.
virtual FlowStatus read(reference_t sample, bool copy_old_data)
Reads a sample from the connection.
const std::string & getName() const
Get the name of this Port.
A connection policy object describes how a given connection should behave.
This class allows storage and retrieval of operations, ports, attributes and properties provided by a...
A typed version of ChannelElementBase.
static const types::TypeInfo * getTypeInfo()
Return the typeinfo object.
virtual Service * createPortObject()
Create accessor Object for this Port, for addition to a TaskContext Object interface.
static bool createStream(OutputPort< T > &output_port, ConnPolicy const &policy)
Creates, attaches and checks an outbound stream to an Output port.
A class for representing a user type, and which can build instances of that type. ...
boost::tuple< boost::shared_ptr< ConnID >, base::ChannelElementBase::shared_ptr, ConnPolicy > ChannelDescriptor
A Channel (= connection) is described by an opaque ConnID object, the first element of the channel an...
boost::call_traits< T >::reference reference_t
boost::intrusive_ptr< ChannelElementBase > shared_ptr
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
Use this type to store a pointer to an AssignableDataSource.
A DataSource which has set() methods.
void select_reader_channel(Pred pred, bool copy_old_data)
Selects a connection as the current channel if pred(connection) is true.
A component's data output port.
boost::intrusive_ptr< DataSourceBase > shared_ptr
Use this type to store a pointer to a DataSourceBase.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
PortInterface & doc(const std::string &desc)
Set the documentation of this port.
The base class of every data flow port.
virtual bool data_sample(param_t sample)
Provides a data sample to initialize this connection.