The syntax for the arguments looks like this:
$ hey foo create string with name bar value 'Hello, World!'
Then, you can manipulate the server and object with the following commands:
$ hey foo list
string
strings
$ hey foo list strings
bar
$ hey foo get value of string bar
Hello, World!
$ hey foo delete string bar
ok
$ hey foo list strings
$
Definition at line 147 of file HeyParser.hh.
Public Types | |
enum | hp_what_t { SHUTDOWN, LIST_PROPERTIES, GET_PROPERTY, SET_PROPERTY, CREATE_PROPERTY, DELETE_PROPERTY, EXECUTE_PROPERTY, GET_SUITES, WHAT_MAX } |
Public Member Functions | |
HeyParser (int argc, const char *argv[]) throw (HeyParserException) | |
Construct a parser that interprets the given command-line arguments. | |
virtual | ~HeyParser (void) |
Deconstruct a parser object. | |
int | getArgCount (void) const |
const char ** | getArgValues (void) const |
const char * | who (void) const |
hp_what_t | what (void) const |
void | popProperty (const char *&name_out, const char *&value_out) throw (HeyParserException) |
Pop a pair from the property stack. | |
const char * | to (void) const |
void | with (const char **&with_out, size_t &count_out) const |
Get the argument array containing the 'with' name/value pairs. | |
const char * | withValue (const char *name, unsigned int instance=0, const char *default_value=NULL) const throw (HeyParserException) |
Get the value for a particular 'with' argument. | |
Static Public Attributes | |
const char * | hp_what_strings [WHAT_MAX] |
String versions of the hp_what_t enumeration values. | |
Private Member Functions | |
const char * | consumeArg (void) throw (HeyParserException) |
Consume an argument from the argument list. | |
void | nextProperty (const char *&name_out, const char *&value_out) throw (HeyParserException) |
Find the next name/value pair in the argument list. | |
Private Attributes | |
int | hp_ArgCount |
The arguments count. | |
const char ** | hp_ArgValue |
The argument values. | |
hp_what_t | hp_What |
The "what" value. | |
const char * | hp_ToValue |
The 'to' value for a SET_PROPERTY request. | |
int | hp_ArgIndex |
The current index in the argument list during processing. | |
stack< struct Pair > | hp_PropertyStack |
The stack of property pairs. |
|
Definition at line 156 of file HeyParser.hh. |
|
Construct a parser that interprets the given command-line arguments. Most of the parsing will be done here so there are fewer surprises along the way. Note that the object expects all of the arguments, including the command name.
Definition at line 38 of file HeyParser.cc. References ensure, HeyParser::Pair::p_Name, HeyParser::Pair::p_Value, and require. |
|
Consume an argument from the argument list. This method is for internal use when initially processing the argument list.
Definition at line 182 of file HeyParser.cc. References hp_ArgIndex, and hp_ArgValue. |
|
Definition at line 198 of file HeyParser.hh. Referenced by afFactoryLibraryHey(). |
|
Definition at line 206 of file HeyParser.hh. Referenced by afFactoryLibraryHey(). |
|
Find the next name/value pair in the argument list. This method differs from popProperty() in that it translates from the argument list to hp_PropertyStack. Whereas popProperty() interacts only with hp_PropertyStack.
Definition at line 198 of file HeyParser.cc. |
|
Pop a pair from the property stack.
Definition at line 245 of file HeyParser.cc. References HeyParser::Pair::p_Name, and HeyParser::Pair::p_Value. Referenced by afAllupHey(), bfHey(), bfManagerHey(), bfRealTimeTaskHey(), dfDelegateHey(), dfHey(), pfHey(), pfPartitionPolicyHey(), pfStrictPolicyHey(), pfWeightedPolicyHey(), qfKernelHey(), qfValueSCHey(), and tfHey(). |
|
Definition at line 242 of file HeyParser.hh. Referenced by bfManagerHey(), bfRealTimeTaskHey(), dfDelegateHey(), main(), pfPartitionPolicyHey(), pfStrictPolicyHey(), pfWeightedPolicyHey(), and qfValueSCHey(). |
|
Definition at line 222 of file HeyParser.hh. Referenced by afAllupHey(), bfHey(), bfManagerHey(), bfRealTimeTaskHey(), dfDelegateHey(), dfHey(), pfHey(), pfPartitionPolicyHey(), pfStrictPolicyHey(), pfWeightedPolicyHey(), qfKernelHey(), qfValueSCHey(), and tfHey(). |
|
Definition at line 214 of file HeyParser.hh. Referenced by afAllupHey(), afFactoryLibraryHey(), bfManagerHey(), bfRealTimeTaskHey(), dfDelegateHey(), pfPartitionPolicyHey(), pfStrictPolicyHey(), pfWeightedPolicyHey(), qfKernelHey(), and qfValueSCHey(). |
|
Get the argument array containing the 'with' name/value pairs.
Definition at line 264 of file HeyParser.cc. References hp_ArgCount, and hp_ArgValue. Referenced by bfManagerHey(). |
|
Get the value for a particular 'with' argument.
Definition at line 270 of file HeyParser.cc. References require. Referenced by afAllupHey(), bfHey(), bfManagerHey(), bfRealTimeTaskHey(), dfDelegateHey(), pfHey(), and qfKernelHey(). |
|
The "what" value. This will only be set by the constructor when it is initially parsing the arguments. Definition at line 354 of file HeyParser.hh. |
|
Initial value: { "shutdown", "list", "get", "set", "create", "delete", "execute", "getsuites", }
Definition at line 27 of file HeyParser.cc. |