\hypertarget{classTaskManager}{
\section{TaskManager Class Reference}
\label{classTaskManager}\index{TaskManager@{TaskManager}}
}
Inheritance diagram for TaskManager:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classTaskManager}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTaskManager_a9c3f353c823439ff75c8141cf8addec6}{
{\bfseries TaskManager} (\hyperlink{classMasterConfigTree}{MasterConfigTree} \&config\_\-tree, \hyperlink{classModuleManager}{ModuleManager} \&mmgr, \hyperlink{classXorpClient}{XorpClient} \&xclient, bool global\_\-do\_\-exec, bool verbose)}
\label{classTaskManager_a9c3f353c823439ff75c8141cf8addec6}

\item 
\hypertarget{classTaskManager_ad6eb3ed3c83dc5d5ac018c1f7e448a88}{
void {\bfseries set\_\-do\_\-exec} (bool do\_\-exec, bool is\_\-verification)}
\label{classTaskManager_ad6eb3ed3c83dc5d5ac018c1f7e448a88}

\item 
\hypertarget{classTaskManager_a0a945594d60c72a367c536b3310b75da}{
void {\bfseries reset} ()}
\label{classTaskManager_a0a945594d60c72a367c536b3310b75da}

\item 
\hypertarget{classTaskManager_aa98c3bb54a9b28af0c747f2f7d0aa5d8}{
int {\bfseries add\_\-module} (const \hyperlink{classModuleCommand}{ModuleCommand} \&mod\_\-cmd, string \&error\_\-msg)}
\label{classTaskManager_aa98c3bb54a9b28af0c747f2f7d0aa5d8}

\item 
\hypertarget{classTaskManager_a585a669c4cb076334c708b146ceb00b3}{
void {\bfseries add\_\-xrl} (const string \&module\_\-name, const \hyperlink{classUnexpandedXrl}{UnexpandedXrl} \&xrl, XrlRouter::XrlCallback \&cb)}
\label{classTaskManager_a585a669c4cb076334c708b146ceb00b3}

\item 
\hypertarget{classTaskManager_af877b3525c7a9dc8bde4b7101c0c8b5b}{
void {\bfseries add\_\-program} (const string \&module\_\-name, const \hyperlink{classUnexpandedProgram}{UnexpandedProgram} \&program, TaskProgramItem::ProgramCallback program\_\-cb)}
\label{classTaskManager_af877b3525c7a9dc8bde4b7101c0c8b5b}

\item 
\hypertarget{classTaskManager_ab9abd6dd73df68acd8311895d9db2a01}{
void {\bfseries shutdown\_\-module} (const string \&module\_\-name)}
\label{classTaskManager_ab9abd6dd73df68acd8311895d9db2a01}

\item 
\hypertarget{classTaskManager_abb3df20462ba13e249b88da849bc0a47}{
void {\bfseries run} (CallBack cb)}
\label{classTaskManager_abb3df20462ba13e249b88da849bc0a47}

\item 
\hypertarget{classTaskManager_ae68d2b780aa99398cc9c1d8f927cbb37}{
\hyperlink{classXorpClient}{XorpClient} \& {\bfseries xorp\_\-client} () const }
\label{classTaskManager_ae68d2b780aa99398cc9c1d8f927cbb37}

\item 
\hypertarget{classTaskManager_ae99be8437c5f58fc9bf38d8bbb42cacb}{
\hyperlink{classModuleManager}{ModuleManager} \& {\bfseries module\_\-manager} () const }
\label{classTaskManager_ae99be8437c5f58fc9bf38d8bbb42cacb}

\item 
\hypertarget{classTaskManager_a1e591c643b0ee2b824aa82da9a941fa4}{
\hyperlink{classMasterConfigTree}{MasterConfigTree} \& {\bfseries config\_\-tree} () const }
\label{classTaskManager_a1e591c643b0ee2b824aa82da9a941fa4}

\item 
\hypertarget{classTaskManager_a38b307ce60611abc9e063c754f90a86a}{
bool {\bfseries do\_\-exec} () const }
\label{classTaskManager_a38b307ce60611abc9e063c754f90a86a}

