\hypertarget{classRunCommand}{
\section{RunCommand Class Reference}
\label{classRunCommand}\index{RunCommand@{RunCommand}}
}


A class for running an external command.  




{\ttfamily \#include $<$run\_\-command.hh$>$}

Inheritance diagram for RunCommand:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classRunCommand}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classRunCommand_a7e5c3732e79e3e1e4beb98abc5f2de9f}{
typedef XorpCallback2$<$ void, \hyperlink{classRunCommand}{RunCommand} $\ast$, const string \& $>$::RefPtr {\bfseries OutputCallback}}
\label{classRunCommand_a7e5c3732e79e3e1e4beb98abc5f2de9f}

\item 
\hypertarget{classRunCommand_a048b8161d6a14c0d0b8aeb262b75e16b}{
typedef XorpCallback3$<$ void, \hyperlink{classRunCommand}{RunCommand} $\ast$, bool, const string \& $>$::RefPtr {\bfseries DoneCallback}}
\label{classRunCommand_a048b8161d6a14c0d0b8aeb262b75e16b}

\item 
\hypertarget{classRunCommand_a4b1832dc9db91ab5974e3b9027bbd862}{
typedef XorpCallback2$<$ void, \hyperlink{classRunCommand}{RunCommand} $\ast$, int $>$::RefPtr {\bfseries StoppedCallback}}
\label{classRunCommand_a4b1832dc9db91ab5974e3b9027bbd862}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classRunCommand_a3fb275d2289b26459c2d64ab9f2c35d7}{RunCommand} (\hyperlink{classEventLoop}{EventLoop} \&eventloop, const string \&command, const list$<$ string $>$ \&argument\_\-list, RunCommand::OutputCallback stdout\_\-cb, RunCommand::OutputCallback stderr\_\-cb, RunCommand::DoneCallback done\_\-cb, bool redirect\_\-stderr\_\-to\_\-stdout, int task\_\-priority=XorpTask::PRIORITY\_\-DEFAULT)
\begin{DoxyCompactList}\small\item\em Constructor for a given command and its list with arguments. \item\end{DoxyCompactList}\item 
void \hyperlink{classRunCommand_a1b0793739535dec588bd6d637a31f634}{set\_\-stopped\_\-cb} (StoppedCallback cb)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} callback to dispatch when \hyperlink{protocolthe-p}{the} program is stopped. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classRunCommand_ac5fe3e77edfa318382a751c82cf29960}{stdout\_\-cb\_\-dispatch} (const string \&output)
\begin{DoxyCompactList}\small\item\em A method called when there is output on \hyperlink{protocolthe-p}{the} program's stdout. \item\end{DoxyCompactList}\item 
void \hyperlink{classRunCommand_a16293958b5060404c58729ef07765c92}{stderr\_\-cb\_\-dispatch} (const string \&output)
\begin{DoxyCompactList}\small\item\em A method called when there is output on \hyperlink{protocolthe-p}{the} program's stderr. \item\end{DoxyCompactList}\item 
void \hyperlink{classRunCommand_a809093e0ce9afd9ca851c2107774c0a5}{done\_\-cb\_\-dispatch} (bool success, const string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em A method called when \hyperlink{protocolthe-p}{the} program execution is completed. \item\end{DoxyCompactList}\item 
void \hyperlink{classRunCommand_ae9521a86c411b5e30eb14c93cf40bfdc}{stopped\_\-cb\_\-dispatch} (int stop\_\-signal)
\begin{DoxyCompactList}\small\item\em A method called when \hyperlink{protocolthe-p}{the} program has been stopped. \item\end{DoxyCompactList}\item 
bool \hyperlink{classRunCommand_a033add2c10867058846aa8fd0be28590}{redirect\_\-stderr\_\-to\_\-stdout} () const 
\begin{DoxyCompactList}\small\item\em Test if \hyperlink{protocolthe-p}{the} stderr should be redirected to stdout. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classRunCommand_a64f49fb9dbd933ebd89c8893039af884}{
OutputCallback {\bfseries \_\-stdout\_\-cb}}
\label{classRunCommand_a64f49fb9dbd933ebd89c8893039af884}

\item 
\hypertarget{classRunCommand_aa9a1615b56fb1feb40f0f13350143d48}{
OutputCallback {\bfseries \_\-stderr\_\-cb}}
\label{classRunCommand_aa9a1615b56fb1feb40f0f13350143d48}

\item 
\hypertarget{classRunCommand_add84f18fdb732ca262c2560b8c162b5e}{
DoneCallback {\bfseries \_\-done\_\-cb}}
\label{classRunCommand_add84f18fdb732ca262c2560b8c162b5e}

