class SerialService

Thread pool service for serial ports. More...

Definition#include <serial.h>
InheritsThread, Mutex [private]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members

Protected Members


Detailed Description

The SerialService is a thead service object that is meant to service attached serial ports. Multiple pool objects may be created and multiple serial ports may be attached to the same thread of of execution. This allows one to balance threads and the serial ports they service.

void OnUpdate (unsigned char flag)
[protected virtual]

A virtual handler for processing user defined update requests (1-254) which have been posted through Update.

Parameters:
flagof update request.

void OnEvent (void)
[protected virtual]

A virtual handler for event loop calls. This can be used to extend event loop processing.

void OnCallback (SerialPort *port)
[protected virtual]

A virtual handler for adding support for additional callback events into SerialPort.

Parameters:
serialport currently being evaluated.

void Update (unsigned char flag = 0xff)

Notify service thread that a port has been added or removed, or a timer changed, so that a new schedule can be computed for expiring attached ports. This can also be used to pass requests to the OnUpdate() event handler.

Parameters:
flagevent for OnUpdate, termination, or reschedule.

SerialService (int pri = 0)

Create a service thread for attaching serial ports. The thread begins execution with the first attached port.

Parameters:
priof this thread to run under.

~SerialService ()

Terminate the service thread and update attached objects.

inline int getCount (void)

Get current reference count. This can be used when selecting the lead used service handler from a pool.

Returns: count of active ports.