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 "core/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:
46  friend class GlobalRegisterTableTreeModel;
47 
49 
50  ~GlobalRegisterTable() override;
51 
52  auto PublishKV(Namespace, Key, std::any) -> bool;
53 
54  auto LookupKV(Namespace, Key) -> std::optional<std::any>;
55 
56  auto ListenPublish(QObject *, Namespace, Key, LPCallback) -> bool;
57 
58  auto ListChildKeys(Namespace n, Key k) -> std::vector<Key>;
59 
60  signals:
61  void SignalPublish(Namespace, Key, int, std::any);
62 
63  private:
64  class Impl;
65  SecureUniquePtr<Impl> p_;
66 };
67 
68 } // namespace GpgFrontend::Module
Definition: GlobalRegisterTableTreeModel.h:35
Definition: GlobalRegisterTable.cpp:43
Definition: GlobalRegisterTable.h:43
Definition: Event.cpp:33