\hypertarget{classProcessWatch}{
\section{ProcessWatch Class Reference}
\label{classProcessWatch}\index{ProcessWatch@{ProcessWatch}}
}


Keeps track of which XORP processes of interest are alive.  




{\ttfamily \#include $<$process\_\-watch.hh$>$}

Inheritance diagram for ProcessWatch:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classProcessWatch}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classProcessWatch_1_1Process}{Process}
\item 
class \hyperlink{classProcessWatch_1_1PWException}{PWException}
\begin{DoxyCompactList}\small\item\em Exception thrown on error, such as \hyperlink{classXrl}{Xrl} failure. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classProcessWatch_aca22302905657ba73ae63616a912bd62}{
typedef XorpCallback0$<$ void $>$::RefPtr {\bfseries TerminateCallback}}
\label{classProcessWatch_aca22302905657ba73ae63616a912bd62}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classProcessWatch_a8467ea4d09db2cce7a8c8088547e417d}{
{\bfseries ProcessWatch} (\hyperlink{classXrlStdRouter}{XrlStdRouter} $\ast$xrl\_\-router, \hyperlink{classEventLoop}{EventLoop} \&eventloop, const char $\ast$bgp\_\-mib\_\-name, TerminateCallback cb)}
\label{classProcessWatch_a8467ea4d09db2cce7a8c8088547e417d}

\item 
\hypertarget{classProcessWatch_aca8f7a3bdd1ab4d7f92b26c3d9c88082}{
void \hyperlink{classProcessWatch_aca8f7a3bdd1ab4d7f92b26c3d9c88082}{birth} (const string \&target\_\-class, const string \&target\_\-instance)}
\label{classProcessWatch_aca8f7a3bdd1ab4d7f92b26c3d9c88082}

\begin{DoxyCompactList}\small\item\em Method to call when \hyperlink{protocolthe-p}{the} birth of a process has been detected. \item\end{DoxyCompactList}\item 
\hypertarget{classProcessWatch_af3fcbe568be645402006dd9fadb52c3c}{
void \hyperlink{classProcessWatch_af3fcbe568be645402006dd9fadb52c3c}{death} (const string \&target\_\-class, const string \&target\_\-instance)}
\label{classProcessWatch_af3fcbe568be645402006dd9fadb52c3c}

\begin{DoxyCompactList}\small\item\em Method to call when \hyperlink{protocolthe-p}{the} death of a process has been detected. \item\end{DoxyCompactList}\item 
\hypertarget{classProcessWatch_a57405ede74e5cdc1089f864313545356}{
void \hyperlink{classProcessWatch_a57405ede74e5cdc1089f864313545356}{finder\_\-death} (const char $\ast$file, const int lineno)}
\label{classProcessWatch_a57405ede74e5cdc1089f864313545356}

\begin{DoxyCompactList}\small\item\em Method to call if \hyperlink{protocolthe-p}{the} finder dies. \item\end{DoxyCompactList}\item 
\hypertarget{classProcessWatch_a14e02acd0574019848551dc2c2ec2ddc}{
void \hyperlink{classProcessWatch_a14e02acd0574019848551dc2c2ec2ddc}{start\_\-kill\_\-timer} ()}
\label{classProcessWatch_a14e02acd0574019848551dc2c2ec2ddc}

\begin{DoxyCompactList}\small\item\em Start a timer to kill this process if for some reason we get hung up. \item\end{DoxyCompactList}\item 
bool \hyperlink{classProcessWatch_aea07887eee98c3bf9822c265293dee2e}{ready} () const 
\item 
bool \hyperlink{classProcessWatch_a84c61f7f3c79fc01d7c6c1265b638210}{target\_\-exists} (const string \&target) const 
\item 
\hyperlink{classProcessWatch_a4833e863874fe24f2492c93bcdd343aa}{ProcessWatch} (\hyperlink{classXrlStdRouter}{XrlStdRouter} \&rtr, \hyperlink{classProtocolMap}{ProtocolMap} \&pmap)
\item 
void \hyperlink{classProcessWatch_abb4632626cc816cb73c91c18841ad678}{register\_\-cb} (const \hyperlink{classXrlError}{XrlError} \&err)
\begin{DoxyCompactList}\small\item\em Callback for all \hyperlink{classXrl}{Xrl} calls. \item\end{DoxyCompactList}\item 
void \hyperlink{classProcessWatch_a0fd11cf3ddb5fde7fa03ee67bdaee496}{add\_\-interest} (const string \&proc)
\begin{DoxyCompactList}\small\item\em Add an interest in a protocol. \item\end{DoxyCompactList}\item 
void \hyperlink{classProcessWatch_a5a0361f3c68d05e8f16509e47a36ed33}{birth} (const string \&proto)
\begin{DoxyCompactList}\small\item\em Announce birth of a protocol \mbox{[}process\mbox{]}. \item\end{DoxyCompactList}\item 
void \hyperlink{classProcessWatch_ae2040a1fa163dabd097fd8cb572f69c4}{death} (const string \&proto)
\begin{DoxyCompactList}\small\item\em Announce death of a protocol. \item\end{DoxyCompactList}\item 
bool \hyperlink{classProcessWatch_aacb34182d8e88f049e44d2e2db4ef81b}{alive} (const string \&proto)
\begin{DoxyCompactList}\small\item\em An exception is thrown if \hyperlink{protocolthe-p}{the} process watch is not watching \hyperlink{protocolthe-p}{the} requested protocol. \item\end{DoxyCompactList}\item 
void \hyperlink{classProcessWatch_a7b0f29b4247184de8ea617d123987891}{set\_\-notifier} (\hyperlink{classPWNotifier}{PWNotifier} \&notifier)
\begin{DoxyCompactList}\small\item\em Set an object which will receive birth/death notifications. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classProcessWatch_a0d51569697a6afba333dc1a2f11b8e8c}{
void {\bfseries interest\_\-callback} (const \hyperlink{classXrlError}{XrlError} \&error)}
\label{classProcessWatch_a0d51569697a6afba333dc1a2f11b8e8c}

