Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 746

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

\section{ost::Serial\-Service Class Reference}
\label{classost_1_1_serial_service}\index{ost::SerialService@{ost::SerialService}}
The {\bf Serial\-Service}{\rm (p.\,\pageref{classost_1_1_serial_service})} is a thead service object that is meant to service attached serial {\bf ports.Thread}{\rm (p.\,\pageref{namespaceost_1a3b6738f6f759fcb52b544a4787cbb2})} pool service for serial ports.  


{\tt \#include $<$serial.h$>$}

Inheritance diagram for ost::Serial\-Service::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classost_1_1_serial_service}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
void {\bf update} (unsigned char flag=0xff)
\begin{CompactList}\small\item\em 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. \item\end{CompactList}\item 
{\bf Serial\-Service} (int pri=0, size\_\-t stack=0, const char $\ast$id=NULL)
\begin{CompactList}\small\item\em Create a service thread for attaching serial ports. \item\end{CompactList}\item 
virtual {\bf $\sim$Serial\-Service} ()
\begin{CompactList}\small\item\em Terminate the service thread and update attached objects. \item\end{CompactList}\item 
int {\bf get\-Count} (void)
\begin{CompactList}\small\item\em Get current reference count. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf on\-Update} (unsigned char flag)
\begin{CompactList}\small\item\em A virtual handler for processing user defined update requests (1-254) which have been posted through Update. \item\end{CompactList}\item 
virtual void {\bf on\-Event} (void)
\begin{CompactList}\small\item\em A virtual handler for event loop calls. \item\end{CompactList}\item 
virtual void {\bf on\-Callback} ({\bf Serial\-Port} $\ast$port)
\begin{CompactList}\small\item\em A virtual handler for adding support for additional callback events into {\bf Serial\-Port}{\rm (p.\,\pageref{classost_1_1_serial_port})}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Serial\-Port}
\end{CompactItemize}


\subsection{Detailed Description}
The {\bf Serial\-Service}{\rm (p.\,\pageref{classost_1_1_serial_service})} is a thead service object that is meant to service attached serial {\bf ports.Thread}{\rm (p.\,\pageref{namespaceost_1a3b6738f6f759fcb52b544a4787cbb2})} pool service for 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.

The TTYPort and TTYService classes are used to form thread-pool serviced serial I/O protocol sets. These can be used when one has a large number of serial devices to manage, and a single (or limited number of) thread(s) can then be used to service the tty port objects present. Each tty port supports a timer control and several virtual methods that the service thread can call when events occur. This model provides for \char`\"{}callback\char`\"{} event management, whereby the service thread performs a \char`\"{}callback\char`\"{} into the port object when events occur. Specific events supported include the expiration of a TTYPort timer, pending input data waiting to be read, and \char`\"{}sighup\char`\"{} connection breaks.

\begin{Desc}
\item[Author:]David Sugar $<${\tt dyfet@ostel.com}$>$ \end{Desc}




\subsection{Constructor \& Destructor Documentation}
\index{ost::SerialService@{ost::Serial\-Service}!SerialService@{SerialService}}
\index{SerialService@{SerialService}!ost::SerialService@{ost::Serial\-Service}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Serial\-Service::Serial\-Service (int {\em pri} = {\tt 0}, size\_\-t {\em stack} = {\tt 0}, const char $\ast$ {\em id} = {\tt NULL})}\label{classost_1_1_serial_service_976999ced6e562ef85e13482c4a62667}


Create a service thread for attaching serial ports. 

The thread begins execution with the first attached port.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pri}]of this thread to run under. \item[{\em stack}]stack size. \item[{\em id}]stack ID. \end{description}
\end{Desc}
\index{ost::SerialService@{ost::Serial\-Service}!~SerialService@{$\sim$SerialService}}
\index{~SerialService@{$\sim$SerialService}!ost::SerialService@{ost::Serial\-Service}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ost::Serial\-Service::$\sim$Serial\-Service ()\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_serial_service_51858284192f8089ab3cdda7eb431a0c}


Terminate the service thread and update attached objects. 



\subsection{Member Function Documentation}
\index{ost::SerialService@{ost::Serial\-Service}!getCount@{getCount}}
\index{getCount@{getCount}!ost::SerialService@{ost::Serial\-Service}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int ost::Serial\-Service::get\-Count (void)\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_serial_service_9b613f73f7222745076f9f78aff7c78c}


Get current reference count. 

This can be used when selecting the lead used service handler from a pool.

\begin{Desc}
\item[Returns:]count of active ports. \end{Desc}
\index{ost::SerialService@{ost::Serial\-Service}!onCallback@{onCallback}}
\index{onCallback@{onCallback}!ost::SerialService@{ost::Serial\-Service}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void ost::Serial\-Service::on\-Callback ({\bf Serial\-Port} $\ast$ {\em port})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classost_1_1_serial_service_eb873fd33e21aeebf78cb291a170fe27}


A virtual handler for adding support for additional callback events into {\bf Serial\-Port}{\rm (p.\,\pageref{classost_1_1_serial_port})}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em port}]serial port currently being evaluated. \end{description}
\end{Desc}
\index{ost::SerialService@{ost::Serial\-Service}!onEvent@{onEvent}}
\index{onEvent@{onEvent}!ost::SerialService@{ost::Serial\-Service}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void ost::Serial\-Service::on\-Event (void)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classost_1_1_serial_service_857ecbd9c831d019400b5d9e9a02a6ac}


A virtual handler for event loop calls. 

This can be used to extend event loop processing. \index{ost::SerialService@{ost::Serial\-Service}!onUpdate@{onUpdate}}
\index{onUpdate@{onUpdate}!ost::SerialService@{ost::Serial\-Service}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void ost::Serial\-Service::on\-Update (unsigned char {\em flag})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classost_1_1_serial_service_39e53b68c6108d78ac3afea01d7cba05}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em flag}]of update request. \end{description}
\end{Desc}
\index{ost::SerialService@{ost::Serial\-Service}!update@{update}}
\index{update@{update}!ost::SerialService@{ost::Serial\-Service}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Serial\-Service::update (unsigned char {\em flag} = {\tt 0xff})}\label{classost_1_1_serial_service_66efc4ea33b87c147ab0a207eb35a208}


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 On\-Update() event handler.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em flag}]event for On\-Update, termination, or reschedule. \end{description}
\end{Desc}


\subsection{Friends And Related Function Documentation}
\index{ost::SerialService@{ost::Serial\-Service}!SerialPort@{SerialPort}}
\index{SerialPort@{SerialPort}!ost::SerialService@{ost::Serial\-Service}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}friend class {\bf Serial\-Port}\hspace{0.3cm}{\tt  [friend]}}\label{classost_1_1_serial_service_84d7b24f575569e86cb63b1f8c62e84a}




The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
{\bf serial.h}\end{CompactItemize}