\hypertarget{classcore_1_1Command}{}\section{core\+:\+:Command Class Reference}
\label{classcore_1_1Command}\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_1Command__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for core\+:\+:Command\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=166pt]{classcore_1_1Command__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual bool \hyperlink{classcore_1_1Command_abdc0d7a4693a7f7940bbae20c4a667c0}{check} (std\+::string request)
\item 
virtual int \hyperlink{classcore_1_1Command_a068ebc22f7a067cf23ed2c17f95b06e9}{process\+Command} (std\+::string request, \hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session} $\ast$session, std\+::stringstream \&data)
\item 
virtual void \hyperlink{classcore_1_1Command_a314aef05f78aacb802097f8ae0875291}{output} (Session $\ast$session)
\item 
void \hyperlink{classcore_1_1Command_ad8b0321c64838f4d5c8f93461b97cfef}{set\+Name} (std\+::string name)
\item 
\mbox{\Hypertarget{classcore_1_1Command_aa63cf88493b2a1b775b5b93b07e79324}\label{classcore_1_1Command_aa63cf88493b2a1b775b5b93b07e79324}} 
std\+::string {\bfseries get\+Name} ()
\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}


\subsection{Detailed Description}
\hyperlink{classcore_1_1Command}{Command}

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

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classcore_1_1Command_abdc0d7a4693a7f7940bbae20c4a667c0}\label{classcore_1_1Command_abdc0d7a4693a7f7940bbae20c4a667c0}} 
\index{core\+::\+Command@{core\+::\+Command}!check@{check}}
\index{check@{check}!core\+::\+Command@{core\+::\+Command}}
\subsubsection{\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 \hyperlink{classcore_1_1CommandList}{Command\+List}. This can be overridden by implementing the \hyperlink{classcore_1_1Command_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_1Command_a314aef05f78aacb802097f8ae0875291}\label{classcore_1_1Command_a314aef05f78aacb802097f8ae0875291}} 
\index{core\+::\+Command@{core\+::\+Command}!output@{output}}
\index{output@{output}!core\+::\+Command@{core\+::\+Command}}
\subsubsection{\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_1Command_a068ebc22f7a067cf23ed2c17f95b06e9}\label{classcore_1_1Command_a068ebc22f7a067cf23ed2c17f95b06e9}} 
\index{core\+::\+Command@{core\+::\+Command}!process\+Command@{process\+Command}}
\index{process\+Command@{process\+Command}!core\+::\+Command@{core\+::\+Command}}
\subsubsection{\texorpdfstring{process\+Command()}{processCommand()}}
{\footnotesize\ttfamily int core\+::\+Command\+::process\+Command (\begin{DoxyParamCaption}\item[{std\+::string}]{request,  }\item[{\hyperlink{classcore_1_1TCPSession}{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 \hyperlink{classcore_1_1EPoll_a0c2d7fdaec43d0a15abab0399d5727df}{core\+::\+E\+Poll}, \hyperlink{classcore_1_1TCPServer_a93f64f81bc63f145799af91138a064dc}{core\+::\+T\+C\+P\+Server}, and \hyperlink{classcore_1_1CommandList_a98939555ca061b445019a841726e3ef6}{core\+::\+Command\+List}.

\mbox{\Hypertarget{classcore_1_1Command_ad8b0321c64838f4d5c8f93461b97cfef}\label{classcore_1_1Command_ad8b0321c64838f4d5c8f93461b97cfef}} 
\index{core\+::\+Command@{core\+::\+Command}!set\+Name@{set\+Name}}
\index{set\+Name@{set\+Name}!core\+::\+Command@{core\+::\+Command}}
\subsubsection{\texorpdfstring{set\+Name()}{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 \hyperlink{classcore_1_1Command}{Command} to a \hyperlink{classcore_1_1CommandList}{Command\+List} using the add() method contains a parameter to pass the name of the \hyperlink{classcore_1_1Command}{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 
Command.\+h\item 
Command.\+cpp\end{DoxyCompactItemize}