\item 
\hypertarget{classTaskManager_aacabf37da62e54c116c9362e02a47fd8}{
bool {\bfseries is\_\-verification} () const }
\label{classTaskManager_aacabf37da62e54c116c9362e02a47fd8}

\item 
\hypertarget{classTaskManager_a6af270d405eb81e650bf6e767126b23f}{
bool {\bfseries verbose} () const }
\label{classTaskManager_a6af270d405eb81e650bf6e767126b23f}

\item 
\hypertarget{classTaskManager_a7a7dc0c0bdc943ac752bb78ff8f71fd0}{
\hyperlink{classEventLoop}{EventLoop} \& {\bfseries eventloop} () const }
\label{classTaskManager_a7a7dc0c0bdc943ac752bb78ff8f71fd0}

\item 
void \hyperlink{classTaskManager_ab15edfc73bb999053e2e4b2c54dae09f}{kill\_\-process} (const string \&module\_\-name)
\begin{DoxyCompactList}\small\item\em kill\_\-process is used to kill a fatally wounded process \item\end{DoxyCompactList}\item 
const \hyperlink{classRunCommandBase_1_1ExecId}{RunShellCommand::ExecId} \& \hyperlink{classTaskManager_a054b34c20657550859c43107cb42b955}{exec\_\-id} () const 
\begin{DoxyCompactList}\small\item\em Get a reference to \hyperlink{protocolthe-p}{the} ExecId object. \item\end{DoxyCompactList}\item 
void \hyperlink{classTaskManager_aec4e72db2c82689d180b434dc79d3e96}{set\_\-exec\_\-id} (const \hyperlink{classRunCommandBase_1_1ExecId}{RunShellCommand::ExecId} \&v)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} execution ID for executing \hyperlink{protocolthe-p}{the} tasks. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTaskManager_a6264ce3a8f2697e5e2c5327a928be778}{
typedef XorpCallback2$<$ void, bool, string $>$::RefPtr {\bfseries CallBack}}
\label{classTaskManager_a6264ce3a8f2697e5e2c5327a928be778}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTaskManager_aa12d202fd6564d603501c5209bcc8b78}{
void {\bfseries reorder\_\-tasks} ()}
\label{classTaskManager_aa12d202fd6564d603501c5209bcc8b78}

\item 
\hypertarget{classTaskManager_a0d6b67c002e8b60ecf4917b3e93710a0}{
void {\bfseries run\_\-task} ()}
\label{classTaskManager_a0d6b67c002e8b60ecf4917b3e93710a0}

\item 
void \hyperlink{classTaskManager_ae09395b949cc149f47555a654c579ff7}{task\_\-done} (bool success, const string \&errmsg)
\item 
\hypertarget{classTaskManager_a137d1dfec90777350e8e550e8e9c9123}{
void {\bfseries fail\_\-tasklist\_\-initialization} (const string \&errmsg)}
\label{classTaskManager_a137d1dfec90777350e8e550e8e9c9123}

\item 
\hypertarget{classTaskManager_abd4fb50f2f64897aa37d7055b0374f28}{
\hyperlink{classTask}{Task} \& {\bfseries find\_\-task} (const string \&module\_\-name)}
\label{classTaskManager_abd4fb50f2f64897aa37d7055b0374f28}

\item 
\hypertarget{classTaskManager_aaa267c5b94e0fa2e74317df6bbdbe944}{
void {\bfseries null\_\-callback} ()}
\label{classTaskManager_aaa267c5b94e0fa2e74317df6bbdbe944}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTaskManager_a7a4949a0505492ac701c931495f5753a}{
\hyperlink{classMasterConfigTree}{MasterConfigTree} \& {\bfseries \_\-config\_\-tree}}
\label{classTaskManager_a7a4949a0505492ac701c931495f5753a}

