Public Member Functions | Public Attributes | List of all members
RTT::FakeDigitalDevice Class Reference

#include <FakeDigitalDevice.hpp>

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

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 Member Functions inherited from RTT::dev::DigitalInInterface
 DigitalInInterface (const std::string &name)
 
 DigitalInInterface ()
 
virtual ~DigitalInInterface ()
 
- Public Member Functions inherited from RTT::dev::DigitalOutInterface
 DigitalOutInterface (const std::string &name)
 
 DigitalOutInterface ()
 
virtual ~DigitalOutInterface ()
 

Public Attributes

std::vector< bool > mchannels
 

Additional Inherited Members

- Static Public Attributes inherited from RTT::dev::DigitalInInterface
static NameServer< DigitalInInterface * > nameserver
 
- Static Public Attributes inherited from RTT::dev::DigitalOutInterface
static NameServer< DigitalOutInterface * > nameserver
 

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
inlinevirtual

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
inlinevirtual

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
inlinevirtual

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
inlinevirtual

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
inlinevirtual

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
inlinevirtual

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
inlinevirtual

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
inlinevirtual

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 
)
inlinevirtual

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 
)
inlinevirtual

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)
inlinevirtual

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)
inlinevirtual

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

std::vector<bool> RTT::FakeDigitalDevice::mchannels

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 Fri Oct 25 2019 03:59:46