mirror of
https://gitlab.com/voidframe/voidframe-cpp.git
synced 2026-07-01 18:55:12 -04:00
Implement a simple function register manager (SysReg)
This commit is contained in:
18
include/sysreg.h
Normal file
18
include/sysreg.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
namespace VoidFrame {
|
||||
class SysReg {
|
||||
public:
|
||||
std::function<void(void)> *
|
||||
RegisterCallback(const std::string &&name,
|
||||
std::function<void(void)> &callback);
|
||||
const std::function<void(void)> *GetCallback(std::string &&name);
|
||||
void DeleteCallback(std::string &&name);
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, std::unique_ptr<std::function<void(void)>>>
|
||||
callbacks;
|
||||
};
|
||||
} // namespace VoidFrame
|
||||
Reference in New Issue
Block a user