\hypertarget{namespacePipeStreamSignalHandling}{\section{Pipe\-Stream\-Signal\-Handling Namespace Reference}
\label{namespacePipeStreamSignalHandling}\index{Pipe\-Stream\-Signal\-Handling@{Pipe\-Stream\-Signal\-Handling}}
}


Takes care of the signal handling necessary for the functions in the \hyperlink{classPipeStream}{Pipe\-Stream} class.  


\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structPipeStreamSignalHandling_1_1process__status}{process\-\_\-status}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{namespacePipeStreamSignalHandling_a14fc75f2dfb1f9f846dd02eb1133300a}{got\-\_\-status} (pid\-\_\-t pid, int $\ast$status)
\begin{DoxyCompactList}\small\item\em Checks to see if the given process has exited. \end{DoxyCompactList}\item 
void \hyperlink{namespacePipeStreamSignalHandling_a5f702cc234291a2e4420a72f11e46168}{expect\-Another} ()  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Note that we expect to start another child. \end{DoxyCompactList}\item 
void \hyperlink{namespacePipeStreamSignalHandling_a17dd41fc8d2e35a6d36cc70aec0e436e}{childcatcher} (int)
\item 
void \hyperlink{namespacePipeStreamSignalHandling_acede41909df52a0a5cbb2eb3892a728e}{alarmcatcher} (int)
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structPipeStreamSignalHandling_1_1process__status}{process\-\_\-status} $\ast$ \hyperlink{namespacePipeStreamSignalHandling_ae08548945a242c3110affb7c3ffa26f8}{procs} = 0
\item 
sig\-\_\-atomic\-\_\-t \hyperlink{namespacePipeStreamSignalHandling_a087f29cce50ef65417b09901d6e217ea}{nprocs}
\item 
sig\-\_\-atomic\-\_\-t \hyperlink{namespacePipeStreamSignalHandling_ad3b491952ebd58029bc34766eaa972e7}{nprocs\-\_\-used}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Takes care of the signal handling necessary for the functions in the \hyperlink{classPipeStream}{Pipe\-Stream} class. If your application for whatever reason has to catch {\ttfamily S\-I\-G\-C\-H\-L\-D}, then to avoid interference between these, you should do so using functions \hyperlink{namespacePipeStreamSignalHandling_a5f702cc234291a2e4420a72f11e46168}{expect\-Another} and \hyperlink{namespacePipeStreamSignalHandling_a14fc75f2dfb1f9f846dd02eb1133300a}{got\-\_\-status}. These two functions are the only `public' A\-P\-I in this namespace. 

\subsection{Function Documentation}
\hypertarget{namespacePipeStreamSignalHandling_acede41909df52a0a5cbb2eb3892a728e}{\index{Pipe\-Stream\-Signal\-Handling@{Pipe\-Stream\-Signal\-Handling}!alarmcatcher@{alarmcatcher}}
\index{alarmcatcher@{alarmcatcher}!PipeStreamSignalHandling@{Pipe\-Stream\-Signal\-Handling}}
\subsubsection[{alarmcatcher}]{\setlength{\rightskip}{0pt plus 5cm}void Pipe\-Stream\-Signal\-Handling\-::alarmcatcher (
\begin{DoxyParamCaption}
\item[{int}]{signum}
\end{DoxyParamCaption}
)}}\label{namespacePipeStreamSignalHandling_acede41909df52a0a5cbb2eb3892a728e}


Referenced by expect\-Another().

\hypertarget{namespacePipeStreamSignalHandling_a17dd41fc8d2e35a6d36cc70aec0e436e}{\index{Pipe\-Stream\-Signal\-Handling@{Pipe\-Stream\-Signal\-Handling}!childcatcher@{childcatcher}}
\index{childcatcher@{childcatcher}!PipeStreamSignalHandling@{Pipe\-Stream\-Signal\-Handling}}
\subsubsection[{childcatcher}]{\setlength{\rightskip}{0pt plus 5cm}void Pipe\-Stream\-Signal\-Handling\-::childcatcher (
\begin{DoxyParamCaption}
\item[{int}]{signum}
\end{DoxyParamCaption}
)}}\label{namespacePipeStreamSignalHandling_a17dd41fc8d2e35a6d36cc70aec0e436e}


References nprocs, nprocs\-\_\-used, Pipe\-Stream\-Signal\-Handling\-::process\-\_\-status\-::pid, procs, and Pipe\-Stream\-Signal\-Handling\-::process\-\_\-status\-::status.



Referenced by expect\-Another().

\hypertarget{namespacePipeStreamSignalHandling_a5f702cc234291a2e4420a72f11e46168}{\index{Pipe\-Stream\-Signal\-Handling@{Pipe\-Stream\-Signal\-Handling}!expect\-Another@{expect\-Another}}
\index{expect\-Another@{expect\-Another}!PipeStreamSignalHandling@{Pipe\-Stream\-Signal\-Handling}}
\subsubsection[{expect\-Another}]{\setlength{\rightskip}{0pt plus 5cm}void Pipe\-Stream\-Signal\-Handling\-::expect\-Another (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) }}\label{namespacePipeStreamSignalHandling_a5f702cc234291a2e4420a72f11e46168}


Note that we expect to start another child. 

This function must be called before doing each {\ttfamily fork()}, as it does the initialisation of the structures used by this set of functions, and subsequently ensures that there is enough space in the list of statuses to hold another one.


\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if we can't do this for some reason \\
\hline
\end{DoxyExceptions}


References alarmcatcher(), childcatcher(), Input\-Byte\-Stream\-::get\-Verbosity(), normal, nprocs, nprocs\-\_\-used, and procs.



Referenced by Pipe\-Stream\-::\-Pipe\-Stream().

\hypertarget{namespacePipeStreamSignalHandling_a14fc75f2dfb1f9f846dd02eb1133300a}{\index{Pipe\-Stream\-Signal\-Handling@{Pipe\-Stream\-Signal\-Handling}!got\-\_\-status@{got\-\_\-status}}
\index{got\-\_\-status@{got\-\_\-status}!PipeStreamSignalHandling@{Pipe\-Stream\-Signal\-Handling}}
\subsubsection[{got\-\_\-status}]{\setlength{\rightskip}{0pt plus 5cm}bool Pipe\-Stream\-Signal\-Handling\-::got\-\_\-status (
\begin{DoxyParamCaption}
\item[{pid\-\_\-t}]{pid, }
\item[{int $\ast$}]{status}
\end{DoxyParamCaption}
)}}\label{namespacePipeStreamSignalHandling_a14fc75f2dfb1f9f846dd02eb1133300a}


Checks to see if the given process has exited. 

If there's an entry for this P\-I\-D in the list, then put the corresponding status in the {\ttfamily status} parameter, and return true. If not, return false; {\ttfamily $\ast$status} is then unchanged.


\begin{DoxyParams}{Parameters}
{\em pid} & the P\-I\-D to check \\
\hline
{\em status} & a pointer to the status to be returned \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the status was in fact available, and is now in {\ttfamily $\ast$status}; false otherwise 
\end{DoxyReturn}


References Pipe\-Stream\-Signal\-Handling\-::process\-\_\-status\-::clear(), Input\-Byte\-Stream\-::get\-Verbosity(), normal, nprocs, nprocs\-\_\-used, procs, and Pipe\-Stream\-Signal\-Handling\-::process\-\_\-status\-::status.



Referenced by Pipe\-Stream\-::close().



\subsection{Variable Documentation}
\hypertarget{namespacePipeStreamSignalHandling_a087f29cce50ef65417b09901d6e217ea}{\index{Pipe\-Stream\-Signal\-Handling@{Pipe\-Stream\-Signal\-Handling}!nprocs@{nprocs}}
\index{nprocs@{nprocs}!PipeStreamSignalHandling@{Pipe\-Stream\-Signal\-Handling}}
\subsubsection[{nprocs}]{\setlength{\rightskip}{0pt plus 5cm}sig\-\_\-atomic\-\_\-t Pipe\-Stream\-Signal\-Handling\-::nprocs}}\label{namespacePipeStreamSignalHandling_a087f29cce50ef65417b09901d6e217ea}


Referenced by childcatcher(), expect\-Another(), and got\-\_\-status().

\hypertarget{namespacePipeStreamSignalHandling_ad3b491952ebd58029bc34766eaa972e7}{\index{Pipe\-Stream\-Signal\-Handling@{Pipe\-Stream\-Signal\-Handling}!nprocs\-\_\-used@{nprocs\-\_\-used}}
\index{nprocs\-\_\-used@{nprocs\-\_\-used}!PipeStreamSignalHandling@{Pipe\-Stream\-Signal\-Handling}}
\subsubsection[{nprocs\-\_\-used}]{\setlength{\rightskip}{0pt plus 5cm}sig\-\_\-atomic\-\_\-t Pipe\-Stream\-Signal\-Handling\-::nprocs\-\_\-used}}\label{namespacePipeStreamSignalHandling_ad3b491952ebd58029bc34766eaa972e7}


Referenced by childcatcher(), expect\-Another(), and got\-\_\-status().

\hypertarget{namespacePipeStreamSignalHandling_ae08548945a242c3110affb7c3ffa26f8}{\index{Pipe\-Stream\-Signal\-Handling@{Pipe\-Stream\-Signal\-Handling}!procs@{procs}}
\index{procs@{procs}!PipeStreamSignalHandling@{Pipe\-Stream\-Signal\-Handling}}
\subsubsection[{procs}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf process\-\_\-status}$\ast$ Pipe\-Stream\-Signal\-Handling\-::procs = 0}}\label{namespacePipeStreamSignalHandling_ae08548945a242c3110affb7c3ffa26f8}


Referenced by childcatcher(), expect\-Another(), and got\-\_\-status().