Orocos Real-Time Toolkit  2.9.0
Public Member Functions | Static Public Attributes | List of all members
RTT::dev::EncoderInterface Class Referenceabstract

The most generic interface to a position/turn counter, for encoding positions. More...

#include <rtt/extras/dev/EncoderInterface.hpp>

Inheritance diagram for RTT::dev::EncoderInterface:
RTT::dev::NameServerRegistrator< EncoderInterface * >

Public Member Functions

 EncoderInterface (const std::string &name)
 Create a EncoderInterface with a name. More...
 
 EncoderInterface ()
 Create a not nameserverd EncoderInterface instance. More...
 
virtual ~EncoderInterface ()
 
virtual int positionGet () const =0
 Get the position within the current turn. More...
 
virtual int turnGet () const =0
 Get the current turn. More...
 
virtual void positionSet (int p)=0
 Set the position within the current turn. More...
 
virtual void turnSet (int t)=0
 Set the current turn. More...
 
virtual int resolution () const =0
 Return the position resolution. More...
 
virtual bool upcounting () const =0
 Returns true if after a positive turn increment, position increments positively. More...
 

Static Public Attributes

static NameServer< EncoderInterface * > nameserver
 The NameServer of this interface. More...
 

Detailed Description

The most generic interface to a position/turn counter, for encoding positions.

Within one turn, there are resolution() position increments. After a turn-increment, the position will be exactly zero or resolution(). An upcounting() == true encoder will count from zero to resolution() between two turn increments. An upcounting() == false encoder will count from resolution() to zero between two turn increments.

Definition at line 65 of file EncoderInterface.hpp.

Constructor & Destructor Documentation

RTT::dev::EncoderInterface::EncoderInterface ( const std::string &  name)
inline

Create a EncoderInterface with a name.

When name is not "", and unique, it can be retrieved through EncoderInterface::nameserver .

Definition at line 75 of file EncoderInterface.hpp.

RTT::dev::EncoderInterface::EncoderInterface ( )
inline

Create a not nameserverd EncoderInterface instance.

Definition at line 82 of file EncoderInterface.hpp.

virtual RTT::dev::EncoderInterface::~EncoderInterface ( )
inlinevirtual

Definition at line 91 of file EncoderInterface.hpp.

Member Function Documentation

virtual int RTT::dev::EncoderInterface::positionGet ( ) const
pure virtual

Get the position within the current turn.

virtual void RTT::dev::EncoderInterface::positionSet ( int  p)
pure virtual

Set the position within the current turn.

virtual int RTT::dev::EncoderInterface::resolution ( ) const
pure virtual

Return the position resolution.

This number can be negative or positive and denotes the the maximal or minimal value positionGet().

virtual int RTT::dev::EncoderInterface::turnGet ( ) const
pure virtual

Get the current turn.

virtual void RTT::dev::EncoderInterface::turnSet ( int  t)
pure virtual

Set the current turn.

virtual bool RTT::dev::EncoderInterface::upcounting ( ) const
pure virtual

Returns true if after a positive turn increment, position increments positively.

Meaning from 0 to |resolution()| or from resolution() to zero if resolution() < 0

Member Data Documentation

NameServer< EncoderInterface * > RTT::EncoderInterface::nameserver
static

The NameServer of this interface.

See also
NameServer

Definition at line 89 of file EncoderInterface.hpp.


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