27 : name_(
std::move(name)), arg_names_(arg_names) {
33 msg.
name = this->name_;
36 for (
int i = 0; i <
sizeof...(Ts); i++) {
38 arg.
type = arg_types[i];
39 arg.
name = this->arg_names_[i];
40 msg.
args.push_back(arg);
46 if (req.
key != this->key_)
48 if (req.
args.size() != this->arg_names_.size())
55 virtual void execute(Ts...
x) = 0;
57 this->execute((get_execute_arg_value<Ts>(args[S]))...);
62 std::array<std::string,
sizeof...(Ts)> arg_names_;
71 void execute(Ts...
x)
override { this->trigger(
x...); }
enums::ServiceArgType type
enums::ServiceArgType to_service_arg_type()
std::vector< ListEntitiesServicesArgument > args
UserServiceTrigger(const std::string &name, const std::array< std::string, sizeof...(Ts)> &arg_names)
void execute_(std::vector< ExecuteServiceArgument > args, seq< S... > type)
T get_execute_arg_value(const ExecuteServiceArgument &arg)
void execute(Ts... x) override
ListEntitiesServicesResponse encode_list_service_response() override
bool execute_service(const ExecuteServiceRequest &req) override
UserServiceBase(std::string name, const std::array< std::string, sizeof...(Ts)> &arg_names)
std::vector< ExecuteServiceArgument > args
virtual ListEntitiesServicesResponse encode_list_service_response()=0
uint32_t fnv1_hash(const std::string &str)
Calculate a FNV-1 hash of str.
Implementation of SPI Controller mode.
virtual bool execute_service(const ExecuteServiceRequest &req)=0