\item 
\hypertarget{classProcessWatch_a4681f7f425cdd0fae8e754faaf36ff4f}{
void {\bfseries add\_\-target} (const string \&target\_\-class, const string \&target\_\-instance)}
\label{classProcessWatch_a4681f7f425cdd0fae8e754faaf36ff4f}

\item 
\hypertarget{classProcessWatch_a3ffad85f7b8212e3a6edfc494942f0e5}{
void {\bfseries remove\_\-target} (const string \&target\_\-class, const string \&target\_\-instance)}
\label{classProcessWatch_a3ffad85f7b8212e3a6edfc494942f0e5}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classProcessWatch_abebdc7710346240a92daf8735e13f8ef}{
\hyperlink{classEventLoop}{EventLoop} \& {\bfseries \_\-eventloop}}
\label{classProcessWatch_abebdc7710346240a92daf8735e13f8ef}

\item 
\hypertarget{classProcessWatch_aec341c25d8fb63afd3e911c487c1ef72}{
TerminateCallback {\bfseries \_\-shutdown}}
\label{classProcessWatch_aec341c25d8fb63afd3e911c487c1ef72}

\item 
\hypertarget{classProcessWatch_a4a795716d35cd285fd7796984a02d433}{
bool {\bfseries \_\-fea}}
\label{classProcessWatch_a4a795716d35cd285fd7796984a02d433}

\item 
\hypertarget{classProcessWatch_aeb1c242f03388da77b5b796c95bf5b6d}{
bool {\bfseries \_\-rib}}
\label{classProcessWatch_aeb1c242f03388da77b5b796c95bf5b6d}

\item 
\hypertarget{classProcessWatch_ab5ca9d0701ebd687cd429d6f11dbbb32}{
string {\bfseries \_\-fea\_\-instance}}
\label{classProcessWatch_ab5ca9d0701ebd687cd429d6f11dbbb32}

\item 
\hypertarget{classProcessWatch_a7a60897ebf7c727055416e0f0ea80249}{
string {\bfseries \_\-rib\_\-instance}}
\label{classProcessWatch_a7a60897ebf7c727055416e0f0ea80249}

\item 
\hypertarget{classProcessWatch_adbb0547c1222662fbe82664e9fd5606a}{
\hyperlink{classXorpTimer}{XorpTimer} {\bfseries \_\-shutdown\_\-timer}}
\label{classProcessWatch_adbb0547c1222662fbe82664e9fd5606a}

\item 
\hypertarget{classProcessWatch_a8492742a5c696217b1cc39687c70f5b7}{
list$<$ \hyperlink{classProcessWatch_1_1Process}{Process} $>$ {\bfseries \_\-processes}}
\label{classProcessWatch_a8492742a5c696217b1cc39687c70f5b7}

\item 
\hypertarget{classProcessWatch_a2f5ba55a1cb185a0b23c38abb04d5e48}{
\hyperlink{classProtocolMap}{ProtocolMap} \& {\bfseries \_\-pmap}}
\label{classProcessWatch_a2f5ba55a1cb185a0b23c38abb04d5e48}

\item 
\hypertarget{classProcessWatch_a8db89dcb822f67201edf0858deb79698}{
set$<$ string $>$ {\bfseries \_\-watching}}
\label{classProcessWatch_a8db89dcb822f67201edf0858deb79698}

