|
virtual bool | execute_ (const xmlrpc_c::paramList &, xmlrpc_c::value *const retvalP)=0 |
| "execute_" is a wrapper function around the call to the commandable object's function More...
|
|
template<typename T > |
T | getParam (const xmlrpc_c::paramList ¶mList, int index) |
| Get a parameter from the parameter list. More...
|
|
template<typename T > |
T | getParam (const xmlrpc_c::paramList ¶mList, int index, T default_value) |
| Get a parameter from the parameter list, returning a default value if not found at specified location. More...
|
|
template<> |
uint64_t | getParam (const xmlrpc_c::paramList ¶mList, int index) |
| Get a parameter from the parameter list. More...
|
|
template<> |
uint32_t | getParam (const xmlrpc_c::paramList ¶mList, int index) |
| Get a parameter from the parameter list. More...
|
|
The "cmd_" class serves as the base class for all artdaq's XML-RPC commands.
JCF, 9/5/14
The "cmd_" class serves as the base class for all artdaq's XML-RPC commands, all of which use the code in the "execute()" function; each specific command type deriving from cmd_ is implemented in the execute_() function which execute() calls (notice the underscore), and optionally sets the retvalP parameter
cmd_ contains a set of template functions, getParam<T>(), which are designed to prevent implementors of derived classes from having to worry about interfacing directly with xmlrpc_c's parameter-getting functionality
Definition at line 212 of file xmlrpc_commander.cc.
template<typename T >
T artdaq::cmd_::getParam |
( |
const xmlrpc_c::paramList & |
paramList, |
|
|
int |
index, |
|
|
T |
default_value |
|
) |
| |
|
protected |
Get a parameter from the parameter list, returning a default value if not found at specified location.
- Template Parameters
-
- Parameters
-
paramList | The parameter list |
index | Index of the parameter in the parameter list |
default_value | Default value to return if exception retrieving parameter |
- Returns
- The requested parameter, or the default value if there was an exception retrieving the parameter
JCF, 9/5/14
Here, if getParam throws an exception due to a lack of an existing parameter, swallow the exception and return the default value passed to the function
Surprisingly, if an invalid index is supplied, although getParam throws an exception that exception is neither xmlrpc_c's girerr:error nor boost::bad_lexical_cast. Although it's less than ideal, we'll swallow almost all exceptions in the call to getParam, as an invalid index value simply means the user wishes to employ the default_value. I say "almost" because the only exception we don't swallow here is if an invalid parameter type "T" was supplied
Definition at line 408 of file xmlrpc_commander.cc.