Public Types | Public Member Functions | Private Attributes | List of all members
RTT::internal::InputPortSource< T > Class Template Reference

#include <InputPortSource.hpp>

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

Public Types

typedef boost::intrusive_ptr< InputPortSource< T > > shared_ptr
 
- Public Types inherited from RTT::internal::AssignableDataSource< T >
typedef boost::intrusive_ptr< const AssignableDataSource< T > > const_ptr
 
typedef DataSource< T >::const_reference_t const_reference_t
 
typedef boost::call_traits< value_t >::param_type param_t
 
typedef boost::call_traits< value_t >::reference reference_t
 
typedef boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
 
typedef DataSource< T >::value_t value_t
 
- Public Types inherited from RTT::internal::DataSource< T >
typedef boost::intrusive_ptr< const DataSource< T > > const_ptr
 
typedef details::GetConstRef< T >::type const_reference_t
 
typedef T result_t
 
typedef boost::intrusive_ptr< DataSource< T > > shared_ptr
 
typedef T value_t
 
- Public Types inherited from RTT::base::DataSourceBase
typedef boost::intrusive_ptr< const DataSourceBaseconst_ptr
 
typedef boost::intrusive_ptr< DataSourceBaseshared_ptr
 

Public Member Functions

AssignableDataSource< T > * clone () const
 
AssignableDataSource< T > * copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
 
bool evaluate () const
 
DataSource< T >::result_t get () const
 
 InputPortSource (InputPort< T > &port)
 
void reset ()
 
DataSource< T >::const_reference_t rvalue () const
 
virtual void set (typename AssignableDataSource< T >::param_t t)
 
virtual AssignableDataSource< T >::reference_t set ()
 
DataSource< T >::result_t value () const
 
- Public Member Functions inherited from RTT::internal::AssignableDataSource< T >
void * getRawPointer ()
 
virtual bool isAssignable () const
 
virtual void set (param_t t)=0
 
virtual bool update (base::DataSourceBase *other)
 
virtual base::ActionInterfaceupdateAction (base::DataSourceBase *other)
 
- Public Member Functions inherited from RTT::internal::DataSource< T >
 BOOST_STATIC_ASSERT (!details::HasConst< T >::value)
 
void const * getRawConstPointer ()
 
virtual std::string getType () const
 
virtual const types::TypeInfogetTypeInfo () const
 
virtual std::string getTypeName () const
 
- Public Member Functions inherited from RTT::base::DataSourceBase
virtual DataSourceBasecopy (std::map< const DataSourceBase *, DataSourceBase * > &alreadyCloned) const =0
 
 DataSourceBase ()
 
void deref () const
 
virtual shared_ptr getMember (const std::string &member_name)
 
virtual shared_ptr getMember (DataSourceBase::shared_ptr member_id, DataSourceBase::shared_ptr offset)
 
virtual std::vector< std::string > getMemberNames () const
 
virtual shared_ptr getParent ()
 
void ref () const
 
std::string toString ()
 
virtual void updated ()
 
std::ostream & write (std::ostream &os)
 

Private Attributes

mvalue
 
InputPort< T > * port
 

Additional Inherited Members

- Static Public Member Functions inherited from RTT::internal::AssignableDataSource< T >
static AssignableDataSource< T > * narrow (base::DataSourceBase *db)
 
- Static Public Member Functions inherited from RTT::internal::DataSource< T >
static std::string GetType ()
 
static const types::TypeInfoGetTypeInfo ()
 
static std::string GetTypeName ()
 
static DataSource< T > * narrow (base::DataSourceBase *db)
 
- Static Public Member Functions inherited from RTT::base::DataSourceBase
static const_ptr stack_const_ptr (const DataSourceBase *dsb)
 
static shared_ptr stack_shared_ptr (DataSourceBase *dsb)
 
- Protected Member Functions inherited from RTT::internal::AssignableDataSource< T >
 ~AssignableDataSource ()
 
- Protected Member Functions inherited from RTT::internal::DataSource< T >
virtual ~DataSource ()
 
- Protected Member Functions inherited from RTT::base::DataSourceBase
virtual ~DataSourceBase ()
 
- Protected Attributes inherited from RTT::base::DataSourceBase
os::AtomicInt refcount
 

Detailed Description

template<typename T>
class RTT::internal::InputPortSource< T >

