This commit is contained in:
Михаил Капелько committed 2024-06-08 22:09:22 +03:00
1 parent 43776b4172
commit 15c4c62b11
2 files changed
+12 -7

No files matched your search

+10 -4
View File
@@ -45,10 +45,6 @@ template <class T> class ctx_Controller {
isProcessingQueue = false;
}
void registerFunction(std::function<T(T)> f) {
functions.push_back(f);
}
void registerCallback(std::function<void(T)> cb) {
callbacks.push_back(cb);
}
@@ -65,6 +61,16 @@ template <class T> class ctx_Controller {
callbacks.push_back(execCB);
}
void registerFunction(std::function<T(T)> f) {
functions.push_back(f);
}
void registerFunctions(std::list<std::function<T(T)> > funcs) {
for (const auto &f : funcs) {
functions.push_back(f);
}
}
void reportContext() {
for (const auto &cb : callbacks) {
cb(context);
+2 -3
View File
@@ -81,8 +81,6 @@ int main() {
ctrl.registerFunctions({
cli_exit,
cli_goOn,
});
/*
cli_greetUser,
cli_promptSecondItemSelection,
cli_reportMatchedItems,
@@ -95,7 +93,8 @@ int main() {
memory_generateConstPlayfield,
memory_hideMatchingItems,
memory_selectItem,
])
});
/*
auto c = shell_createContext();
c.cCLI = cli_createContext();