33 #include "SampleSayCommand.h" 34 #include "BESTokenizer.h" 35 #include "BESResponseHandlerList.h" 36 #include "BESSyntaxUserError.h" 37 #include "SampleResponseNames.h" 40 SampleSayCommand::parse_request(
BESTokenizer &tokenizer,
47 dhi.
action = SAY_RESPONSE ;
49 BESResponseHandlerList::TheList()->
find_handler( SAY_RESPONSE ) ;
52 string s = (string)
"No response handler for command " + SAY_RESPONSE ;
59 tokenizer.
parse_error( my_token +
" not expected\n" ) ;
63 dhi.
data[SAY_WHAT] = my_token ;
67 if( my_token !=
"to" )
69 tokenizer.
parse_error( my_token +
" not expected\n" ) ;
76 tokenizer.
parse_error( my_token +
" not expected\n" ) ;
78 dhi.
data[SAY_TO] = my_token ;
84 tokenizer.
parse_error( my_token +
" not expected\n" ) ;
99 strm << BESIndent::LMarg <<
"SampleSayCommand::dump - (" 100 << (
void *)
this <<
")" << endl ;
101 BESIndent::Indent() ;
102 BESCommand::dump( strm ) ;
103 BESIndent::UnIndent() ;
virtual BESResponseHandler * find_handler(const string &handler)
returns the response handler with the given name from the list
tokenizer for the BES request command string
string & get_next_token()
returns the next token from the token list
error thrown if there is a user syntax error in the request or any other user error ...
handler object that knows how to create a specific response object
Structure storing information used by the BES to handle the request.
map< string, string > data
the map of string data that will be required for the current request.
void parse_error(const string &s="")
throws an exception giving the tokens up to the point of the problem
string action
the response object requested, e.g. das, dds
virtual void dump(ostream &strm) const
dumps information about this object