This class represents a read port using the data source interface. Beware that, depending on the connection used, ports actually change their state when read. For instance, a buffer connection will lose one element when get() or evaluate() are called. For that reason, it is considered bad practice to use a data source on a read port that is bound to a buffer connection.

This class should not be used directly in normal code. What you would usually do is create a new read port using OutputPort::antiClone() and call base::InputPortInterface::getDataSource() to get the corresponding data source. This is your duty to destroy the port when it is not needed anymore.

Note
Although this DataSource is assignable, writing to it is not causing any change in the port. You should not use the set() functions of this object. We provide this interface in order to allow other code to take a non-const reference to the read data.

Definition at line 67 of file InputPortSource.hpp.

Member Typedef Documentation

template<typename T>
typedef boost::intrusive_ptr<InputPortSource<T> > RTT::internal::InputPortSource< T >::shared_ptr

Definition at line 73 of file InputPortSource.hpp.

Constructor & Destructor Documentation

template<typename T>
RTT::internal::InputPortSource< T >::InputPortSource ( InputPort< T > &  port)
inline

Definition at line 75 of file InputPortSource.hpp.

Member Function Documentation

template<typename T>
AssignableDataSource<T>* RTT::internal::InputPortSource< T >::clone ( ) const
inlinevirtual

Return a shallow clone of this DataSource. This method returns a duplicate of this instance which re-uses the DataSources this internal::DataSource holds reference to. The clone() function is thus a non-deep copy.

Implements RTT::internal::AssignableDataSource< T >.

Definition at line 105 of file InputPortSource.hpp.

template<typename T>
AssignableDataSource<T>* RTT::internal::InputPortSource< T >::copy ( std::map< const base::DataSourceBase *, base::DataSourceBase * > &  alreadyCloned) const
inlinevirtual

Implements RTT::internal::AssignableDataSource< T >.

Definition at line 107 of file InputPortSource.hpp.

template<typename T>
bool RTT::internal::InputPortSource< T >::evaluate ( ) const
inlinevirtual

Force an evaluation of the DataSourceBase.

Returns
true on successful evaluation.

Reimplemented from RTT::internal::DataSource< T >.

Definition at line 81 of file InputPortSource.hpp.

template<typename T>
DataSource<T>::result_t RTT::internal::InputPortSource< T >::get ( ) const
inlinevirtual

Return the data as type T.

Implements RTT::internal::DataSource< T >.

Definition at line 90 of file InputPortSource.hpp.

template<typename T>
void RTT::internal::InputPortSource< T >::reset ( )
inlinevirtual

Reset the data to initial values.

Reimplemented from RTT::base::DataSourceBase.

Definition at line 80 of file InputPortSource.hpp.

template<typename T>
DataSource<T>::const_reference_t RTT::internal::InputPortSource< T >::rvalue ( ) const
inlinevirtual

Get a const reference to the value of this DataSource. You must call evaluate() prior to calling this function in order to get the most recent value of this attribute.

Note
Getting a reference to an internal data structure is not thread-safe.

Implements RTT::internal::DataSource< T >.

Definition at line 88 of file InputPortSource.hpp.

template<typename T>
virtual void RTT::internal::InputPortSource< T >::set ( typename AssignableDataSource< T >::param_t  t)
inlinevirtual

Definition at line 97 of file InputPortSource.hpp.

template<typename T>
virtual AssignableDataSource<T>::reference_t RTT::internal::InputPortSource< T >::set ( )
inlinevirtual

Get a reference to the value of this DataSource. Getting a reference to an internal data structure is not thread-safe.

Implements RTT::internal::AssignableDataSource< T >.

Definition at line 101 of file InputPortSource.hpp.

template<typename T>
DataSource<T>::result_t RTT::internal::InputPortSource< T >::value ( ) const
inlinevirtual

Return the result of the last evaluate() function. You must call evaluate() prior to calling this function in order to get the most recent value of this attribute.

Implements RTT::internal::DataSource< T >.

Definition at line 86 of file InputPortSource.hpp.

Member Data Documentation

template<typename T>
T RTT::internal::InputPortSource< T >::mvalue
mutableprivate

Definition at line 70 of file InputPortSource.hpp.

template<typename T>
InputPort<T>* RTT::internal::InputPortSource< T >::port
private

Definition at line 69 of file InputPortSource.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:44