Diff to HTML by rtfpessoa

{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcessConfig → generated/artifacts/PluginSkeleton-OutOfProcessConfig}/OutOfProcessConfig.cpp RENAMED
@@ -24,11 +24,11 @@
24
24
  namespace Thunder {
25
25
  namespace Plugin {
26
26
 
27
27
  namespace {
28
28
 
29
- static Metadata<OutOfProcessConfig>metadata(
29
+ static Metadata<OutOfProcessConfig> metadata(
30
30
  // Version
31
31
  1, 0, 0,
32
32
  // Preconditions
33
33
  {},
34
34
  // Terminations
@@ -117,13 +117,14 @@ namespace Plugin {
117
117
  ASSERT(remote != nullptr);
118
118
 
119
119
  if (interfaceId == Exchange::INetworkControl::INotification::ID) {
120
120
  auto* revokedInterface = remote->QueryInterface<Exchange::INetworkControl::INotification>();
121
121
  if (revokedInterface) {
122
- _implNetworkControl->Unregister(revokedInterface);
122
+ _implNetworkControl->Unregister(const_cast<Exchange::INetworkControl::INotification*>(revokedInterface));
123
123
  revokedInterface->Release();
124
124
  }
125
125
  }
126
+
126
127
  }
127
128
 
128
129
  } // Plugin
129
130
  } // Thunder
{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcessConfig → generated/artifacts/PluginSkeleton-OutOfProcessConfig}/OutOfProcessConfig.h RENAMED
@@ -42,10 +42,11 @@ namespace Plugin {
42
42
  , _notification(*this)
43
43
  {
44
44
  }
45
45
 
46
46
  ~OutOfProcessConfig() override = default;
47
+ private:
47
48
  class Notification : public RPC::IRemoteConnection::INotification, public PluginHost::IShell::ICOMLink::INotification, public Exchange::INetworkControl::INotification {
48
49
  public:
49
50
  Notification(const Notification&) = delete;
50
51
  Notification& operator=(const Notification&) = delete;
51
52
  Notification(Notification&&) = delete;
{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/OutOfProcessConfig → generated/artifacts/PluginSkeleton-OutOfProcessConfig}/OutOfProcessConfigImplementation.cpp RENAMED
@@ -17,15 +17,16 @@
17
17
  * limitations under the License.
18
18
  */
19
19
 
20
20
  #include "Module.h"
21
21
  #include <interfaces/INetworkControl.h>
22
+ #include <interfaces/IConfiguration.h>
22
23
 
23
24
  namespace Thunder {
24
25
  namespace Plugin {
25
26
 
26
- class OutOfProcessConfigImplementation : public Exchange::INetworkControl {
27
+ class OutOfProcessConfigImplementation : public Exchange::IConfiguration, public Exchange::INetworkControl {
27
28
  public:
28
29
  OutOfProcessConfigImplementation(const OutOfProcessConfigImplementation&) = delete;
29
30
  OutOfProcessConfigImplementation& operator=(const OutOfProcessConfigImplementation&) = delete;
30
31
  OutOfProcessConfigImplementation(OutOfProcessConfigImplementation&&) = delete;
31
32
  OutOfProcessConfigImplementation& operator=(OutOfProcessConfigImplementation&&) = delete;
@@ -38,37 +39,41 @@ namespace Plugin {
38
39
  }
39
40
  ~OutOfProcessConfigImplementation() override = default;
40
41
 
41
42
  private:
42
43
 
43
- class Config : public Core::JSON::Container {
44
+ class PluginConfig : public Core::JSON::Container {
44
45
  public:
45
- Config(const Config&) = delete;
46
- Config& operator=(const Config&) = delete;
47
- Config(Config&&) = delete;
48
- Config& operator=(Config&&) = delete;
46
+ PluginConfig(const PluginConfig&) = delete;
47
+ PluginConfig& operator=(const PluginConfig&) = delete;
48
+ PluginConfig(PluginConfig&&) = delete;
49
+ PluginConfig& operator=(PluginConfig&&) = delete;
49
50
 
50
- Config()
51
+ PluginConfig()
51
52
  : Core::JSON::Container()
52
53
  , Example()
53
54
  {
54
55
  Add(_T("example"), &Example);
55
56
  }
56
- ~Config() override = default;
57
+ ~PluginConfig() override = default;
57
58
  public:
58
59
  Core::JSON::String Example;
59
60
  };
60
61
  public:
61
62
 
62
63
  BEGIN_INTERFACE_MAP(OutOfProcessConfigImplementation)
64
+ INTERFACE_ENTRY(Exchange::IConfiguration)
63
65
  INTERFACE_ENTRY(Exchange::INetworkControl)
64
66
  END_INTERFACE_MAP
65
67
 
68
+ // Type aliases copied from interface headers
69
+ using INetworkInfoIterator = RPC::IIteratorType<NetworkInfo, Exchange::ID_NETWORKCONTROL_NETWORK_INFO_ITERATOR>;
70
+ using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;
71
+
66
72
  // INetworkControl methods
67
73
 
68
74
  uint32_t Register(Exchange::INetworkControl::INotification* notification) override {
69
-
70
75
  ASSERT(notification != nullptr);
71
76
 
72
77
  _adminLock.Lock();
73
78
  auto item = std::find(_networkcontrolNotification.begin(), _networkcontrolNotification.end(), notification);
74
79
  ASSERT(item == _networkcontrolNotification.end());
@@ -77,15 +82,14 @@ namespace Plugin {
77
82
  notification->AddRef();
78
83
  _networkcontrolNotification.push_back(notification);
79
84
  }
80
85
 
81
86
  _adminLock.Unlock();
82
-
87
+ return Core::ERROR_NONE;
83
88
  }
84
89
 
85
- uint32_t Unregister(const Exchange::INetworkControl::INotification* notification) override {
86
-
90
+ uint32_t Unregister(Exchange::INetworkControl::INotification* notification) override {
87
91
  ASSERT(notification != nullptr);
88
92
 
89
93
  _adminLock.Lock();
90
94
  auto item = std::find(_networkcontrolNotification.begin(), _networkcontrolNotification.end(), notification);
91
95
  ASSERT(item != _networkcontrolNotification.end());
@@ -93,11 +97,11 @@ namespace Plugin {
93
97
  if (item != _networkcontrolNotification.end()) {
94
98
  _networkcontrolNotification.erase(item);
95
99
  notification->Release();
96
100
  }
97
101
  _adminLock.Unlock();
98
-
102
+ return Core::ERROR_NONE;
99
103
  }
100
104
 
101
105
  uint32_t Interfaces(IStringIterator*& /* interfaces */ /* @out */) const override {
102
106
  return Core::ERROR_NONE;
103
107
  }
@@ -131,10 +135,18 @@ namespace Plugin {
131
135
  }
132
136
 
133
137
  uint32_t Flush(const string& /* interface */) override {
134
138
  return Core::ERROR_NONE;
135
139
  }
140
+
141
+ uint32_t Configure(PluginHost::IShell* service) override {
142
+ ASSERT(service != nullptr);
143
+ PluginConfig config;
144
+ config.FromString(service->ConfigLine());
145
+ TRACE(Trace::Information, (_T("This is just an example: [%s]"), config.Example.Value().c_str()));
146
+ return Core::ERROR_NONE;
147
+ }
136
148
  private:
137
149
  using NetworkControlNotificationContainer = std::vector<Exchange::INetworkControl::INotification*>;
138
150
 
139
151
  void NotifyUpdate(const string& interfaceName) const {
140
152
  _adminLock.Lock();