RTT::InputPort< T > Class Template Reference
[Data Flow Ports]

#include <InputPort.hpp>

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

List of all members.

Public Member Functions

virtual base::PortInterfaceantiClone () const
virtual base::PortInterfaceantiClone () const
virtual base::PortInterfaceclone () const
virtual base::PortInterfaceclone () const
virtual ServicecreatePortObject ()
virtual ServicecreatePortObject ()
virtual bool createStream (ConnPolicy const &policy)
virtual bool createStream (ConnPolicy const &policy)
base::DataSourceBasegetDataSource ()
base::DataSourceBasegetDataSource ()
virtual const types::TypeInfogetTypeInfo () const
virtual const types::TypeInfogetTypeInfo () const
 InputPort (std::string const &name="unnamed", ConnPolicy const &default_policy=ConnPolicy())
 InputPort (std::string const &name="unnamed", ConnPolicy const &default_policy=ConnPolicy())
FlowStatus read (typename base::ChannelElement< T >::reference_t sample, bool copy_old_data)
FlowStatus read (typename base::ChannelElement< T >::reference_t sample)
FlowStatus read (base::DataSourceBase::shared_ptr source, bool copy_old_data)
FlowStatus read (base::DataSourceBase::shared_ptr source)
FlowStatus read (typename base::ChannelElement< T >::reference_t sample, bool copy_old_data)
FlowStatus read (typename base::ChannelElement< T >::reference_t sample)
FlowStatus read (base::DataSourceBase::shared_ptr source, bool copy_old_data)
FlowStatus read (base::DataSourceBase::shared_ptr source)
FlowStatus readNewest (typename base::ChannelElement< T >::reference_t sample, bool copy_old_data=true)
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)
FlowStatus readNewest (base::DataSourceBase::shared_ptr source, bool copy_old_data=true)
virtual ~InputPort ()
virtual ~InputPort ()

Private Member Functions

virtual bool connectionAdded (base::ChannelElementBase::shared_ptr channel_input, ConnPolicy const &policy)
virtual bool connectionAdded (base::ChannelElementBase::shared_ptr channel_input, ConnPolicy const &policy)
bool do_read (typename base::ChannelElement< T >::reference_t sample, FlowStatus &result, bool copy_old_data, const internal::ConnectionManager::ChannelDescriptor &descriptor)
bool do_read (typename base::ChannelElement< T >::reference_t sample, FlowStatus &result, bool copy_old_data, const internal::ConnectionManager::ChannelDescriptor &descriptor)
 InputPort (InputPort const &orig)
 InputPort (InputPort const &orig)
InputPortoperator= (InputPort const &orig)
InputPortoperator= (InputPort const &orig)

Private Attributes

internal::InputPortSource< T >
::shared_ptr 
data_source

Friends

class internal::ConnOutputEndpoint< T >

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 61 of file install/include/rtt/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 82 of file install/include/rtt/InputPort.hpp.

template<typename T>
virtual RTT::InputPort< T >::~InputPort (  )  [inline, virtual]

Definition at line 86 of file install/include/rtt/InputPort.hpp.

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 82 of file rtt/InputPort.hpp.

template<typename T>
virtual RTT::InputPort< T >::~InputPort (  )  [inline, virtual]

Definition at line 86 of file rtt/InputPort.hpp.


Member Function Documentation

template<typename T>
virtual base::PortInterface* RTT::InputPort< T >::antiClone (  )  const [inline, virtual]

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 177 of file rtt/InputPort.hpp.

template<typename T>
virtual base::PortInterface* RTT::InputPort< T >::antiClone (  )  const [inline, virtual]

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 177 of file install/include/rtt/InputPort.hpp.

template<typename T>
virtual base::PortInterface* RTT::InputPort< T >::clone (  )  const [inline, virtual]

Create a clone of this port with the same name

Implements RTT::base::PortInterface.

Definition at line 169 of file rtt/InputPort.hpp.

template<typename T>
virtual base::PortInterface* RTT::InputPort< T >::clone (  )  const [inline, virtual]

Create a clone of this port with the same name

Implements RTT::base::PortInterface.

Definition at line 169 of file install/include/rtt/InputPort.hpp.

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

Definition at line 53 of file rtt/InputPort.hpp.

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

Definition at line 53 of file install/include/rtt/InputPort.hpp.

template<typename T>
virtual Service* RTT::InputPort< T >::createPortObject (  )  [inline, virtual]

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

Reimplemented from RTT::base::PortInterface.

Definition at line 200 of file rtt/InputPort.hpp.

