LRT14
1.0
|
Base class for components. More...
#include <Component.h>
Public Member Functions | |
Component (const char *name, int driverStationDigitalIn) | |
Constructs a component with a name. | |
virtual | ~Component () |
Frees the resources allocated by the component. | |
void | Update () |
Updates the component each cycle. | |
bool | EnableRequired () |
Returns whether or not the robot requires to be in an enabled state to run the enabled function. | |
int | GetDigitalIn () |
Gets the driver station digital input channel for the component. | |
const char * | GetName () |
Gets the component's name. | |
Static Public Member Functions | |
static void | CreateComponents () |
Creates all components. | |
static void | DestroyComponents () |
Destroys all components. | |
static void | UpdateAll () |
Calls Update() on all created components. | |
Protected Member Functions | |
virtual void | UpdateEnabled ()=0 |
Allows the component to update itself when enabled. | |
virtual void | UpdateDisabled ()=0 |
Allows the component to execute code when disabled. | |
virtual void | OnEnabled ()=0 |
Called the first cycle that the component is enabled. | |
virtual void | OnDisabled ()=0 |
Called the first cycle that the component is disabled. | |
Base class for components.
bool Component::EnableRequired | ( | ) |
Returns whether or not the robot requires to be in an enabled state to run the enabled function.
int Component::GetDigitalIn | ( | ) |
Gets the driver station digital input channel for the component.
const char * Component::GetName | ( | ) |
Gets the component's name.