\item 
\hypertarget{classProcessWatch_a9a1c5b9ba85f014b86cdcea5a5ed3b68}{
set$<$ string $>$ {\bfseries \_\-alive}}
\label{classProcessWatch_a9a1c5b9ba85f014b86cdcea5a5ed3b68}

\item 
\hypertarget{classProcessWatch_a5a85bfbf12a572b8d5cb0683c9f22ed5}{
\hyperlink{classXrlFinderEventNotifierV0p1Client}{XrlFinderEventNotifierV0p1Client} {\bfseries \_\-finder}}
\label{classProcessWatch_a5a85bfbf12a572b8d5cb0683c9f22ed5}

\item 
\hypertarget{classProcessWatch_a1299bfa6c9ed2bb44c6336ec1224b887}{
string {\bfseries \_\-instance\_\-name}}
\label{classProcessWatch_a1299bfa6c9ed2bb44c6336ec1224b887}

\item 
\hypertarget{classProcessWatch_aa287d3ab8345d2a18ae7b80526ae6f6e}{
\hyperlink{classPWNotifier}{PWNotifier} $\ast$ {\bfseries \_\-notifier}}
\label{classProcessWatch_aa287d3ab8345d2a18ae7b80526ae6f6e}

\item 
\hypertarget{classProcessWatch_aac065604c89f9f640c6a038901772a30}{
string {\bfseries \_\-finder\_\-name}}
\label{classProcessWatch_aac065604c89f9f640c6a038901772a30}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Keeps track of which XORP processes of interest are alive. The \hyperlink{classVarMap}{VarMap} will register interest in protocols for known protocols with \hyperlink{protocolthe-p}{the} \hyperlink{classProcessWatch}{ProcessWatch}. The \hyperlink{classProcessWatch}{ProcessWatch} will then register this interest with \hyperlink{protocolthe-p}{the} finder.

Very similar / identical to BGP's process watch. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classProcessWatch_a4833e863874fe24f2492c93bcdd343aa}{
\index{ProcessWatch@{ProcessWatch}!ProcessWatch@{ProcessWatch}}
\index{ProcessWatch@{ProcessWatch}!ProcessWatch@{ProcessWatch}}
\subsubsection[{ProcessWatch}]{\setlength{\rightskip}{0pt plus 5cm}ProcessWatch::ProcessWatch (
\begin{DoxyParamCaption}
\item[{{\bf XrlStdRouter} \&}]{rtr, }
\item[{{\bf ProtocolMap} \&}]{pmap}
\end{DoxyParamCaption}
)}}
\label{classProcessWatch_a4833e863874fe24f2492c93bcdd343aa}

\begin{DoxyParams}{Parameters}
{\em rtr} & \hyperlink{classXrl}{Xrl} router to use. \\
\hline
{\em pmap} & protocol map. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classProcessWatch_a0fd11cf3ddb5fde7fa03ee67bdaee496}{
\index{ProcessWatch@{ProcessWatch}!add\_\-interest@{add\_\-interest}}
\index{add\_\-interest@{add\_\-interest}!ProcessWatch@{ProcessWatch}}
\subsubsection[{add\_\-interest}]{\setlength{\rightskip}{0pt plus 5cm}void ProcessWatch::add\_\-interest (
\begin{DoxyParamCaption}
\item[{const string \&}]{proc}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classProcessWatch_a0fd11cf3ddb5fde7fa03ee67bdaee496}


Add an interest in a protocol. 


\begin{DoxyParams}{Parameters}
{\em proc} & process of \hyperlink{protocolthe-p}{the} protocol to add interest for. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classProcessWatchBase_a081131164730fca4640a1edadd5357e2}{ProcessWatchBase}.

\hypertarget{classProcessWatch_aacb34182d8e88f049e44d2e2db4ef81b}{
\index{ProcessWatch@{ProcessWatch}!alive@{alive}}
\index{alive@{alive}!ProcessWatch@{ProcessWatch}}
\subsubsection[{alive}]{\setlength{\rightskip}{0pt plus 5cm}bool ProcessWatch::alive (
\begin{DoxyParamCaption}
\item[{const string \&}]{proto}
\end{DoxyParamCaption}
)}}
\label{classProcessWatch_aacb34182d8e88f049e44d2e2db4ef81b}


An exception is thrown if \hyperlink{protocolthe-p}{the} process watch is not watching \hyperlink{protocolthe-p}{the} requested protocol. 

\begin{DoxyReturn}{Returns}
true if protocol is alive, false otherwise. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em proto} & protocol for which status is requested. \\
\hline
\end{DoxyParams}
\hypertarget{classProcessWatch_a5a0361f3c68d05e8f16509e47a36ed33}{
\index{ProcessWatch@{ProcessWatch}!birth@{birth}}
\index{birth@{birth}!ProcessWatch@{ProcessWatch}}
\subsubsection[{birth}]{\setlength{\rightskip}{0pt plus 5cm}void ProcessWatch::birth (
\begin{DoxyParamCaption}
\item[{const string \&}]{proto}
\end{DoxyParamCaption}
)}}
\label{classProcessWatch_a5a0361f3c68d05e8f16509e47a36ed33}


