GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GlobalRegisterTable.h
1 
29 #pragma once
30 
31 #include <any>
32 #include <functional>
33 #include <optional>
34 
35 #include "function/SecureMemoryAllocator.h"
36 
37 namespace GpgFrontend::Module {
38 
39 using Namespace = QString;
40 using Key = QString;
41 using LPCallback = std::function<void(Namespace, Key, int, std::any)>;
42 
43 class GlobalRegisterTable : public QObject {
44  Q_OBJECT
45  public:
47 
48  ~GlobalRegisterTable() override;
49 
50  auto PublishKV(Namespace, Key, std::any) -> bool;
51 
52  auto LookupKV(Namespace, Key) -> std::optional<std::any>;
53 
54  auto ListenPublish(QObject *, Namespace, Key, LPCallback) -> bool;
55 
56  auto ListChildKeys(Namespace n, Key k) -> std::vector<Key>;
57 
58  signals:
59  void SignalPublish(Namespace, Key, int, std::any);
60 
61  private:
62  class Impl;
63  SecureUniquePtr<Impl> p_;
64 };
65 
66 } // namespace GpgFrontend::Module
Definition: GlobalRegisterTable.cpp:43
Definition: GlobalRegisterTable.h:43
Definition: Event.cpp:31