\item 
\hypertarget{classTaskManager_a03fe6fd570f839830d12a6817981e409}{
\hyperlink{classModuleManager}{ModuleManager} \& {\bfseries \_\-module\_\-manager}}
\label{classTaskManager_a03fe6fd570f839830d12a6817981e409}

\item 
\hypertarget{classTaskManager_a31df9bdbe7c5b36e0ebfdb91cd69e445}{
\hyperlink{classXorpClient}{XorpClient} \& {\bfseries \_\-xorp\_\-client}}
\label{classTaskManager_a31df9bdbe7c5b36e0ebfdb91cd69e445}

\item 
\hypertarget{classTaskManager_a966bc09cef307a8eed1e5a25c8385df8}{
bool {\bfseries \_\-global\_\-do\_\-exec}}
\label{classTaskManager_a966bc09cef307a8eed1e5a25c8385df8}

\item 
\hypertarget{classTaskManager_afa1a482c7f372ecf0d34ffa58a97bcff}{
bool {\bfseries \_\-current\_\-do\_\-exec}}
\label{classTaskManager_afa1a482c7f372ecf0d34ffa58a97bcff}

\item 
\hypertarget{classTaskManager_a101ab2b9041df143bc40cf91c403f9d4}{
bool {\bfseries \_\-is\_\-verification}}
\label{classTaskManager_a101ab2b9041df143bc40cf91c403f9d4}

\item 
\hypertarget{classTaskManager_a24c862d390fdc6b5677698513a4f12b9}{
bool {\bfseries \_\-verbose}}
\label{classTaskManager_a24c862d390fdc6b5677698513a4f12b9}

\item 
\hypertarget{classTaskManager_a246d5807f74570a7ae7195a0d438c1c0}{
map$<$ string, \hyperlink{classTask}{Task} $\ast$ $>$ {\bfseries \_\-tasks}}
\label{classTaskManager_a246d5807f74570a7ae7195a0d438c1c0}

\item 
\hypertarget{classTaskManager_a54e568b9f9692cc64d1f516c8ae8e1a6}{
list$<$ \hyperlink{classTask}{Task} $\ast$ $>$ {\bfseries \_\-tasklist}}
\label{classTaskManager_a54e568b9f9692cc64d1f516c8ae8e1a6}

\item 
\hypertarget{classTaskManager_a5b7e83916beb8f366c21dbec17db390f}{
list$<$ \hyperlink{classTask}{Task} $\ast$ $>$ {\bfseries \_\-shutdown\_\-order}}
\label{classTaskManager_a5b7e83916beb8f366c21dbec17db390f}

\item 
\hypertarget{classTaskManager_a4430b2d27c4046057b515a8e69864cd4}{
map$<$ string, const \hyperlink{classModuleCommand}{ModuleCommand} $\ast$ $>$ {\bfseries \_\-module\_\-commands}}
\label{classTaskManager_a4430b2d27c4046057b515a8e69864cd4}

\item 
\hypertarget{classTaskManager_afe88a9ca6e37220e4f044252f32f7eba}{
\hyperlink{classRunCommandBase_1_1ExecId}{RunShellCommand::ExecId} {\bfseries \_\-exec\_\-id}}
\label{classTaskManager_afe88a9ca6e37220e4f044252f32f7eba}

\item 
\hypertarget{classTaskManager_ac1d02c078346c94d6a26457629db096d}{
CallBack {\bfseries \_\-completion\_\-cb}}
\label{classTaskManager_ac1d02c078346c94d6a26457629db096d}

\end{DoxyCompactItemize}


