My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::SpawnableTask< Msg > Class Template Reference

#include <SpawnableTask.h>

Inheritance diagram for gcp::util::SpawnableTask< Msg >:
gcp::util::GenericTask< Msg > gcp::util::RunnableTask gcp::util::Runnable

Public Member Functions

 SpawnableTask (bool spawn)
 
virtual ~SpawnableTask ()
 
- Public Member Functions inherited from gcp::util::GenericTask< Msg >
void sendRestartMsg ()
 
void sendStopMsg ()
 
void sendHeartBeatMsg ()
 
virtual void fwdTaskMsg (Msg *msg)
 
- Public Member Functions inherited from gcp::util::RunnableTask
 RunnableTask (bool spawnThread)
 
virtual ~RunnableTask ()
 
- Public Member Functions inherited from gcp::util::Runnable
 Runnable (bool spawnThread, RUN_FN(*runFn))
 
 Runnable (bool spawnThread, RUN_FN(*runFn), int priority)
 
virtual ~Runnable ()
 
void blockForever ()
 
void spawn ()
 

Protected Member Functions

virtual void processMsg (Msg *msg)
 
void run ()
 
- Protected Member Functions inherited from gcp::util::GenericTask< Msg >
 GenericTask ()
 
 GenericTask (Thread *thread)
 
virtual ~GenericTask ()
 
void sendTaskMsg (Msg *msg)
 
void startThreads (void *arg)
 
void startThread (void *arg, unsigned order)
 
unsigned getMinStartOrder ()
 
bool threadsNeedStarting ()
 
void cancelThreads ()
 
void cancelThread (unsigned order)
 
unsigned getMinCancelOrder ()
 
bool threadsNeedCancelling ()
 
void pingThreads (void *arg)
 
void raise (std::string name, int sigNo)
 
ThreadgetThread (std::string name)
 
bool threadsAreRunning ()
 
void shutdownConnection (int fd)
 
virtual void serviceMsgQ (void)
 
virtual void restart (void)
 
virtual void processTaskMsg (bool *stop)
 
virtual void respondToHeartBeat ()
 
virtual void installTimer (Msg *msg)
 
virtual void installSignal (Msg *msg)
 
virtual void enableTimer (Msg *msg)
 
virtual void addHandler (Msg *msg)
 
void stepCommands ()
 
- Protected Member Functions inherited from gcp::util::Runnable
virtual void broadcastReady ()
 
void spawn (void *arg)
 

Additional Inherited Members

- Static Public Member Functions inherited from gcp::util::RunnableTask
static RUN_FN (runFn)
 
- Static Public Member Functions inherited from gcp::util::Runnable
static THREAD_START (startUp)
 
- Protected Attributes inherited from gcp::util::GenericTask< Msg >
Threadthread_
 
std::vector< Thread * > threads_
 
PipeQ< Msg > msgq_
 
gcp::util::FdSet fdSet_
 
std::vector< Command * > commands_
 
struct timeval * timeOut_
 
TimeVal commandTimeOut_
 
- Protected Attributes inherited from gcp::util::Runnable
ThreadspawnedThread_
 
bool spawned_
 
RUN_FN * runFn_
 

Detailed Description

template<class Msg>
class gcp::util::SpawnableTask< Msg >

....................................................................... Define a template class for an object which can run in its own thread. This inherits the message queue mechanism from GenericTask for communciation with this thread, and spawnable capabilities from Runnable

Constructor & Destructor Documentation

template<class Msg>
gcp::util::SpawnableTask< Msg >::SpawnableTask ( bool  spawn)
inline

Constructor. If spawn==true, then a call to spawn() will start this thread

template<class Msg>
virtual gcp::util::SpawnableTask< Msg >::~SpawnableTask ( )
inlinevirtual

Destructor.

Member Function Documentation

template<class Msg>
virtual void gcp::util::SpawnableTask< Msg >::processMsg ( Msg *  msg)
inlineprotectedvirtual

This method should be defined by each inheriting task to process its own task-specific messages.

Exceptions
ExceptionMethod to process a message received on the Task message * queue

Reimplemented from gcp::util::GenericTask< Msg >.

Reimplemented in gcp::util::GpibUsbController, gcp::util::DliPowerStripController, and TestClass.

template<class Msg>
void gcp::util::SpawnableTask< Msg >::run ( void  )
inlineprotectedvirtual

Force inheritors to define a run method.

Run method defaults to calling the serviceMsgQ() method below.

Reimplemented from gcp::util::GenericTask< Msg >.


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