Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

Monitor::BellMaster::Signalman Class Reference

#include <sgnlman.h>

List of all members.

Public Methods

 Signalman (const string &newName=string(""), const unsigned newBeatInterval=186, const unsigned newSetInterval=750)
virtual ~Signalman ()
Signalman & operator= (const Signalman &other)
int operator== (const Signalman &other) const
int operator< (const Signalman &other) const
void beatSequence (Tapper &tapper, const string &sequence) const
 Beat out the sequence of rings for a bell code. More...

const string & getName () const
unsigned getBeatInterval () const
void setBeatInterval (const unsigned newInterval)
unsigned getSetInterval () const
void setSetInterval (const unsigned newInterval)
int isBusy ()
void listenToBell (Bell &newBell, const Monitor::Utility::CallbackBase &timeoutCallback)
 Start listening to a bell in order to recognise a bell code. More...

const string stopListeningToBell ()
 Determine what the sequence just heard was. More...


Private Methods

void hearBell ()
 Hear a ring of the bell being listened to. More...


Private Attributes

string name
 Name of signalman. More...

unsigned beatInterval
 Time, in milliseconds, between individual beats. More...

unsigned setInterval
 Time, in milliseconds, between sets of beats. More...

Monitor::Utility::TimerringTimer
 Timer to measure interval between bell rings when listening to a bell in order to recognise a bell code. More...

Monitor::Utility::TimeoutringTimeout
 Timeout to stop listening to a bell in order to recognise a bell code. More...

unsigned heardIntervals [65]
 Array of intervals for bell code being listened to. More...


Constructor & Destructor Documentation

Signalman::Signalman const string &    newName = string(""),
const unsigned    newBeatInterval = 186,
const unsigned    newSetInterval = 750
 

Parameters:
newName  Name of signalman.
newBeatInterval  Time, in milliseconds, between beats.
setSetInterval  Time, in milliseconds, between sets of beats.

Definition at line 53 of file sgnlman.cpp.

References _USEMYTRACE_.

Signalman::~Signalman   [virtual]
 

Definition at line 65 of file sgnlman.cpp.

References _USEMYTRACE_, ringTimeout, and ringTimer.


Member Function Documentation

void Signalman::beatSequence Tapper   tapper,
const string &    sequence
const
 

Beat out the sequence of rings for a bell code.

Parameters:
tapper  Tapper with which to beat out sequence.
sequence  Sets of beats constituting bell code to beat out.

Definition at line 109 of file sgnlman.cpp.

References _USEMYTRACE_, beatInterval, and setInterval.

unsigned Signalman::getBeatInterval   const
 

Returns:
Time, in milliseconds, between individual beats.

Definition at line 163 of file sgnlman.cpp.

References _USEMYTRACE_, and beatInterval.

const string& Monitor::BellMaster::Signalman::getName   const [inline]
 

Returns:
Name, as string reference, of signalman.

Definition at line 102 of file sgnlman.h.

References name.

unsigned Signalman::getSetInterval   const
 

Returns:
Time, in milliseconds, between sets of beats.

Definition at line 185 of file sgnlman.cpp.

References _USEMYTRACE_, and setInterval.

void Signalman::hearBell   [private]
 

Hear a ring of the bell being listened to.

Definition at line 246 of file sgnlman.cpp.

References _USEMYTRACE_, heardIntervals, Monitor::Utility::Timeout::reset, Monitor::Utility::Timer::restart, ringTimeout, and ringTimer.

int Signalman::isBusy  
 

Returns:
0 if not busy, otherwise !0;

Definition at line 207 of file sgnlman.cpp.

References _USEMYTRACE_, ringTimeout, and ringTimer.

void Monitor::BellMaster::Signalman::listenToBell Bell   newBell,
const Monitor::Utility::CallbackBase   timeoutCallback
 

Start listening to a bell in order to recognise a bell code.

Parameters:
newBell  Bell to listen to.
timeoutCallback  Callback to invoked on end of sequence.

int Signalman::operator< const Signalman &    other const
 

Returns:
!0 ('true') if name lexically '<' that of other, else 0 ('true').

Definition at line 101 of file sgnlman.cpp.

References name.

Signalman & Signalman::operator= const Signalman &    other
 

Definition at line 79 of file sgnlman.cpp.

References beatInterval, name, and setInterval.

int Signalman::operator== const Signalman &    other const
 

Returns:
!0 ('true') if name matches that of other, else 0 ('true').

Definition at line 91 of file sgnlman.cpp.

References beatInterval, name, and setInterval.

void Signalman::setBeatInterval const unsigned    newInterval
 

Parameters:
newInterval  Time, in milliseconds, between individual beats.

Definition at line 174 of file sgnlman.cpp.

References _USEMYTRACE_, and beatInterval.

void Signalman::setSetInterval const unsigned    newInterval
 

Parameters:
setInterval  Time, in milliseconds, between sets of beats.

Definition at line 196 of file sgnlman.cpp.

References _USEMYTRACE_, and setInterval.

const string Signalman::stopListeningToBell  
 

Determine what the sequence just heard was.

Returns:
Sequence just heard.

Definition at line 270 of file sgnlman.cpp.

References _USEMYTRACE_, heardIntervals, ringTimeout, and ringTimer.


Member Data Documentation

unsigned Monitor::BellMaster::Signalman::beatInterval [private]
 

Time, in milliseconds, between individual beats.

Definition at line 167 of file sgnlman.h.

Referenced by beatSequence, getBeatInterval, operator=, operator==, and setBeatInterval.

unsigned Monitor::BellMaster::Signalman::heardIntervals[65] [private]
 

Array of intervals for bell code being listened to.

Definition at line 188 of file sgnlman.h.

Referenced by hearBell, and stopListeningToBell.

string Monitor::BellMaster::Signalman::name [private]
 

Name of signalman.

Definition at line 162 of file sgnlman.h.

Referenced by getName, operator<, operator=, and operator==.

Monitor::Utility::Timeout* Monitor::BellMaster::Signalman::ringTimeout [private]
 

Timeout to stop listening to a bell in order to recognise a bell code.

Definition at line 183 of file sgnlman.h.

Referenced by hearBell, isBusy, stopListeningToBell, and ~Signalman.

Monitor::Utility::Timer* Monitor::BellMaster::Signalman::ringTimer [private]
 

Timer to measure interval between bell rings when listening to a bell in order to recognise a bell code.

Definition at line 178 of file sgnlman.h.

Referenced by hearBell, isBusy, stopListeningToBell, and ~Signalman.

unsigned Monitor::BellMaster::Signalman::setInterval [private]
 

Time, in milliseconds, between sets of beats.

Definition at line 172 of file sgnlman.h.

Referenced by beatSequence, getSetInterval, operator=, operator==, and setSetInterval.


Generated on Wed Oct 29 20:54:52 2003 for Bellmaster BC Common by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002