\subsection{Member Function Documentation}
\hypertarget{classTaskManager_a054b34c20657550859c43107cb42b955}{
\index{TaskManager@{TaskManager}!exec\_\-id@{exec\_\-id}}
\index{exec\_\-id@{exec\_\-id}!TaskManager@{TaskManager}}
\subsubsection[{exec\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf RunShellCommand::ExecId}\& TaskManager::exec\_\-id (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTaskManager_a054b34c20657550859c43107cb42b955}


Get a reference to \hyperlink{protocolthe-p}{the} ExecId object. 

\begin{DoxyReturn}{Returns}
a reference to \hyperlink{protocolthe-p}{the} ExecId object that is used for setting \hyperlink{protocolthe-p}{the} execution ID when running \hyperlink{protocolthe-p}{the} tasks. 
\end{DoxyReturn}
\hypertarget{classTaskManager_ab15edfc73bb999053e2e4b2c54dae09f}{
\index{TaskManager@{TaskManager}!kill\_\-process@{kill\_\-process}}
\index{kill\_\-process@{kill\_\-process}!TaskManager@{TaskManager}}
\subsubsection[{kill\_\-process}]{\setlength{\rightskip}{0pt plus 5cm}void TaskManager::kill\_\-process (
\begin{DoxyParamCaption}
\item[{const string \&}]{module\_\-name}
\end{DoxyParamCaption}
)}}
\label{classTaskManager_ab15edfc73bb999053e2e4b2c54dae09f}


kill\_\-process is used to kill a fatally wounded process 

kill\_\-process is used to kill a fatally wounded process. This does not politely ask \hyperlink{protocolthe-p}{the} process to die, because if we get here we can't communicate with \hyperlink{protocolthe-p}{the} process using XRLs or any other mechanism, so we just kill it outright.


\begin{DoxyParams}{Parameters}
{\em module\_\-name} & \hyperlink{protocolthe-p}{the} module name of \hyperlink{protocolthe-p}{the} process to be killed. \\
\hline
\end{DoxyParams}
\hypertarget{classTaskManager_aec4e72db2c82689d180b434dc79d3e96}{
\index{TaskManager@{TaskManager}!set\_\-exec\_\-id@{set\_\-exec\_\-id}}
\index{set\_\-exec\_\-id@{set\_\-exec\_\-id}!TaskManager@{TaskManager}}
\subsubsection[{set\_\-exec\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}void TaskManager::set\_\-exec\_\-id (
\begin{DoxyParamCaption}
\item[{const {\bf RunShellCommand::ExecId} \&}]{v}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTaskManager_aec4e72db2c82689d180b434dc79d3e96}


Set \hyperlink{protocolthe-p}{the} execution ID for executing \hyperlink{protocolthe-p}{the} tasks. 


\begin{DoxyParams}{Parameters}
{\em v} & \hyperlink{protocolthe-p}{the} execution ID. \\
\hline
\end{DoxyParams}
\hypertarget{classTaskManager_ae09395b949cc149f47555a654c579ff7}{
\index{TaskManager@{TaskManager}!task\_\-done@{task\_\-done}}
\index{task\_\-done@{task\_\-done}!TaskManager@{TaskManager}}
\subsubsection[{task\_\-done}]{\setlength{\rightskip}{0pt plus 5cm}void TaskManager::task\_\-done (
\begin{DoxyParamCaption}
\item[{bool}]{success, }
\item[{const string \&}]{errmsg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classTaskManager_ae09395b949cc149f47555a654c579ff7}


This indicates we are badly out of sync. We got some callback we weren't expecting, basically. That this happens with \hyperlink{protocolthe-p}{the} scenario below indicates \hyperlink{protocolthe-p}{the} task-\/manager \& task logic is busted somewhere. Reported by: Li Zhao 1. start rtrmgr from linux shell on \hyperlink{protocolthe-p}{the} system; 2. manually start xorp\_\-static\_\-routes from linux shell. This static will hijack \hyperlink{protocolthe-p}{the} xrl channels to rtrmgr; 3. use cli command \char`\"{}create protocol static\char`\"{} to start a second xorp\_\-static\_\-routes. 4. use cli command \char`\"{}delete protocol static\char`\"{} to stop static. both xorp\_\-static\_\-routes were terminated. depended process like fea, rib and policy were also terminated. rtrmgr crash.

With this check for empty task list, it at least doesn't crash, but \hyperlink{protocolthe-p}{the} logic is still busted somewhere.



The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/rtrmgr/task.hh\item 
/home/greearb/git/xorp.ct.github/xorp/rtrmgr/task.cc\end{DoxyCompactItemize}
