\hypertarget{classRunShellCommand}{
\section{RunShellCommand Class Reference}
\label{classRunShellCommand}\index{RunShellCommand@{RunShellCommand}}
}


A class for running an external command by invoking a shell.  




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

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

\item 
\hypertarget{classRunShellCommand_aa48738b9d63b8d3f2dc41b016eef4a80}{
typedef XorpCallback3$<$ void, \hyperlink{classRunShellCommand}{RunShellCommand} $\ast$, bool, const string \& $>$::RefPtr {\bfseries DoneCallback}}
\label{classRunShellCommand_aa48738b9d63b8d3f2dc41b016eef4a80}

\item 
\hypertarget{classRunShellCommand_ac2f871f9f206c32f41692f2871b5f706}{
typedef XorpCallback2$<$ void, \hyperlink{classRunShellCommand}{RunShellCommand} $\ast$, int $>$::RefPtr {\bfseries StoppedCallback}}
\label{classRunShellCommand_ac2f871f9f206c32f41692f2871b5f706}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classRunShellCommand_a26f9078201025ac016bd689811be4fd4}{RunShellCommand} (\hyperlink{classEventLoop}{EventLoop} \&eventloop, const string \&command, const string \&argument\_\-string, RunShellCommand::OutputCallback stdout\_\-cb, RunShellCommand::OutputCallback stderr\_\-cb, RunShellCommand::DoneCallback done\_\-cb, 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{classRunShellCommand_aa2f5be06bddb053ede6a73bb525c7501}{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{classRunShellCommand_a97e8ba432ed1b07bbb56ed08a52817e0}{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{classRunShellCommand_a7c388ff46cdfc24f5adc7c400022f6b6}{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{classRunShellCommand_ae2447c9489acea8b54b551947eadb421}{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{classRunShellCommand_a52d8c1c3c580b77ba575233e80818c4b}{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{classRunShellCommand_a8ed250ed459f7a9bce2c2530e8a55f85}{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{classRunShellCommand_acd70cb778095b80627872ea8d01427e3}{
OutputCallback {\bfseries \_\-stdout\_\-cb}}
\label{classRunShellCommand_acd70cb778095b80627872ea8d01427e3}

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

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

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

\end{DoxyCompactItemize}


\subsection{Detailed Description}
A class for running an external command by invoking a shell. 

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


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\_\-string} & \hyperlink{protocolthe-p}{the} string 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 task\_\-priority} & \hyperlink{protocolthe-p}{the} priority to read stdout and stderr. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classRunShellCommand_ae2447c9489acea8b54b551947eadb421}{
\index{RunShellCommand@{RunShellCommand}!done\_\-cb\_\-dispatch@{done\_\-cb\_\-dispatch}}
\index{done\_\-cb\_\-dispatch@{done\_\-cb\_\-dispatch}!RunShellCommand@{RunShellCommand}}
\subsubsection[{done\_\-cb\_\-dispatch}]{\setlength{\rightskip}{0pt plus 5cm}void RunShellCommand::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{classRunShellCommand_ae2447c9489acea8b54b551947eadb421}


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{classRunShellCommand_a8ed250ed459f7a9bce2c2530e8a55f85}{
\index{RunShellCommand@{RunShellCommand}!redirect\_\-stderr\_\-to\_\-stdout@{redirect\_\-stderr\_\-to\_\-stdout}}
\index{redirect\_\-stderr\_\-to\_\-stdout@{redirect\_\-stderr\_\-to\_\-stdout}!RunShellCommand@{RunShellCommand}}
\subsubsection[{redirect\_\-stderr\_\-to\_\-stdout}]{\setlength{\rightskip}{0pt plus 5cm}bool RunShellCommand::redirect\_\-stderr\_\-to\_\-stdout (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline, private, virtual\mbox{]}}}}
\label{classRunShellCommand_a8ed250ed459f7a9bce2c2530e8a55f85}


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{classRunShellCommand_aa2f5be06bddb053ede6a73bb525c7501}{
\index{RunShellCommand@{RunShellCommand}!set\_\-stopped\_\-cb@{set\_\-stopped\_\-cb}}
\index{set\_\-stopped\_\-cb@{set\_\-stopped\_\-cb}!RunShellCommand@{RunShellCommand}}
\subsubsection[{set\_\-stopped\_\-cb}]{\setlength{\rightskip}{0pt plus 5cm}void RunShellCommand::set\_\-stopped\_\-cb (
\begin{DoxyParamCaption}
\item[{StoppedCallback}]{cb}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classRunShellCommand_aa2f5be06bddb053ede6a73bb525c7501}


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{classRunShellCommand_a7c388ff46cdfc24f5adc7c400022f6b6}{
\index{RunShellCommand@{RunShellCommand}!stderr\_\-cb\_\-dispatch@{stderr\_\-cb\_\-dispatch}}
\index{stderr\_\-cb\_\-dispatch@{stderr\_\-cb\_\-dispatch}!RunShellCommand@{RunShellCommand}}
\subsubsection[{stderr\_\-cb\_\-dispatch}]{\setlength{\rightskip}{0pt plus 5cm}void RunShellCommand::stderr\_\-cb\_\-dispatch (
\begin{DoxyParamCaption}
\item[{const string \&}]{output}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, private, virtual\mbox{]}}}}
\label{classRunShellCommand_a7c388ff46cdfc24f5adc7c400022f6b6}


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{classRunShellCommand_a97e8ba432ed1b07bbb56ed08a52817e0}{
\index{RunShellCommand@{RunShellCommand}!stdout\_\-cb\_\-dispatch@{stdout\_\-cb\_\-dispatch}}
\index{stdout\_\-cb\_\-dispatch@{stdout\_\-cb\_\-dispatch}!RunShellCommand@{RunShellCommand}}
\subsubsection[{stdout\_\-cb\_\-dispatch}]{\setlength{\rightskip}{0pt plus 5cm}void RunShellCommand::stdout\_\-cb\_\-dispatch (
\begin{DoxyParamCaption}
\item[{const string \&}]{output}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, private, virtual\mbox{]}}}}
\label{classRunShellCommand_a97e8ba432ed1b07bbb56ed08a52817e0}


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{classRunShellCommand_a52d8c1c3c580b77ba575233e80818c4b}{
\index{RunShellCommand@{RunShellCommand}!stopped\_\-cb\_\-dispatch@{stopped\_\-cb\_\-dispatch}}
\index{stopped\_\-cb\_\-dispatch@{stopped\_\-cb\_\-dispatch}!RunShellCommand@{RunShellCommand}}
\subsubsection[{stopped\_\-cb\_\-dispatch}]{\setlength{\rightskip}{0pt plus 5cm}void RunShellCommand::stopped\_\-cb\_\-dispatch (
\begin{DoxyParamCaption}
\item[{int}]{stop\_\-signal}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, private, virtual\mbox{]}}}}
\label{classRunShellCommand_a52d8c1c3c580b77ba575233e80818c4b}


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}
