PikeAero::CTaskConsoleBase Class Reference

The console base object. More...

#include <ctaskconsolebase.h>

Inheritance diagram for PikeAero::CTaskConsoleBase:

Inheritance graph
[legend]
Collaboration diagram for PikeAero::CTaskConsoleBase:

Collaboration graph
[legend]

Public Member Functions

CTaskAggregatoraggregator ()
 CTaskConsoleBase (CCommunication *comm)
virtual void event (CEvent *e)
virtual CMachine::bit32 fault ()
 The CTaskScheduler will call the fault() method when a fault code was returned by any of the task's other methods.
virtual CMachine::bit32 init ()
 called exactly once. perform task initialization such as initializing private variable. other tasks are not guaranteed so do not interract with other tasks at this stage.
virtual const char * name ()
virtual CMachine::bit32 run ()
 called periodically by CTaskScheduler to do a piece of work.
virtual CMachine::bit32 start ()
 called exactly once. all tasks are initialized at this point. called just prior to first call to run()
virtual CMachine::bit32 stop ()
 The CTaskScheduler will call the stop () method after the task was scheduled for cancelation.
virtual ~CTaskConsoleBase ()

Protected Types


Protected Member Functions

CMachine::bit32 execute (CString *command)
virtual void monitor ()

Protected Attributes

CTaskAggregatormAggregator
CString mCommandLine
bool mFirstTime
MonitorMode mMonitorMode
bool mRunMonitor

Detailed Description

The console base object.

Author:
Michael Sharkey <mike@pikeaero.com>

Definition at line 34 of file ctaskconsolebase.h.


Member Enumeration Documentation

Enumerator:
monitorNone 
monitorAnalog 
monitorStats 
monitorTasks 

Definition at line 82 of file ctaskconsolebase.h.

00082                      {
00083             monitorNone=0,
00084             monitorAnalog,
00085             monitorStats,
00086             monitorTasks,
00087         } MonitorMode;


Constructor & Destructor Documentation

PikeAero::CTaskConsoleBase::CTaskConsoleBase ( CCommunication comm  ) 

Definition at line 28 of file ctaskconsolebase.cpp.

00029  : inherited(comm)
00030 , mMonitorMode(monitorNone)
00031 , mRunMonitor(false)
00032 , mFirstTime(true)
00033 , mAggregator(NULL)
00034 {
00035 }

PikeAero::CTaskConsoleBase::~CTaskConsoleBase (  )  [virtual]

Definition at line 38 of file ctaskconsolebase.cpp.

00039 {
00040 }


Member Function Documentation

CTaskAggregator* PikeAero::CTaskConsoleBase::aggregator (  )  [inline]

Returns:
A pointer to the aggregator task.

Definition at line 74 of file ctaskconsolebase.h.

References mAggregator.

Referenced by PikeAero::CTaskConsolePacket::monitor(), and PikeAero::CTaskConsolePacket::start().

00074 {return mAggregator;}

Here is the caller graph for this function:

virtual void PikeAero::CTaskConsoleBase::event ( CEvent e  )  [inline, virtual]

Returns:
Receive a software event

Reimplemented from PikeAero::CObject.

Reimplemented in PikeAero::CTaskConsole, and PikeAero::CTaskConsolePacket.

Definition at line 70 of file ctaskconsolebase.h.

00070 {}

CMachine::bit32 PikeAero::CTaskConsoleBase::execute ( CString command  )  [inline, protected]

Reimplemented in PikeAero::CTaskConsole, and PikeAero::CTaskConsolePacket.

Definition at line 79 of file ctaskconsolebase.h.

00079 {return 0;}

virtual CMachine::bit32 PikeAero::CTaskConsoleBase::fault (  )  [inline, virtual]

The CTaskScheduler will call the fault() method when a fault code was returned by any of the task's other methods.

Returns:
0 on success.

Reimplemented from PikeAero::CTaskTerminal.

Reimplemented in PikeAero::CTaskConsole, and PikeAero::CTaskConsolePacket.

Definition at line 66 of file ctaskconsolebase.h.

00066 {return 0;}

virtual CMachine::bit32 PikeAero::CTaskConsoleBase::init (  )  [inline, virtual]

called exactly once. perform task initialization such as initializing private variable. other tasks are not guaranteed so do not interract with other tasks at this stage.

Returns:
0 on success.

Reimplemented from PikeAero::CTaskTerminal.

Reimplemented in PikeAero::CTaskConsole, and PikeAero::CTaskConsolePacket.

Definition at line 46 of file ctaskconsolebase.h.

00046 {return 0;}

virtual void PikeAero::CTaskConsoleBase::monitor (  )  [inline, protected, virtual]

Reimplemented in PikeAero::CTaskConsole, and PikeAero::CTaskConsolePacket.

Definition at line 80 of file ctaskconsolebase.h.

00080 {}

virtual const char* PikeAero::CTaskConsoleBase::name (  )  [inline, virtual]

Returns:
a CString containing an human readable name for the task

Reimplemented from PikeAero::ITask.

Reimplemented in PikeAero::CTaskConsole, and PikeAero::CTaskConsolePacket.

Definition at line 41 of file ctaskconsolebase.h.

00041 {return "CTaskConsoleBase";}

virtual CMachine::bit32 PikeAero::CTaskConsoleBase::run (  )  [inline, virtual]

called periodically by CTaskScheduler to do a piece of work.

Returns:
0 on success.

Reimplemented from PikeAero::CTaskTerminal.

Reimplemented in PikeAero::CTaskConsole, and PikeAero::CTaskConsolePacket.

Definition at line 61 of file ctaskconsolebase.h.

00061 {return 0;}

CMachine::bit32 PikeAero::CTaskConsoleBase::start (  )  [virtual]

called exactly once. all tasks are initialized at this point. called just prior to first call to run()

Returns:
0 on success.

Reimplemented from PikeAero::CTaskTerminal.

Reimplemented in PikeAero::CTaskConsole, and PikeAero::CTaskConsolePacket.

Definition at line 47 of file ctaskconsolebase.cpp.

References PikeAero::CEvent::Clock, PikeAero::CMachine::FaultNULLPtr, PikeAero::CTaskScheduler::find(), PikeAero::CEventQueue::installListener(), mAggregator, and PikeAero::ITask::setFault().

00048 {
00049     mAggregator = (CTaskAggregator*)CTaskScheduler::find("CTaskAggregator");
00050     if ( mAggregator == NULL )
00051     {
00052         setFault(CMachine::FaultNULLPtr);
00053     }
00054     CEventQueue::installListener(this,CEvent::Clock);
00055     return inherited::start();
00056 }

Here is the call graph for this function:

CMachine::bit32 PikeAero::CTaskConsoleBase::stop (  )  [virtual]

The CTaskScheduler will call the stop () method after the task was scheduled for cancelation.

Returns:
0 on success.

Reimplemented from PikeAero::CTaskTerminal.

Reimplemented in PikeAero::CTaskConsole, and PikeAero::CTaskConsolePacket.

Definition at line 62 of file ctaskconsolebase.cpp.

References PikeAero::CEvent::Clock, and PikeAero::CEventQueue::removeListener().

00063 {
00064     CEventQueue::removeListener(this,CEvent::Clock);
00065     return inherited::stop();
00066 }

Here is the call graph for this function:


Field Documentation

Definition at line 93 of file ctaskconsolebase.h.

Referenced by PikeAero::CTaskConsole::run().


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

Generated on Sun Oct 25 14:00:24 2009 for stingray3 by  doxygen 1.5.8