ServerCore/latex/classcore_1_1Command.tex

120 lines
6.3 KiB
TeX

\hypertarget{classcore_1_1Command}{}\doxysection{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=174pt]{classcore_1_1Command__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
virtual bool \mbox{\hyperlink{classcore_1_1Command_af9b8d8b3a6d6566f86e0abcb0d10f905}{check}} (coreutils\+::\+Z\+String request)
\item
virtual int \mbox{\hyperlink{classcore_1_1Command_ad8eecee5b179a0030d2f34bcfa30d4f4}{process\+Command}} (coreutils\+::\+Z\+String request, \mbox{\hyperlink{classcore_1_1TCPSession}{T\+C\+P\+Session}} $\ast$session, std\+::stringstream \&data)
\item
virtual void \mbox{\hyperlink{classcore_1_1Command_a314aef05f78aacb802097f8ae0875291}{output}} (Session $\ast$session)
\item
void \mbox{\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}
\doxysubsection*{Additional Inherited Members}
\doxysubsection{Detailed Description}
\mbox{\hyperlink{classcore_1_1Command}{Command}}
Use the \mbox{\hyperlink{classcore_1_1Command}{Command}} object in combination with a \mbox{\hyperlink{classcore_1_1CommandList}{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_1Command_af9b8d8b3a6d6566f86e0abcb0d10f905}\label{classcore_1_1Command_af9b8d8b3a6d6566f86e0abcb0d10f905}}
\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[{coreutils\+::\+Z\+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_1CommandList}{Command\+List}}. This can be overridden by implementing the \mbox{\hyperlink{classcore_1_1Command_af9b8d8b3a6d6566f86e0abcb0d10f905}{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}}
\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_1Command_ad8eecee5b179a0030d2f34bcfa30d4f4}\label{classcore_1_1Command_ad8eecee5b179a0030d2f34bcfa30d4f4}}
\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[{coreutils\+::\+Z\+String}]{request, }\item[{\mbox{\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 \mbox{\hyperlink{classcore_1_1EPoll_a5cb8a89fb45922c8c88472ec3eae7858}{core\+::\+E\+Poll}}, and \mbox{\hyperlink{classcore_1_1TCPServer_ad08e04a2ff44c9c40419cdc6bd0e4b79}{core\+::\+T\+C\+P\+Server}}.
\mbox{\Hypertarget{classcore_1_1Command_ad8b0321c64838f4d5c8f93461b97cfef}\label{classcore_1_1Command_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_1Command}{Command}} to a \mbox{\hyperlink{classcore_1_1CommandList}{Command\+List}} using the add() method contains a parameter to pass the name of the \mbox{\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}