Announce birth of a protocol \mbox{[}process\mbox{]}. 


\begin{DoxyParams}{Parameters}
{\em proto} & protocol that came to life. \\
\hline
\end{DoxyParams}
\hypertarget{classProcessWatch_ae2040a1fa163dabd097fd8cb572f69c4}{
\index{ProcessWatch@{ProcessWatch}!death@{death}}
\index{death@{death}!ProcessWatch@{ProcessWatch}}
\subsubsection[{death}]{\setlength{\rightskip}{0pt plus 5cm}void ProcessWatch::death (
\begin{DoxyParamCaption}
\item[{const string \&}]{proto}
\end{DoxyParamCaption}
)}}
\label{classProcessWatch_ae2040a1fa163dabd097fd8cb572f69c4}


Announce death of a protocol. 


\begin{DoxyParams}{Parameters}
{\em proto} & protocol that died. \\
\hline
\end{DoxyParams}
\hypertarget{classProcessWatch_aea07887eee98c3bf9822c265293dee2e}{
\index{ProcessWatch@{ProcessWatch}!ready@{ready}}
\index{ready@{ready}!ProcessWatch@{ProcessWatch}}
\subsubsection[{ready}]{\setlength{\rightskip}{0pt plus 5cm}bool ProcessWatch::ready (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classProcessWatch_aea07887eee98c3bf9822c265293dee2e}
\begin{DoxyReturn}{Returns}
Return true when all \hyperlink{protocolthe-p}{the} processes that BGP requires for correct operation are running. 
\end{DoxyReturn}
\hypertarget{classProcessWatch_abb4632626cc816cb73c91c18841ad678}{
\index{ProcessWatch@{ProcessWatch}!register\_\-cb@{register\_\-cb}}
\index{register\_\-cb@{register\_\-cb}!ProcessWatch@{ProcessWatch}}
\subsubsection[{register\_\-cb}]{\setlength{\rightskip}{0pt plus 5cm}void ProcessWatch::register\_\-cb (
\begin{DoxyParamCaption}
\item[{const {\bf XrlError} \&}]{err}
\end{DoxyParamCaption}
)}}
\label{classProcessWatch_abb4632626cc816cb73c91c18841ad678}


Callback for all \hyperlink{classXrl}{Xrl} calls. 


\begin{DoxyParams}{Parameters}
{\em err} & possible \hyperlink{classXrl}{Xrl} error. \\
\hline
\end{DoxyParams}
\hypertarget{classProcessWatch_a7b0f29b4247184de8ea617d123987891}{
\index{ProcessWatch@{ProcessWatch}!set\_\-notifier@{set\_\-notifier}}
\index{set\_\-notifier@{set\_\-notifier}!ProcessWatch@{ProcessWatch}}
\subsubsection[{set\_\-notifier}]{\setlength{\rightskip}{0pt plus 5cm}void ProcessWatch::set\_\-notifier (
\begin{DoxyParamCaption}
\item[{{\bf PWNotifier} \&}]{notifier}
\end{DoxyParamCaption}
)}}
\label{classProcessWatch_a7b0f29b4247184de8ea617d123987891}


Set an object which will receive birth/death notifications. 

If a previous object was \char`\"{}registered\char`\"{}, it will be removed. Only one object may receive notifications.


\begin{DoxyParams}{Parameters}
{\em notifier} & object where notifications should be sent. \\
\hline
\end{DoxyParams}
\hypertarget{classProcessWatch_a84c61f7f3c79fc01d7c6c1265b638210}{
\index{ProcessWatch@{ProcessWatch}!target\_\-exists@{target\_\-exists}}
\index{target\_\-exists@{target\_\-exists}!ProcessWatch@{ProcessWatch}}
\subsubsection[{target\_\-exists}]{\setlength{\rightskip}{0pt plus 5cm}bool ProcessWatch::target\_\-exists (
\begin{DoxyParamCaption}
\item[{const string \&}]{target}
\end{DoxyParamCaption}
) const}}
\label{classProcessWatch_a84c61f7f3c79fc01d7c6c1265b638210}
\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} target process exists. 
\end{DoxyReturn}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/bgp/process\_\-watch.hh\item 
/home/greearb/git/xorp.ct.github/xorp/policy/process\_\-watch.hh\item 
/home/greearb/git/xorp.ct.github/xorp/bgp/process\_\-watch.cc\item 
/home/greearb/git/xorp.ct.github/xorp/policy/process\_\-watch.cc\end{DoxyCompactItemize}
