d
This commit is contained in:
14
v4/ctx.h
14
v4/ctx.h
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user