template<typename T>
virtual Service* RTT::InputPort< T >::createPortObject (  )  [inline, virtual]

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

Reimplemented from RTT::base::PortInterface.

Definition at line 200 of file install/include/rtt/InputPort.hpp.

template<typename T>
virtual bool RTT::InputPort< T >::createStream ( ConnPolicy const &  policy  )  [inline, virtual]

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:
policy The connection policy describing how the stream must be set up.

Implements RTT::base::PortInterface.

Definition at line 191 of file rtt/InputPort.hpp.

template<typename T>
virtual bool RTT::InputPort< T >::createStream ( ConnPolicy const &  policy  )  [inline, virtual]

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:
policy The connection policy describing how the stream must be set up.

Implements RTT::base::PortInterface.

Definition at line 191 of file install/include/rtt/InputPort.hpp.

template<typename T>
bool RTT::InputPort< T >::do_read ( typename base::ChannelElement< T >::reference_t  sample,
FlowStatus result,
bool  copy_old_data,
const internal::ConnectionManager::ChannelDescriptor descriptor 
) [inline, private]

Definition at line 55 of file rtt/InputPort.hpp.

template<typename T>
bool RTT::InputPort< T >::do_read ( typename base::ChannelElement< T >::reference_t  sample,
FlowStatus result,
bool  copy_old_data,
const internal::ConnectionManager::ChannelDescriptor descriptor 
) [inline, private]

Definition at line 55 of file install/include/rtt/InputPort.hpp.

template<typename T>
base::DataSourceBase* RTT::InputPort< T >::getDataSource (  )  [inline, virtual]

Returns a base::DataSourceBase interface to read this port. The returned data source is always the same object and will be destroyed when the port is destroyed.

Implements RTT::base::InputPortInterface.

Definition at line 184 of file rtt/InputPort.hpp.

template<typename T>
base::DataSourceBase* RTT::InputPort< T >::getDataSource (  )  [inline, virtual]

Returns a base::DataSourceBase interface to read this port. The returned data source is always the same object and will be destroyed when the port is destroyed.

Implements RTT::base::InputPortInterface.

Definition at line 184 of file install/include/rtt/InputPort.hpp.

template<typename T>
virtual const types::TypeInfo* RTT::InputPort< T >::getTypeInfo (  )  const [inline, virtual]

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

Implements RTT::base::PortInterface.

Definition at line 163 of file rtt/InputPort.hpp.

template<typename T>
virtual const types::TypeInfo* RTT::InputPort< T >::getTypeInfo (  )  const [inline, virtual]

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

Implements RTT::base::PortInterface.

Definition at line 163 of file install/include/rtt/InputPort.hpp.

template<typename T>
InputPort& RTT::InputPort< T >::operator= ( InputPort< T > const &  orig  )  [private]
template<typename T>
InputPort& RTT::InputPort< T >::operator= ( InputPort< T > const &  orig  )  [private]
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 137 of file rtt/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 123 of file rtt/InputPort.hpp.

template<typename T>
FlowStatus RTT::InputPort< T >::read ( base::DataSourceBase::shared_ptr  source,
bool  copy_old_data 
) [inline, virtual]

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 92 of file rtt/InputPort.hpp.

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 89 of file rtt/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 137 of file install/include/rtt/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 123 of file install/include/rtt/InputPort.hpp.

template<typename T>
FlowStatus RTT::InputPort< T >::read ( base::DataSourceBase::shared_ptr  source,
bool  copy_old_data 
) [inline, virtual]

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 92 of file install/include/rtt/InputPort.hpp.

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 89 of file install/include/rtt/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::NewSample if at least one new sample was available, and either RTT::OldSample or RTT::NoSample otherwise.

Definition at line 152 of file rtt/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::NewSample if at least one new sample was available, and either RTT::OldSample or RTT::NoSample otherwise.

Definition at line 110 of file rtt/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::NewSample if at least one new sample was available, and either RTT::OldSample or RTT::NoSample otherwise.

Definition at line 152 of file install/include/rtt/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::NewSample if at least one new sample was available, and either RTT::OldSample or RTT::NoSample otherwise.

Definition at line 110 of file install/include/rtt/InputPort.hpp.


Friends And Related Function Documentation

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

Definition at line 50 of file install/include/rtt/InputPort.hpp.


Member Data Documentation

template<typename T>
internal::InputPortSource< T >::shared_ptr RTT::InputPort< T >::data_source [private]

Definition at line 51 of file install/include/rtt/InputPort.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:49:47 2013