INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

gbxsickacfr::gbxiceutilacfr::SubsystemThread Class Reference

A version of the Thread class which catches all possible exceptions and integrates some Status operations. More...

#include <subsystemthread.h>

Inherits gbxsickacfr::gbxiceutilacfr::Thread.

Inherited by gbxsickacfr::gbxserialdeviceacfr::SerialDeviceHandler, TestThread, TestThreadWithThrow, and TestThreadWithTools.

Inheritance diagram for gbxsickacfr::gbxiceutilacfr::SubsystemThread:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 SubsystemThread (gbxutilacfr::Tracer &tracer, gbxutilacfr::Status &status, const std::string &subsysName="SubsystemThread")
virtual void run ()
virtual void walk ()=0
gbxutilacfr::SubStatussubStatus ()
 Access to subsystem status.
std::string subsysName () const
 Returns subsystem name assigned to this thread.

Detailed Description

A version of the Thread class which catches all possible exceptions and integrates some Status operations.

If a stray exception is caught, an error message will be printed (using cout), then we will wait for someone to call stop().

To use this class, simply implement the pure virtual walk() function.

void MyThread::walk()
{
    // initialize

    // main loop
    while ( !isStopping() )
    {
        // do something
    }

    // clean up
}

See also:
Thread, SafeThread.


Constructor & Destructor Documentation

SubsystemThread::SubsystemThread ( gbxutilacfr::Tracer &  tracer,
gbxutilacfr::Status &  status,
const std::string &  subsysName = "SubsystemThread" 
)

Supply an optional Tracer and Status. The optional subsysName is used in reporting status changes as the subsystem name.


Member Function Documentation

void SubsystemThread::run (  )  [virtual]

This implementation calls walk(), catches all possible exceptions, prints out errors and waits for someone to call stop().

virtual void gbxsickacfr::gbxiceutilacfr::SubsystemThread::walk (  )  [pure virtual]

Implement this function in the derived class and put here all the stuff which your thread needs to do.

Implemented in gbxsickacfr::gbxserialdeviceacfr::SerialDeviceHandler.


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

Generated for GearBox by  doxygen 1.4.5