Diff to HTML by rtfpessoa

{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/InProcessPreconditions → generated/artifacts/PluginSkeleton-InProcessPreconditions}/InProcessPreconditions.cpp RENAMED
@@ -25,15 +25,15 @@ namespace Plugin {
25
25
 
26
26
  namespace {
27
27
 
28
- static Metadata<InProcessPreconditions>metadata(
28
+ static Metadata<InProcessPreconditions> metadata(
29
29
  // Version
30
30
  1, 0, 0,
31
31
  // Preconditions
32
- { subsystem::GRAPHICS },
32
+ { subsystem::GRAPHICS , subsystem::NOT_GRAPHICS , subsystem::TIME },
33
33
  // Terminations
34
- { subsystem::NOT_GRAPHICS },
34
+ {},
35
35
  // Controls
36
- { subsystem::TIME }
36
+ {}
37
37
  );
38
38
  }
39
39
 
@@ -53,10 +53,33 @@ namespace Plugin {
53
53
  return (string());
54
54
  }
55
55
 
56
- Core::hresult InProcessPreconditions::Register(INotification* const /* notification */) {
56
+ Core::hresult InProcessPreconditions::Register(Exchange::ITimeSync::INotification* notification) {
57
+ ASSERT(notification != nullptr);
58
+
59
+ _adminLock.Lock();
60
+ auto item = std::find(_timesyncNotification.begin(), _timesyncNotification.end(), notification);
61
+ ASSERT(item == _timesyncNotification.end());
62
+
63
+ if (item == _timesyncNotification.end()) {
64
+ notification->AddRef();
65
+ _timesyncNotification.push_back(notification);
66
+ }
67
+
68
+ _adminLock.Unlock();
57
69
  return Core::ERROR_NONE;
58
70
  }
59
- Core::hresult InProcessPreconditions::Unregister(const INotification* const /* notification */) {
71
+ Core::hresult InProcessPreconditions::Unregister(const Exchange::ITimeSync::INotification* notification) {
72
+ ASSERT(notification != nullptr);
73
+
74
+ _adminLock.Lock();
75
+ auto item = std::find(_timesyncNotification.begin(), _timesyncNotification.end(), notification);
76
+ ASSERT(item != _timesyncNotification.end());
77
+
78
+ if (item != _timesyncNotification.end()) {
79
+ _timesyncNotification.erase(item);
80
+ notification->Release();
81
+ }
82
+ _adminLock.Unlock();
60
83
  return Core::ERROR_NONE;
61
84
  }
62
85
  Core::hresult InProcessPreconditions::Synchronize() {
@@ -71,5 +94,13 @@ namespace Plugin {
71
94
  Core::hresult InProcessPreconditions::Time(const Core::Time& /* time */) {
72
95
  return Core::ERROR_NONE;
73
96
  }
97
+
98
+ void InProcessPreconditions::NotifyTimeChanged() const {
99
+ _adminLock.Lock();
100
+ for (auto* notification : _timesyncNotification) {
101
+ notification->TimeChanged();
102
+ }
103
+ _adminLock.Unlock();
104
+ }
74
105
  } // Plugin
75
106
  } // Thunder
{baseline/home/runner/work/ThunderTools/ThunderTools/ghpages_baseline/PluginSkeletonGenerator/master/latest_raw/InProcessPreconditions → generated/artifacts/PluginSkeleton-InProcessPreconditions}/InProcessPreconditions.h RENAMED
@@ -42,8 +42,6 @@ namespace Plugin {
42
42
  }
43
43
 
44
44
  ~InProcessPreconditions() override = default;
45
- private:
46
- public:
47
45
  // IPlugin Methods
48
46
  const string Initialize(PluginHost::IShell* service) override;
49
47
  void Deinitialize(PluginHost::IShell* service) override;
@@ -51,9 +49,9 @@ namespace Plugin {
51
49
 
52
50
  // ITimeSync methods
53
51
 
54
- Core::hresult Register(INotification* const /* notification */) override;
52
+ Core::hresult Register(Exchange::ITimeSync::INotification* const /* sink */) override;
55
53
 
56
- Core::hresult Unregister(const INotification* const /* notification */) override;
54
+ Core::hresult Unregister(const Exchange::ITimeSync::INotification* const /* sink */) override;
57
55
 
58
56
  Core::hresult Synchronize() override;
59
57
 
@@ -72,6 +70,8 @@ namespace Plugin {
72
70
  private:
73
71
  using TimeSyncNotificationContainer = std::vector<Exchange::ITimeSync::INotification*>;
74
72
 
73
+ void NotifyTimeChanged() const;
74
+
75
75
  mutable Core::CriticalSection _adminLock;
76
76
  TimeSyncNotificationContainer _timesyncNotification;
77
77
  };