Diff to HTML by rtfpessoa

{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcessConfigPreconditions → generated/artifacts/PluginSkeleton-OutOfProcessConfigPreconditions}/OutOfProcessConfigPreconditions.cpp RENAMED
@@ -25,11 +25,11 @@ namespace Plugin {
25
25
 
26
26
  namespace {
27
27
 
28
- static Metadata<OutOfProcessConfigPreconditions>metadata(
28
+ static Metadata<OutOfProcessConfigPreconditions> metadata(
29
29
  // Version
30
30
  1, 0, 0,
31
31
  // Preconditions
32
- {},
32
+ { subsystem::GRAPHICS , subsystem::NOT_GRAPHICS , subsystem::TIME },
33
33
  // Terminations
34
34
  {},
35
35
  // Controls
@@ -54,6 +54,7 @@ namespace Plugin {
54
54
  if (_implBluetooth == nullptr) {
55
55
  message = _T("Couldn't create instance of _implBluetooth");
56
56
  } else {
57
+ _implBluetooth->Register(&_notification);
57
58
  Exchange::IConfiguration* configuration = _implBluetooth->QueryInterface<Exchange::IConfiguration>();
58
59
  ASSERT(configuration != nullptr);
59
60
  if (configuration != nullptr) {
@@ -75,6 +76,7 @@ namespace Plugin {
75
76
  _service->Unregister(static_cast<PluginHost::IShell::ICOMLink::INotification*>(&_notification));
76
77
 
77
78
  if (_implBluetooth != nullptr) {
79
+ _implBluetooth->Unregister(&_notification);
78
80
 
79
81
  RPC::IRemoteConnection* connection(service->RemoteConnection(_connectionId));
80
82
  VARIABLE_IS_NOT_USED uint32_t result = _implBluetooth->Release();
@@ -114,29 +116,28 @@ namespace Plugin {
114
116
  if (interfaceId == Exchange::IBluetooth::INotification::ID) {
115
117
  auto* revokedInterface = remote->QueryInterface<Exchange::IBluetooth::INotification>();
116
118
  if (revokedInterface) {
117
- _implBluetooth->Unregister(revokedInterface);
119
+ _implBluetooth->Unregister(const_cast<Exchange::IBluetooth::INotification*>(revokedInterface));
118
120
  revokedInterface->Release();
119
121
  }
120
122
  }
121
- }
122
123
 
123
- if (interfaceId == Exchange::IBluetooth::INotification::ID) {
124
- auto* revokedInterface = remote->QueryInterface<Exchange::IBluetooth::INotification>();
125
- if (revokedInterface) {
126
- _implBluetooth->Unregister(revokedInterface);
127
- revokedInterface->Release();
124
+ if (interfaceId == Exchange::IBluetooth::INotification::ID) {
125
+ auto* revokedInterface = remote->QueryInterface<Exchange::IBluetooth::INotification>();
126
+ if (revokedInterface) {
127
+ _implBluetooth->Unregister(const_cast<Exchange::IBluetooth::INotification*>(revokedInterface));
128
+ revokedInterface->Release();
129
+ }
130
+ }
131
+
132
+ if (interfaceId == Exchange::IBluetooth::INotification::ID) {
133
+ auto* revokedInterface = remote->QueryInterface<Exchange::IBluetooth::INotification>();
134
+ if (revokedInterface) {
135
+ _implBluetooth->Unregister(const_cast<Exchange::IBluetooth::INotification*>(revokedInterface));
136
+ revokedInterface->Release();
137
+ }
128
138
  }
129
- }
130
- }
131
139
 
132
- if (interfaceId == Exchange::IBluetooth::INotification::ID) {
133
- auto* revokedInterface = remote->QueryInterface<Exchange::IBluetooth::INotification>();
134
- if (revokedInterface) {
135
- _implBluetooth->Unregister(revokedInterface);
136
- revokedInterface->Release();
137
140
  }
138
- }
139
- }
140
141
 
141
142
  } // Plugin
142
143
  } // Thunder
{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcessConfigPreconditions → generated/artifacts/PluginSkeleton-OutOfProcessConfigPreconditions}/OutOfProcessConfigPreconditions.h RENAMED
@@ -20,7 +20,7 @@
20
20
  #pragma once
21
21
 
22
22
  #include "Module.h"
23
- #include <Y/IBluetooth.h>
23
+ #include <interfaces/IBluetooth.h>
24
24
 
25
25
  namespace Thunder {
26
26
  namespace Plugin {
@@ -42,7 +42,8 @@ namespace Plugin {
42
42
  }
43
43
 
44
44
  ~OutOfProcessConfigPreconditions() override = default;
45
- class Notification : public RPC::IRemoteConnection::INotification, public PluginHost::IShell::ICOMLink::INotification, public Exchange::IBluetooth::INotification, public Exchange::IBluetooth::INotification, public Exchange::IBluetooth::INotification {
45
+ private:
46
+ class Notification : public RPC::IRemoteConnection::INotification {
46
47
  public:
47
48
  Notification(const Notification&) = delete;
48
49
  Notification& operator=(const Notification&) = delete;
@@ -52,10 +53,6 @@ namespace Plugin {
52
53
 
53
54
  explicit Notification(OutOfProcessConfigPreconditions& parent)
54
55
  : RPC::IRemoteConnection::INotification()
55
- , PluginHost::IShell::ICOMLink::INotification()
56
- , Exchange::IBluetooth::INotification()
57
- , Exchange::IBluetooth::INotification()
58
- , Exchange::IBluetooth::INotification()
59
56
  , _parent(parent)
60
57
  {
61
58
  }
@@ -70,25 +67,8 @@ namespace Plugin {
70
67
  _parent.Deactivated(connection);
71
68
  }
72
69
 
73
- void Dangling(const Core::IUnknown* remote, const uint32_t interfaceId) override {
74
- _parent.Dangling(remote, interfaceId);
75
- }
76
- void Update(IDevice* device) override {
77
- }
78
- void ScanningStateChanged() override {
79
- }
80
- void AdvertisingStateChanged() override {
81
- }
82
- void ScanningStateChanged() override {
83
- }
84
- void InquiryScanningStateChanged() override {
85
- }
86
70
  BEGIN_INTERFACE_MAP(Notification)
87
71
  INTERFACE_ENTRY(RPC::IRemoteConnection::INotification)
88
- INTERFACE_ENTRY(PluginHost::IShell::ICOMLink::INotification)
89
- INTERFACE_ENTRY(Exchange::IBluetooth::INotification)
90
- INTERFACE_ENTRY(Exchange::IBluetooth::INotification)
91
- INTERFACE_ENTRY(Exchange::IBluetooth::INotification)
92
72
  END_INTERFACE_MAP
93
73
  private:
94
74
  OutOfProcessConfigPreconditions& _parent;
{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcessConfigPreconditions → generated/artifacts/PluginSkeleton-OutOfProcessConfigPreconditions}/OutOfProcessConfigPreconditionsImplementation.cpp RENAMED
@@ -18,12 +18,13 @@
18
18
  */
19
19
 
20
20
  #include "Module.h"
21
- #include <Y/IBluetooth.h>
21
+ #include <interfaces/IBluetooth.h>
22
+ #include <interfaces/IConfiguration.h>
22
23
 
23
24
  namespace Thunder {
24
25
  namespace Plugin {
25
26
 
26
- class OutOfProcessConfigPreconditionsImplementation : public Exchange::IBluetooth {
27
+ class OutOfProcessConfigPreconditionsImplementation : public Exchange::IConfiguration, public Exchange::IBluetooth {
27
28
  public:
28
29
  OutOfProcessConfigPreconditionsImplementation(const OutOfProcessConfigPreconditionsImplementation&) = delete;
29
30
  OutOfProcessConfigPreconditionsImplementation& operator=(const OutOfProcessConfigPreconditionsImplementation&) = delete;
@@ -32,8 +33,6 @@ namespace Plugin {
32
33
 
33
34
  OutOfProcessConfigPreconditionsImplementation()
34
35
  : Exchange::IBluetooth()
35
- , _adminLock()
36
- , _bluetoothNotification()
37
36
  {
38
37
  }
39
38
  ~OutOfProcessConfigPreconditionsImplementation() override = default;
@@ -60,46 +59,22 @@ namespace Plugin {
60
59
  public:
61
60
 
62
61
  BEGIN_INTERFACE_MAP(OutOfProcessConfigPreconditionsImplementation)
62
+ INTERFACE_ENTRY(Exchange::IConfiguration)
63
63
  INTERFACE_ENTRY(Exchange::IBluetooth)
64
64
  END_INTERFACE_MAP
65
65
 
66
66
  // IBluetooth methods
67
67
 
68
- uint32_t Register(Exchange::IBluetooth::INotification* notification) override {
69
-
70
- ASSERT(notification != nullptr);
71
-
72
- _adminLock.Lock();
73
- auto item = std::find(_bluetoothNotification.begin(), _bluetoothNotification.end(), notification);
74
- ASSERT(item == _bluetoothNotification.end());
75
-
76
- if (item == _bluetoothNotification.end()) {
77
- notification->AddRef();
78
- _bluetoothNotification.push_back(notification);
79
- }
80
-
81
- _adminLock.Unlock();
82
-
68
+ uint32_t Register(INotification* /* notification */) override {
69
+ return Core::ERROR_NONE;
83
70
  }
84
71
 
85
- uint32_t Unregister(const Exchange::IBluetooth::INotification* notification) override {
86
-
87
- ASSERT(notification != nullptr);
88
-
89
- _adminLock.Lock();
90
- auto item = std::find(_bluetoothNotification.begin(), _bluetoothNotification.end(), notification);
91
- ASSERT(item != _bluetoothNotification.end());
92
-
93
- if (item != _bluetoothNotification.end()) {
94
- _bluetoothNotification.erase(item);
95
- notification->Release();
96
- }
97
- _adminLock.Unlock();
98
-
72
+ uint32_t Unregister(INotification* /* notification */) override {
73
+ return Core::ERROR_NONE;
99
74
  }
100
75
 
101
76
  bool IsScanning() const override {
102
- return Core::ERROR_NONE;
77
+ return false;
103
78
  }
104
79
 
105
80
  uint32_t Scan(const bool /* lowEnergy */, const uint16_t /* duration */ /* sec */) override {
@@ -111,61 +86,26 @@ namespace Plugin {
111
86
  }
112
87
 
113
88
  IDevice* Device(const string& /* address */, const IDevice::type /* type */) override {
114
- return Core::ERROR_NONE;
89
+ return nullptr;
115
90
  }
116
91
 
117
92
  IDevice::IIterator* Devices() override {
118
- return Core::ERROR_NONE;
93
+ return nullptr;
119
94
  }
120
95
 
121
96
  uint32_t ForgetDevice(const string& /* address */, const IDevice::type /* type */) override {
122
97
  return Core::ERROR_NONE;
123
98
  }
124
- private:
125
- using BluetoothNotificationContainer = std::vector<Exchange::IBluetooth::INotification*>;
126
-
127
- void NotifyUpdate(IDevice* device) const {
128
- _adminLock.Lock();
129
- for (auto* notification : _bluetoothNotification) {
130
- notification->Update(device);
131
- }
132
- _adminLock.Unlock();
133
- }
134
-
135
- void NotifyScanningStateChanged() const {
136
- _adminLock.Lock();
137
- for (auto* notification : _bluetoothNotification) {
138
- notification->ScanningStateChanged();
139
- }
140
- _adminLock.Unlock();
141
- }
142
-
143
- void NotifyAdvertisingStateChanged() const {
144
- _adminLock.Lock();
145
- for (auto* notification : _bluetoothNotification) {
146
- notification->AdvertisingStateChanged();
147
- }
148
- _adminLock.Unlock();
149
- }
150
-
151
- void NotifyScanningStateChanged() const {
152
- _adminLock.Lock();
153
- for (auto* notification : _bluetoothNotification) {
154
- notification->ScanningStateChanged();
155
- }
156
- _adminLock.Unlock();
157
- }
158
99
 
159
- void NotifyInquiryScanningStateChanged() const {
160
- _adminLock.Lock();
161
- for (auto* notification : _bluetoothNotification) {
162
- notification->InquiryScanningStateChanged();
163
- }
164
- _adminLock.Unlock();
100
+ uint32_t Configure(PluginHost::IShell* service) override {
101
+ ASSERT(service != nullptr);
102
+ Config config;
103
+ config.FromString(service->ConfigLine());
104
+ TRACE(Trace::Information, (_T("This is just an example: [%s]"), config.Example.Value.c_str()));
105
+ return Core::ERROR_NONE;
165
106
  }
107
+ private:
166
108
 
167
- mutable Core::CriticalSection _adminLock;
168
- BluetoothNotificationContainer _bluetoothNotification;
169
109
  };
170
110
 
171
111
  SERVICE_REGISTRATION(OutOfProcessConfigPreconditionsImplementation, 1, 0)