Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
RTT::InputPort< T > Class Template Reference

#include <InputPort.hpp>

Inheritance diagram for RTT::InputPort< T >:
Inheritance graph
[legend]

Public Member Functions

virtual base::PortInterfaceantiClone () const
 
void clear ()
 
virtual base::PortInterfaceclone () const
 
virtual ServicecreatePortObject ()
 
virtual bool createStream (ConnPolicy const &policy)
 
void getDataSample (T &sample)
 
base::DataSourceBasegetDataSource ()
 
virtual internal::ConnOutputEndpoint< T > * getEndpoint () const
 
virtual base::ChannelElement< T >::shared_ptr getSharedBuffer () const
 
virtual const types::TypeInfogetTypeInfo () const
 
 InputPort (std::string const &name="unnamed", ConnPolicy const &default_policy=ConnPolicy())
 
FlowStatus read (base::DataSourceBase::shared_ptr source)
 
FlowStatus read (base::DataSourceBase::shared_ptr source, bool copy_old_data)
 
FlowStatus read (typename base::ChannelElement< T >::reference_t sample)
 
FlowStatus read (typename base::ChannelElement< T >::reference_t sample, bool copy_old_data)
 
FlowStatus readNewest (base::DataSourceBase::shared_ptr source, bool copy_old_data=true)
 
FlowStatus readNewest (typename base::ChannelElement< T >::reference_t sample, bool copy_old_data=true)
 
virtual ~InputPort ()
 
- Public Member Functions inherited from RTT::base::InputPortInterface
virtual bool addConnection (internal::ConnID *port_id, ChannelElementBase::shared_ptr channel, ConnPolicy const &policy)
 
virtual base::ChannelElementBase::shared_ptr buildRemoteChannelOutput (base::OutputPortInterface &output_port, types::TypeInfo const *type_info, base::InputPortInterface &input, const ConnPolicy &policy)
 
virtual bool connected () const
 
virtual bool connectTo (PortInterface *other, ConnPolicy const &policy)
 
virtual bool connectTo (PortInterface *other)
 
virtual bool createConnection (internal::SharedConnectionBase::shared_ptr shared_connection, ConnPolicy const &policy=ConnPolicy())
 
virtual void disconnect ()
 
virtual bool disconnect (PortInterface *port)
 
ConnPolicy getDefaultPolicy () const
 
 InputPortInterface (std::string const &name, ConnPolicy const &default_policy=ConnPolicy())
 
void signalInterface (bool true_false)
 
virtual ~InputPortInterface ()
 
- Public Member Functions inherited from RTT::base::PortInterface
virtual bool connectedTo (PortInterface *port)
 
PortInterfacedoc (const std::string &desc)
 
const std::string & getDescription () const
 
const std::string & getFullName () const
 
DataFlowInterfacegetInterface () const
 
virtual internal::ConnectionManagergetManager ()
 
const std::string & getName () const
 
virtual internal::ConnIDgetPortID () const
 
virtual internal::SharedConnectionBase::shared_ptr getSharedConnection () const
 
virtual bool isLocal () const
 
virtual bool removeConnection (internal::ConnID *cid)
 
virtual int serverProtocol () const
 
void setInterface (DataFlowInterface *iface)
 
bool setName (const std::string &name)
 
virtual ~PortInterface ()
 

Private Member Functions

virtual bool connectionAdded (base::ChannelElementBase::shared_ptr channel_input, ConnPolicy const &policy)
 
 InputPort (InputPort const &orig)
 
InputPortoperator= (InputPort const &orig)
 

Private Attributes

internal::ConnOutputEndpoint< T >::shared_ptr endpoint
 

Friends

class internal::ConnOutputEndpoint< T >
 

Additional Inherited Members

- Protected Member Functions inherited from RTT::base::InputPortInterface
 InputPortInterface (const InputPortInterface &orig)
 
void signal ()
 
void traceRead (RTT::FlowStatus status)
 
- Protected Member Functions inherited from RTT::base::PortInterface
 PortInterface (const std::string &name)
 
- Protected Attributes inherited from RTT::base::InputPortInterface
ConnPolicy default_policy
 
bool msignal_interface
 
- Protected Attributes inherited from RTT::base::PortInterface
internal::ConnectionManager cmanager
 
os::MutexRecursive connection_lock
 
DataFlowInterfaceiface
 

Detailed Description

template<typename T>
class RTT::InputPort< T >

A component's data input port. An Orocos input port is used to receive data samples from a distant publisher. The InputPort is read() and returns true if a sample is available.

Ideally, your algorithm should not assume a certain connection policy being used from output to input. So it should work on data connections and buffer connections.

Definition at line 63 of file InputPort.hpp.

Constructor & Destructor Documentation

template<typename T>
RTT::InputPort< T >::InputPort ( InputPort< T > const &  orig)
private

You are not allowed to copy ports. In case you want to create a container of ports, use pointers to ports instead of the port object itself.

template<typename T>
RTT::InputPort< T >::InputPort ( std::string const &  name = "unnamed",
ConnPolicy const &  default_policy = ConnPolicy() 
)
inline

Definition at line 81 of file InputPort.hpp.

template<typename T>
virtual RTT::InputPort< T >::~InputPort ( )
inlinevirtual

Definition at line 86 of file InputPort.hpp.

Member Function Documentation

template<typename T>
virtual base::PortInterface* RTT::InputPort< T >::antiClone ( ) const
inlinevirtual

Create the anti-clone (inverse port) of this port with the same name A port for reading will return a new port for writing and vice versa.

Implements RTT::base::PortInterface.

Definition at line 196 of file InputPort.hpp.

