RoboidControl
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Attributes | Static Protected Attributes | List of all members
Passer::RoboidControl::Thing Class Reference

A thing is a functional component on a robot. More...

#include <Thing.h>

Inheritance diagram for Passer::RoboidControl::Thing:
Passer::RoboidControl::Motor Passer::RoboidControl::Sensor Passer::RoboidControl::ControlledMotor Passer::RoboidControl::SynchronizedMotors Passer::RoboidControl::Accelerometer Passer::RoboidControl::DistanceSensor Passer::RoboidControl::NetworkPerception Passer::RoboidControl::Switch

Public Member Functions

 Thing ()
 Default constructor for a Thing.
 
bool IsMotor ()
 Check if the Thing is a Motor.
 
bool IsSensor ()
 Check if the Thing is a Sensor.
 
void SetParent (Thing *parent)
 
ThingGetParent ()
 
void AddChild (Thing *child)
 
ThingGetChild (unsigned char childIx)
 

Public Attributes

unsigned int type
 The type of Thing.
 
Polar position
 

Static Public Attributes

static const unsigned int SwitchType = SensorType | (unsigned int)Type::Switch
 The type of a switch sensor.
 
static const unsigned int DistanceSensorType
 The type of a distance sensor.
 
static const unsigned int ControlledMotorType
 The type of a controlled motor.
 
static const unsigned int UncontrolledMotorType
 The type of an uncontrolled motor.
 
static const unsigned int ServoType = (unsigned int)Type::Servo
 The type of an object received from the network.
 
static const unsigned int ExternalType = (unsigned int)Type::ExternalSensor
 

Protected Types

enum class  Type {
  Undetermined , Switch , DistanceSensor , ControlledMotor ,
  UncontrolledMotor , Servo , ExternalSensor
}
 Basic Thing types. More...
 

Protected Attributes

Thingparent = nullptr
 
unsigned char childCount = 0
 
Thing ** children = nullptr
 

Static Protected Attributes

static const unsigned int MotorType = 0x8000
 Bitmask for Motor type.
 
static const unsigned int SensorType = 0x4000
 Bitmap for Sensor type.
 

Detailed Description

A thing is a functional component on a robot.

Member Enumeration Documentation

◆ Type

enum class Passer::RoboidControl::Thing::Type
strongprotected

Basic Thing types.

Enumerator
Undetermined 
Switch 
DistanceSensor 
ControlledMotor 
UncontrolledMotor 
Servo 
ExternalSensor 

Constructor & Destructor Documentation

◆ Thing()

Thing::Thing ( )

Default constructor for a Thing.

Member Function Documentation

◆ IsMotor()

bool Thing::IsMotor ( )

Check if the Thing is a Motor.

Returns
True when the Thing is a Motor and False otherwise

◆ IsSensor()

bool Thing::IsSensor ( )

Check if the Thing is a Sensor.

Returns
True when the Thing is a Sensor and False otherwise

◆ SetParent()

void Thing::SetParent ( Thing parent)

◆ GetParent()

Thing * Thing::GetParent ( )

◆ AddChild()

void Thing::AddChild ( Thing child)

◆ GetChild()

Thing * Thing::GetChild ( unsigned char  childIx)

Member Data Documentation

◆ type

unsigned int Passer::RoboidControl::Thing::type

The type of Thing.

◆ SwitchType

const unsigned int Thing::SwitchType = SensorType | (unsigned int)Type::Switch
static

The type of a switch sensor.

◆ DistanceSensorType

const unsigned int Thing::DistanceSensorType
static
Initial value:
=
static const unsigned int SensorType
Bitmap for Sensor type.
Definition Thing.h:48

The type of a distance sensor.

◆ ControlledMotorType

const unsigned int Thing::ControlledMotorType
static
Initial value:
=
static const unsigned int MotorType
Bitmask for Motor type.
Definition Thing.h:46

The type of a controlled motor.

◆ UncontrolledMotorType

const unsigned int Thing::UncontrolledMotorType
static
Initial value:

The type of an uncontrolled motor.

◆ ServoType

const unsigned int Thing::ServoType = (unsigned int)Type::Servo
static

The type of an object received from the network.

◆ ExternalType

const unsigned int Thing::ExternalType = (unsigned int)Type::ExternalSensor
static

◆ position

Polar Passer::RoboidControl::Thing::position

◆ MotorType

const unsigned int Passer::RoboidControl::Thing::MotorType = 0x8000
staticprotected

Bitmask for Motor type.

◆ SensorType

const unsigned int Passer::RoboidControl::Thing::SensorType = 0x4000
staticprotected

Bitmap for Sensor type.

◆ parent

Thing* Passer::RoboidControl::Thing::parent = nullptr
protected

◆ childCount

unsigned char Passer::RoboidControl::Thing::childCount = 0
protected

◆ children

Thing** Passer::RoboidControl::Thing::children = nullptr
protected

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