\item 
\hypertarget{classRunCommand_abe238782ea2fec8437b06006f2d6e133}{
StoppedCallback {\bfseries \_\-stopped\_\-cb}}
\label{classRunCommand_abe238782ea2fec8437b06006f2d6e133}

\item 
\hypertarget{classRunCommand_a5c34345eb3cc1b112b6dda4b693f7da4}{
bool {\bfseries \_\-redirect\_\-stderr\_\-to\_\-stdout}}
\label{classRunCommand_a5c34345eb3cc1b112b6dda4b693f7da4}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
A class for running an external command. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classRunCommand_a3fb275d2289b26459c2d64ab9f2c35d7}{
\index{RunCommand@{RunCommand}!RunCommand@{RunCommand}}
\index{RunCommand@{RunCommand}!RunCommand@{RunCommand}}
\subsubsection[{RunCommand}]{\setlength{\rightskip}{0pt plus 5cm}RunCommand::RunCommand (
\begin{DoxyParamCaption}
\item[{{\bf EventLoop} \&}]{eventloop, }
\item[{const string \&}]{command, }
\item[{const list$<$ string $>$ \&}]{argument\_\-list, }
\item[{RunCommand::OutputCallback}]{stdout\_\-cb, }
\item[{RunCommand::OutputCallback}]{stderr\_\-cb, }
\item[{RunCommand::DoneCallback}]{done\_\-cb, }
\item[{bool}]{redirect\_\-stderr\_\-to\_\-stdout, }
\item[{int}]{task\_\-priority = {\ttfamily XorpTask::PRIORITY\_\-DEFAULT}}
\end{DoxyParamCaption}
)}}
\label{classRunCommand_a3fb275d2289b26459c2d64ab9f2c35d7}


Constructor for a given command and its list with arguments. 


\begin{DoxyParams}{Parameters}
{\em eventloop} & \hyperlink{protocolthe-p}{the} event loop. \\
\hline
{\em command} & \hyperlink{protocolthe-p}{the} command to execute. \\
\hline
{\em argument\_\-list} & \hyperlink{protocolthe-p}{the} list with \hyperlink{protocolthe-p}{the} arguments for \hyperlink{protocolthe-p}{the} command to execute. \\
\hline
{\em stdout\_\-cb} & \hyperlink{protocolthe-p}{the} callback to call when there is data on \hyperlink{protocolthe-p}{the} standard output. \\
\hline
{\em stderr\_\-cb} & \hyperlink{protocolthe-p}{the} callback to call when there is data on \hyperlink{protocolthe-p}{the} standard error. \\
\hline
{\em done\_\-cb} & \hyperlink{protocolthe-p}{the} callback to call when \hyperlink{protocolthe-p}{the} command is completed. \\
\hline
{\em redirect\_\-stderr\_\-to\_\-stdout} & if true redirect \hyperlink{protocolthe-p}{the} stderr to stdout. \\
\hline
{\em task\_\-priority} & \hyperlink{protocolthe-p}{the} priority to read stdout and stderr. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classRunCommand_a809093e0ce9afd9ca851c2107774c0a5}{
\index{RunCommand@{RunCommand}!done\_\-cb\_\-dispatch@{done\_\-cb\_\-dispatch}}
\index{done\_\-cb\_\-dispatch@{done\_\-cb\_\-dispatch}!RunCommand@{RunCommand}}
\subsubsection[{done\_\-cb\_\-dispatch}]{\setlength{\rightskip}{0pt plus 5cm}void RunCommand::done\_\-cb\_\-dispatch (
\begin{DoxyParamCaption}
\item[{bool}]{success, }
\item[{const string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, private, virtual\mbox{]}}}}
\label{classRunCommand_a809093e0ce9afd9ca851c2107774c0a5}


A method called when \hyperlink{protocolthe-p}{the} program execution is completed. 


\begin{DoxyParams}{Parameters}
{\em success} & if true \hyperlink{protocolthe-p}{the} program execution has succeeded, otherwise it has failed. \\
\hline
{\em error\_\-msg} & if error, \hyperlink{protocolthe-p}{the} string with \hyperlink{protocolthe-p}{the} error message. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classRunCommandBase_a4aa3c786fd92edb82a88a137e8e6a168}{RunCommandBase}.

\hypertarget{classRunCommand_a033add2c10867058846aa8fd0be28590}{
\index{RunCommand@{RunCommand}!redirect\_\-stderr\_\-to\_\-stdout@{redirect\_\-stderr\_\-to\_\-stdout}}
\index{redirect\_\-stderr\_\-to\_\-stdout@{redirect\_\-stderr\_\-to\_\-stdout}!RunCommand@{RunCommand}}
\subsubsection[{redirect\_\-stderr\_\-to\_\-stdout}]{\setlength{\rightskip}{0pt plus 5cm}bool RunCommand::redirect\_\-stderr\_\-to\_\-stdout (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline, private, virtual\mbox{]}}}}
\label{classRunCommand_a033add2c10867058846aa8fd0be28590}


