\hypertarget{classcore_1_1_command}{}\doxysection{core\+::Command Class Reference}
\label{classcore_1_1_command}\index{core::Command@{core::Command}}


{\ttfamily \#include $<$Command.\+h$>$}



Inheritance diagram for core\+::Command\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classcore_1_1_command__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for core\+::Command\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=174pt]{classcore_1_1_command__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual bool \mbox{\hyperlink{classcore_1_1_command_abdc0d7a4693a7f7940bbae20c4a667c0}{check}} (std\+::string request)
\item 
virtual int \mbox{\hyperlink{classcore_1_1_command_a068ebc22f7a067cf23ed2c17f95b06e9}{process\+Command}} (std\+::string request, \mbox{\hyperlink{classcore_1_1_t_c_p_session}{T\+C\+P\+Session}} $\ast$session, std\+::stringstream \&data)
\item 
virtual void \mbox{\hyperlink{classcore_1_1_command_a314aef05f78aacb802097f8ae0875291}{output}} (Session $\ast$session)
\item 
void \mbox{\hyperlink{classcore_1_1_command_ad8b0321c64838f4d5c8f93461b97cfef}{set\+Name}} (std\+::string name)
\item 
std\+::string \mbox{\hyperlink{classcore_1_1_command_aa63cf88493b2a1b775b5b93b07e79324}{get\+Name}} ()
\end{DoxyCompactItemize}
\doxysubsection*{Additional Inherited Members}


\doxysubsection{Detailed Description}
\mbox{\hyperlink{classcore_1_1_command}{Command}}

Use the \mbox{\hyperlink{classcore_1_1_command}{Command}} object in combination with a \mbox{\hyperlink{classcore_1_1_command_list}{Command\+List}} object to maintain a list of functions that can be invoked as a result of processing a request. 

\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classcore_1_1_command_abdc0d7a4693a7f7940bbae20c4a667c0}\label{classcore_1_1_command_abdc0d7a4693a7f7940bbae20c4a667c0}} 
\index{core::Command@{core::Command}!check@{check}}
\index{check@{check}!core::Command@{core::Command}}
\doxysubsubsection{\texorpdfstring{check()}{check()}}
{\footnotesize\ttfamily bool core\+::\+Command\+::check (\begin{DoxyParamCaption}\item[{std\+::string}]{request }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Implement check method to provide a special check rule upon the request to see if the command should be processed.

The default rule is to verify that the first token in the request string matches the name given on the registration of the command to the \mbox{\hyperlink{classcore_1_1_command_list}{Command\+List}}. This can be overridden by implementing the \mbox{\hyperlink{classcore_1_1_command_abdc0d7a4693a7f7940bbae20c4a667c0}{check()}} method to perform the test and return the condition of the command.


\begin{DoxyParams}{Parameters}
{\em request} & The request passed to the parser to check the rule. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Return true to execute the command. Returning false will cause no action on this command. 
\end{DoxyReturn}
\mbox{\Hypertarget{classcore_1_1_command_aa63cf88493b2a1b775b5b93b07e79324}\label{classcore_1_1_command_aa63cf88493b2a1b775b5b93b07e79324}} 
\index{core::Command@{core::Command}!getName@{getName}}
\index{getName@{getName}!core::Command@{core::Command}}
\doxysubsubsection{\texorpdfstring{getName()}{getName()}}
{\footnotesize\ttfamily std\+::string core\+::\+Command\+::get\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

\mbox{\Hypertarget{classcore_1_1_command_a314aef05f78aacb802097f8ae0875291}\label{classcore_1_1_command_a314aef05f78aacb802097f8ae0875291}} 
\index{core::Command@{core::Command}!output@{output}}
\index{output@{output}!core::Command@{core::Command}}
\doxysubsubsection{\texorpdfstring{output()}{output()}}
{\footnotesize\ttfamily void core\+::\+Command\+::output (\begin{DoxyParamCaption}\item[{Session $\ast$}]{session }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Specify the output that will occur to the specified session.


\begin{DoxyParams}{Parameters}
{\em session} & The session that will receive the output. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classcore_1_1_command_a068ebc22f7a067cf23ed2c17f95b06e9}\label{classcore_1_1_command_a068ebc22f7a067cf23ed2c17f95b06e9}} 
\index{core::Command@{core::Command}!processCommand@{processCommand}}
\index{processCommand@{processCommand}!core::Command@{core::Command}}
\doxysubsubsection{\texorpdfstring{processCommand()}{processCommand()}}
{\footnotesize\ttfamily int core\+::\+Command\+::process\+Command (\begin{DoxyParamCaption}\item[{std\+::string}]{request,  }\item[{\mbox{\hyperlink{classcore_1_1_t_c_p_session}{T\+C\+P\+Session}} $\ast$}]{session,  }\item[{std\+::stringstream \&}]{data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

This method is used to implement the functionality of the requested command. This pure virtual function must be implemented in your inheriting object.


\begin{DoxyParams}{Parameters}
{\em request} & The request that was entered by the user to invoke this command. \\
\hline
{\em session} & Specify the requesting session so that the execution of the command process can return its output to the session. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns 0 if execution of the command was successful. Otherwise returns a non-\/zero value indicating an error condition. 
\end{DoxyReturn}


Reimplemented in \mbox{\hyperlink{classcore_1_1_command_list_a98939555ca061b445019a841726e3ef6}{core\+::\+Command\+List}}, \mbox{\hyperlink{classcore_1_1_e_poll_a0c2d7fdaec43d0a15abab0399d5727df}{core\+::\+E\+Poll}}, and \mbox{\hyperlink{classcore_1_1_t_c_p_server_a93f64f81bc63f145799af91138a064dc}{core\+::\+T\+C\+P\+Server}}.

\mbox{\Hypertarget{classcore_1_1_command_ad8b0321c64838f4d5c8f93461b97cfef}\label{classcore_1_1_command_ad8b0321c64838f4d5c8f93461b97cfef}} 
\index{core::Command@{core::Command}!setName@{setName}}
\index{setName@{setName}!core::Command@{core::Command}}
\doxysubsubsection{\texorpdfstring{setName()}{setName()}}
{\footnotesize\ttfamily void core\+::\+Command\+::set\+Name (\begin{DoxyParamCaption}\item[{std\+::string}]{name }\end{DoxyParamCaption})}

Set the name of this command used in default rule checking during request parsing. N\+O\+TE\+: You do not need to call this under normal conditions as adding a \mbox{\hyperlink{classcore_1_1_command}{Command}} to a \mbox{\hyperlink{classcore_1_1_command_list}{Command\+List}} using the add() method contains a parameter to pass the name of the \mbox{\hyperlink{classcore_1_1_command}{Command}}.


\begin{DoxyParams}{Parameters}
{\em name} & Specify the name of this command for default parsing. \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{_command_8h}{Command.\+h}}\item 
\mbox{\hyperlink{_command_8cpp}{Command.\+cpp}}\end{DoxyCompactItemize}
