EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <acts/blob/sPHENIX/thirdparty/dfelibs/dfe/dfe_dispatcher.hpp>
Classes | |
struct | Command |
Public Types | |
using | Interface = std::function< Variable(const std::vector< Variable > &)> |
The native dispatcher function interface. | |
Public Member Functions | |
void | add (std::string name, Interface &&func, std::vector< Variable::Type > &&arg_types, std::string help=std::string()) |
template<typename R , typename... Args> | |
void | add (std::string name, std::function< R(Args...)> &&func, std::string help=std::string()) |
template<typename R , typename... Args> | |
void | add (std::string name, R(*func)(Args...), std::string help=std::string()) |
template<typename T , typename R , typename... Args> | |
void | add (std::string name, R(T::*member_func)(Args...), T *t, std::string help=std::string()) |
template<typename... Args> | |
Variable | call (const std::string &name, Args &&...args) |
Call a command with arbitrary arguments. | |
Variable | call_parsed (const std::string &name, const std::vector< std::string > &args) |
Call a command with arguments parsed from strings into the expected types. | |
Variable | call_native (const std::string &name, const std::vector< Variable > &args) |
Call a command using the native argument encoding. | |
std::vector< std::string > | commands () const |
Return a list of registered commands. | |
const std::string & | help (const std::string &name) const |
Return the help text for the command. | |
Private Attributes | |
std::unordered_map < std::string, Command > | m_commands |
A simple command dispatcher.
You can register commands and call them by name.
Definition at line 106 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 106 of file dfe_dispatcher.hpp
using dfe::Dispatcher::Interface = std::function<Variable(const std::vector<Variable>&)> |
The native dispatcher function interface.
Definition at line 109 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 109 of file dfe_dispatcher.hpp
|
inline |
Register a native dispatcher function.
name | Unique function name |
func | Function object |
arg_types | Arguments types |
help | Optional help text |
Definition at line 332 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 332 of file dfe_dispatcher.hpp
References func, and m_commands.
Referenced by add().
|
inline |
Register a function with arbitrary arguments.
The return type and the argument types must be compatible with Variable
.
Definition at line 348 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 348 of file dfe_dispatcher.hpp
References add(), charm_jet_coverage::args, and func.
|
inline |
Definition at line 358 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 358 of file dfe_dispatcher.hpp
References add(), func, and Acts::IntegrationTest::R.
|
inline |
Definition at line 365 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 365 of file dfe_dispatcher.hpp
References add(), charm_jet_coverage::args, Acts::IntegrationTest::R, and return().
|
inline |
Call a command with arbitrary arguments.
Definition at line 410 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 410 of file dfe_dispatcher.hpp
References charm_jet_coverage::args.
|
inline |
Call a command using the native argument encoding.
Definition at line 377 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 377 of file dfe_dispatcher.hpp
|
inline |
Call a command with arguments parsed from strings into the expected types.
Definition at line 390 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 390 of file dfe_dispatcher.hpp
|
inline |
Return a list of registered commands.
Definition at line 416 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 416 of file dfe_dispatcher.hpp
|
inline |
Return the help text for the command.
Definition at line 426 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 426 of file dfe_dispatcher.hpp
|
private |
Definition at line 156 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 156 of file dfe_dispatcher.hpp
Referenced by add().