Test if \hyperlink{protocolthe-p}{the} stderr should be redirected to stdout. 

\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} stderr should be redirected to stdout, otherwise false. 
\end{DoxyReturn}


Implements \hyperlink{classRunCommandBase_ac01e741861440cee2d8020099f4f3af3}{RunCommandBase}.

\hypertarget{classRunCommand_a1b0793739535dec588bd6d637a31f634}{
\index{RunCommand@{RunCommand}!set\_\-stopped\_\-cb@{set\_\-stopped\_\-cb}}
\index{set\_\-stopped\_\-cb@{set\_\-stopped\_\-cb}!RunCommand@{RunCommand}}
\subsubsection[{set\_\-stopped\_\-cb}]{\setlength{\rightskip}{0pt plus 5cm}void RunCommand::set\_\-stopped\_\-cb (
\begin{DoxyParamCaption}
\item[{StoppedCallback}]{cb}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classRunCommand_a1b0793739535dec588bd6d637a31f634}


Set \hyperlink{protocolthe-p}{the} callback to dispatch when \hyperlink{protocolthe-p}{the} program is stopped. 


\begin{DoxyParams}{Parameters}
{\em cb} & \hyperlink{protocolthe-p}{the} callback's value. \\
\hline
\end{DoxyParams}
\hypertarget{classRunCommand_a16293958b5060404c58729ef07765c92}{
\index{RunCommand@{RunCommand}!stderr\_\-cb\_\-dispatch@{stderr\_\-cb\_\-dispatch}}
\index{stderr\_\-cb\_\-dispatch@{stderr\_\-cb\_\-dispatch}!RunCommand@{RunCommand}}
\subsubsection[{stderr\_\-cb\_\-dispatch}]{\setlength{\rightskip}{0pt plus 5cm}void RunCommand::stderr\_\-cb\_\-dispatch (
\begin{DoxyParamCaption}
\item[{const string \&}]{output}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, private, virtual\mbox{]}}}}
\label{classRunCommand_a16293958b5060404c58729ef07765c92}


A method called when there is output on \hyperlink{protocolthe-p}{the} program's stderr. 


\begin{DoxyParams}{Parameters}
{\em output} & \hyperlink{protocolthe-p}{the} string with \hyperlink{protocolthe-p}{the} output. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classRunCommandBase_a833ab982fedea6e028a5ededd42cafb9}{RunCommandBase}.

\hypertarget{classRunCommand_ac5fe3e77edfa318382a751c82cf29960}{
\index{RunCommand@{RunCommand}!stdout\_\-cb\_\-dispatch@{stdout\_\-cb\_\-dispatch}}
\index{stdout\_\-cb\_\-dispatch@{stdout\_\-cb\_\-dispatch}!RunCommand@{RunCommand}}
\subsubsection[{stdout\_\-cb\_\-dispatch}]{\setlength{\rightskip}{0pt plus 5cm}void RunCommand::stdout\_\-cb\_\-dispatch (
\begin{DoxyParamCaption}
\item[{const string \&}]{output}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, private, virtual\mbox{]}}}}
\label{classRunCommand_ac5fe3e77edfa318382a751c82cf29960}


A method called when there is output on \hyperlink{protocolthe-p}{the} program's stdout. 


\begin{DoxyParams}{Parameters}
{\em output} & \hyperlink{protocolthe-p}{the} string with \hyperlink{protocolthe-p}{the} output. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classRunCommandBase_a50f880e4432f18bb183ef3f6ad07bd1d}{RunCommandBase}.

\hypertarget{classRunCommand_ae9521a86c411b5e30eb14c93cf40bfdc}{
\index{RunCommand@{RunCommand}!stopped\_\-cb\_\-dispatch@{stopped\_\-cb\_\-dispatch}}
\index{stopped\_\-cb\_\-dispatch@{stopped\_\-cb\_\-dispatch}!RunCommand@{RunCommand}}
\subsubsection[{stopped\_\-cb\_\-dispatch}]{\setlength{\rightskip}{0pt plus 5cm}void RunCommand::stopped\_\-cb\_\-dispatch (
\begin{DoxyParamCaption}
\item[{int}]{stop\_\-signal}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, private, virtual\mbox{]}}}}
\label{classRunCommand_ae9521a86c411b5e30eb14c93cf40bfdc}


A method called when \hyperlink{protocolthe-p}{the} program has been stopped. 


\begin{DoxyParams}{Parameters}
{\em stop\_\-signal} & \hyperlink{protocolthe-p}{the} signal used to stop \hyperlink{protocolthe-p}{the} program. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classRunCommandBase_a44d555a1227851a4d57c446aa25af125}{RunCommandBase}.



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