39 functions[functionNames] = std::move(baseFunction);
49 unique_ptr<base_function> functionPointer{ getCommand(theArgsNew->getCommandName()) };
50 if (!functionPointer.get()) {
54 functionPointer->execute(*theArgsNew);
59 jsonifier::string functionName{};
61 if (commandName.size() > 0) {
62 for (
auto const& [keyFirst, value]: functions) {
63 for (
auto& key: keyFirst) {
64 if (key.find(convertToLowerCase(commandName)) != jsonifier::string::npos) {
66 functionName = convertToLowerCase(commandName.substr(0, key.size()));
73 return createFunction(functionName);
75 return unique_ptr<base_function>{};
79 for (
auto& [key01, value01]: functions) {
80 for (
auto& value02: key01) {
81 if (functionName == value02) {
82 return value01->create();
86 return unique_ptr<base_function>{};
A co_routine - representing a potentially asynchronous operation/function.
unordered_map< jsonifier::vector< jsonifier::string >, unique_ptr< base_function > > & getFunctions()
For returning the contained map of functions.
void registerFunction(const jsonifier::vector< jsonifier::string > &functionNames, unique_ptr< base_function > baseFunction)
Registers a function to be called.
Command data, for functions executed by the command_controller.
A smart pointer class that provides unique ownership semantics.
DCA_INLINE auto newThreadAwaitable()
An awaitable that can be used to launch the co_routine onto a new thread - as well as return the hand...
DCA_INLINE unique_ptr< value_type, deleter > makeUnique(arg_types &&... args)
Helper function to create a unique_ptr for a non-array object.
The main namespace for the forward-facing interfaces.