template<typename T>
void RTT::InputPort< T >::clear ( )
inlinevirtual

Clears the input buffer (or all input buffers), so that read() will return NoData before a new sample has been written.

Implements RTT::base::InputPortInterface.

Definition at line 91 of file InputPort.hpp.

template<typename T>
virtual base::PortInterface* RTT::InputPort< T >::clone ( ) const
inlinevirtual

Create a clone of this port with the same name

Implements RTT::base::PortInterface.

Definition at line 188 of file InputPort.hpp.

template<typename T>
virtual bool RTT::InputPort< T >::connectionAdded ( base::ChannelElementBase::shared_ptr  channel_input,
ConnPolicy const &  policy 
)
inlineprivatevirtual

Definition at line 69 of file InputPort.hpp.

template<typename T>
virtual Service* RTT::InputPort< T >::createPortObject ( )
inlinevirtual

Create accessor Object for this Port, for addition to a TaskContext Object interface.

Reimplemented from RTT::base::PortInterface.

Definition at line 217 of file InputPort.hpp.

template<typename T>
virtual bool RTT::InputPort< T >::createStream ( ConnPolicy const &  policy)
inlinevirtual

Creates a data stream from or to this port using connection-less transports. Typically, policy.transport and policy.name_id must be properly filled in such that the data stream can be set up and input and output port can find each other. You need to call this method on two ports (input and output) using the same transport and (probably) same name_id.

Parameters
policyThe connection policy describing how the stream must be set up.

Implements RTT::base::PortInterface.

Definition at line 207 of file InputPort.hpp.

template<typename T>
void RTT::InputPort< T >::getDataSample ( T &  sample)
inline

Get a sample of the data on this port, without actually reading the port's data. It's the complement of OutputPort::setDataSample() and serves to retrieve the size of a variable sized data type T. Returns default T if !connected() or if the OutputPort did not use setDataSample(). Returns an example T otherwise. In case multiple inputs are connected to this port a sample from the currently read connection will be returned.

Definition at line 176 of file InputPort.hpp.

template<typename T>
base::DataSourceBase* RTT::InputPort< T >::getDataSource ( )
inlinevirtual

Returns a base::DataSourceBase interface to read this port. The returned data source is always a new object.

Implements RTT::base::InputPortInterface.

Definition at line 202 of file InputPort.hpp.

template<typename T>
virtual internal::ConnOutputEndpoint<T>* RTT::InputPort< T >::getEndpoint ( ) const
inlinevirtual

Returns the input or output endpoint of this port (if any). This method provides access to the internals of this port in order to access connected channel objects directly.

Implements RTT::base::PortInterface.

Definition at line 229 of file InputPort.hpp.

template<typename T>
virtual base::ChannelElement<T>::shared_ptr RTT::InputPort< T >::getSharedBuffer ( ) const
inlinevirtual

Definition at line 235 of file InputPort.hpp.

template<typename T>
virtual const types::TypeInfo* RTT::InputPort< T >::getTypeInfo ( ) const
inlinevirtual

Returns the types::TypeInfo object for the port's type

Implements RTT::base::PortInterface.

Definition at line 182 of file InputPort.hpp.

template<typename T>
InputPort& RTT::InputPort< T >::operator= ( InputPort< T > const &  orig)
private
template<typename T>
FlowStatus RTT::InputPort< T >::read ( base::DataSourceBase::shared_ptr  source)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 97 of file InputPort.hpp.

template<typename T>
FlowStatus RTT::InputPort< T >::read ( base::DataSourceBase::shared_ptr  source,
bool  copy_old_data 
)
inlinevirtual

Reads the port and updates the value hold by the given data source. This is only valid for local ports.

source has to be an assignable data source

Reimplemented from RTT::base::InputPortInterface.

Definition at line 100 of file InputPort.hpp.

template<typename T>
FlowStatus RTT::InputPort< T >::read ( typename base::ChannelElement< T >::reference_t  sample)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 133 of file InputPort.hpp.

template<typename T>
FlowStatus RTT::InputPort< T >::read ( typename base::ChannelElement< T >::reference_t  sample,
bool  copy_old_data 
)
inline

Reads a sample from the connection. sample is a reference which will get updated if a new sample is available.

The method returns an enum FlowStatus, which describes what type of sample (old or new data) or if a sample was returned (no data)

With the argument

  • copy_old_data one can specify, if sample should be updated in the case that the return type is equal to RTT::OldData. In case
  • copy_old_data is false and an old sample is available, the method will still return RTT::OldData but the sample will not be updated.

Definition at line 147 of file InputPort.hpp.

template<typename T>
FlowStatus RTT::InputPort< T >::readNewest ( base::DataSourceBase::shared_ptr  source,
bool  copy_old_data = true 
)
inline

Read all new samples that are available on this port, and returns the last one.

Returns RTT::NewData if at least one new sample was available, and either RTT::OldData or RTT::NoData otherwise.

Definition at line 120 of file InputPort.hpp.

template<typename T>
FlowStatus RTT::InputPort< T >::readNewest ( typename base::ChannelElement< T >::reference_t  sample,
bool  copy_old_data = true 
)
inline

Read all new samples that are available on this port, and returns the last one.

Returns RTT::NewData if at least one new sample was available, and either RTT::OldData or RTT::NoData otherwise.

Definition at line 158 of file InputPort.hpp.

Friends And Related Function Documentation

template<typename T>
friend class internal::ConnOutputEndpoint< T >
friend

Definition at line 66 of file InputPort.hpp.

Member Data Documentation

template<typename T>
internal::ConnOutputEndpoint<T>::shared_ptr RTT::InputPort< T >::endpoint
private

Definition at line 67 of file InputPort.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:46