Public Member Functions | Public Attributes
RTT::FakeDigitalDevice Class Reference

#include <FakeDigitalDevice.hpp>

Inheritance diagram for RTT::FakeDigitalDevice:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool checkBit (unsigned int n) const
virtual unsigned int checkSequence (unsigned int start_bit, unsigned int stop_bit) const
 FakeDigitalDevice (unsigned int channels=32)
virtual bool isOff (unsigned int bit=0) const
virtual bool isOn (unsigned int bit=0) const
virtual unsigned int nbOfInputs () const
virtual unsigned int nbOfOutputs () const
virtual bool readBit (unsigned int bit=0) const
virtual unsigned int readSequence (unsigned int start_bit, unsigned int stop_bit) const
virtual void setBit (unsigned int bit, bool value)
virtual void setSequence (unsigned int start_bit, unsigned int stop_bit, unsigned int value)
virtual void switchOff (unsigned int n)
virtual void switchOn (unsigned int n)

Public Attributes

std::vector< bool > mchannels

Detailed Description

A Fake (Simulated) Digital Input/Output Device which replicates the inputs on its outputs.

Definition at line 42 of file FakeDigitalDevice.hpp.


Constructor & Destructor Documentation

RTT::FakeDigitalDevice::FakeDigitalDevice ( unsigned int  channels = 32) [inline]

Definition at line 49 of file FakeDigitalDevice.hpp.


Member Function Documentation

virtual bool RTT::FakeDigitalDevice::checkBit ( unsigned int  n) const [inline, virtual]

Returns the status of bit n, starting from zero.

Returns:
true if the bit is 1, false otherwise.

Implements RTT::dev::DigitalOutInterface.

Definition at line 80 of file FakeDigitalDevice.hpp.

virtual unsigned int RTT::FakeDigitalDevice::checkSequence ( unsigned int  start_bit,
unsigned int  stop_bit 
) const [inline, virtual]

Returns the sequence of bits between start_bit and stop_bit inclusive, where start_bit occurs at position zero in the returned result.

Implements RTT::dev::DigitalOutInterface.

Definition at line 88 of file FakeDigitalDevice.hpp.

virtual bool RTT::FakeDigitalDevice::isOff ( unsigned int  bit = 0) const [inline, virtual]

Inspect if a certain bit is on.

Parameters:
bitThe bit to check, starting from zero.
Returns:
true if the bit is low (0), false otherwise.

Implements RTT::dev::DigitalInInterface.

Definition at line 114 of file FakeDigitalDevice.hpp.

virtual bool RTT::FakeDigitalDevice::isOn ( unsigned int  bit = 0) const [inline, virtual]

Inspect if a certain bit is on.

Parameters:
bitThe bit to check, starting from zero.
Returns:
true if the bit is high (1), false otherwise.

Implements RTT::dev::DigitalInInterface.

Definition at line 107 of file FakeDigitalDevice.hpp.

virtual unsigned int RTT::FakeDigitalDevice::nbOfInputs ( ) const [inline, virtual]

Returns the number of bits that can be read for digital input.

Implements RTT::dev::DigitalInInterface.

Definition at line 102 of file FakeDigitalDevice.hpp.

virtual unsigned int RTT::FakeDigitalDevice::nbOfOutputs ( ) const [inline, virtual]

Query the number of outputs of this card

Returns:
the number of digital output channels addressable

Implements RTT::dev::DigitalOutInterface.

Definition at line 97 of file FakeDigitalDevice.hpp.

virtual bool RTT::FakeDigitalDevice::readBit ( unsigned int  bit = 0) const [inline, virtual]

Inspect a bit.

Parameters:
bitThe bit to check, starting from zero.
Returns:
true if the bit is high (1), false otherwise.

Implements RTT::dev::DigitalInInterface.

Definition at line 121 of file FakeDigitalDevice.hpp.

virtual unsigned int RTT::FakeDigitalDevice::readSequence ( unsigned int  start_bit,
unsigned int  stop_bit 
) const [inline, virtual]

Inspect a sequence of bits.

Parameters:
start_bitThe first bit to check.
stop_bitThe last bit (inclusive) to check.
Returns:
a bit pattern denoting the bit status from start_bit to stop_bit where bit zero equals the value of start_bit.

Implements RTT::dev::DigitalInInterface.

Definition at line 128 of file FakeDigitalDevice.hpp.

virtual void RTT::FakeDigitalDevice::setBit ( unsigned int  bit,
bool  value 
) [inline, virtual]

Sets the n'th output to value

Implements RTT::dev::DigitalOutInterface.

Definition at line 67 of file FakeDigitalDevice.hpp.

virtual void RTT::FakeDigitalDevice::setSequence ( unsigned int  start_bit,
unsigned int  stop_bit,
unsigned int  value 
) [inline, virtual]

Sets a sequence of bits to pattern value between start_bit and stop_bit inclusive. For example, setSequence(3, 3, 1) is equivalent to setBit(3, 1).

Implements RTT::dev::DigitalOutInterface.

Definition at line 73 of file FakeDigitalDevice.hpp.

virtual void RTT::FakeDigitalDevice::switchOff ( unsigned int  n) [inline, virtual]

Sets the n'th output off

Parameters:
nThe number of the output to be switched off. The first output is number 0.

Implements RTT::dev::DigitalOutInterface.

Definition at line 61 of file FakeDigitalDevice.hpp.

virtual void RTT::FakeDigitalDevice::switchOn ( unsigned int  n) [inline, virtual]

Sets the n'th output on

Parameters:
nThe number of the output to be switched on. The first output is number 0.

Implements RTT::dev::DigitalOutInterface.

Definition at line 55 of file FakeDigitalDevice.hpp.


Member Data Documentation

Definition at line 47 of file FakeDigitalDevice.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Sat Jun 8 2019 18:46:36