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;
|
isProcessingQueue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerFunction(std::function<T(T)> f) {
|
|
||||||
functions.push_back(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
void registerCallback(std::function<void(T)> cb) {
|
void registerCallback(std::function<void(T)> cb) {
|
||||||
callbacks.push_back(cb);
|
callbacks.push_back(cb);
|
||||||
}
|
}
|
||||||
@@ -65,6 +61,16 @@ template <class T> class ctx_Controller {
|
|||||||
callbacks.push_back(execCB);
|
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() {
|
void reportContext() {
|
||||||
for (const auto &cb : callbacks) {
|
for (const auto &cb : callbacks) {
|
||||||
cb(context);
|
cb(context);
|
||||||
|
|||||||
@@ -81,8 +81,6 @@ int main() {
|
|||||||
ctrl.registerFunctions({
|
ctrl.registerFunctions({
|
||||||
cli_exit,
|
cli_exit,
|
||||||
cli_goOn,
|
cli_goOn,
|
||||||
});
|
|
||||||
/*
|
|
||||||
cli_greetUser,
|
cli_greetUser,
|
||||||
cli_promptSecondItemSelection,
|
cli_promptSecondItemSelection,
|
||||||
cli_reportMatchedItems,
|
cli_reportMatchedItems,
|
||||||
@@ -95,7 +93,8 @@ int main() {
|
|||||||
memory_generateConstPlayfield,
|
memory_generateConstPlayfield,
|
||||||
memory_hideMatchingItems,
|
memory_hideMatchingItems,
|
||||||
memory_selectItem,
|
memory_selectItem,
|
||||||
])
|
});
|
||||||
|
/*
|
||||||
|
|
||||||
auto c = shell_createContext();
|
auto c = shell_createContext();
|
||||||
c.cCLI = cli_createContext();
|
c.cCLI = cli_createContext();
|
||||||
|
|||||||
Reference in New Issue
Block a user