SystemTaskList Class Reference

#include <SystemTaskList.h>

Collaboration diagram for SystemTaskList:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements a static container that essentially collects SystemTasks so that the main loop can invoke each task in a round robin fashion.

System level tasks can be added in the board support package, and should not be added anywhere else.

The SystemTaskList is a singleton pattern object, since only one can exist in the system at any time.


Public Types

enum  Status {
  OK,
  TOO_MANY_TASKS,
  FAILED
}
 An enumeration defining the results of methods included in the SystemTaskList class. More...

Public Member Functions

Status registerTask (SystemTask &task)
 Register a system task with the master list of tasks.
Status getNextTask (SystemTask **task)
 Returns the next task in the list.

Static Public Member Functions

static SystemTaskListgetInstance ()
 A static method to get the one and only instance of the SystemTaskList.

Private Member Functions

 SystemTaskList ()
 Constructor.

Private Attributes

SystemTasktaskList [Constants::TOTAL_TASKS]
int taskCount
int loopPointer


Member Enumeration Documentation

enum SystemTaskList::Status
 

An enumeration defining the results of methods included in the SystemTaskList class.

Enumerator:
OK  Success.
TOO_MANY_TASKS  Too many tasks, consider updating the TOTAL_TASKS in Constants.
FAILED  Generic Failure.


Constructor & Destructor Documentation

SystemTaskList::SystemTaskList  )  [private]
 

Constructor.


Member Function Documentation

SystemTaskList & SystemTaskList::getInstance  )  [static]
 

A static method to get the one and only instance of the SystemTaskList.

Returns:
SystemTaskList&

SystemTaskList::Status SystemTaskList::getNextTask SystemTask **  task  ) 
 

Returns the next task in the list.

Will automatically roll the pointer over when reaching the end of the list. Essentially this function can be called repeatedly.

Parameters:
task A pointer to a task reference.
Return values:
OK upon success
FAILED when no tasks are registered
Returns:
Status

SystemTaskList::Status SystemTaskList::registerTask SystemTask task  ) 
 

Register a system task with the master list of tasks.

Once a task is registered it will be executed round-robin within the main loop. If you are instead looking to register a feature you may want to look at the FeaturesList class instead.

Parameters:
task The reference of an instance that should be included in the task list.
Returns:
A status code indicating the outcome.
Return values:
OK successfully registered.
TOO_MANY_TASKS there aren't any remaining slots to add the task to.


Member Data Documentation

int SystemTaskList::loopPointer [private]
 

int SystemTaskList::taskCount [private]
 

SystemTask* SystemTaskList::taskList[Constants::TOTAL_TASKS] [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Sep 19 14:04:54 2006 for MegaPlusPlus by  doxygen 1.4.6