Mercurial > hg > orthanc-stone
comparison Framework/Messages/ICallable.h @ 977:262a0244e9b2 toa2019090201
Added missing Unregister for objects that register by the broker + logs + guard in FetchContext
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 02 Sep 2019 17:29:26 +0200 |
parents | e75fd08d6c75 |
children | 18d53a8b41b7 c20dbaab360c |
comparison
equal
deleted
inserted
replaced
976:3abc47e051c8 | 977:262a0244e9b2 |
---|---|
76 { | 76 { |
77 } | 77 } |
78 | 78 |
79 void ApplyInternal(const TMessage& message) | 79 void ApplyInternal(const TMessage& message) |
80 { | 80 { |
81 if (observerFingerprint_ != observer_.GetFingerprint()) | 81 std::string currentFingerprint(observer_.GetFingerprint()); |
82 if (observerFingerprint_ != currentFingerprint) | |
82 { | 83 { |
83 LOG(TRACE) << "The observer at address " << std::hex << &observer_ << std::dec << ") has a different fingerprint than the one recorded at callback registration time. This means that it is not the same object as the one recorded, even though their addresses are the same. Callback will NOT be sent!"; | 84 LOG(TRACE) << "The observer at address " << |
84 LOG(TRACE) << " recorded fingerprint = " << observerFingerprint_ << " current fingerprint = " << observer_.GetFingerprint(); | 85 std::hex << &observer_ << std::dec << |
86 ") has a different fingerprint than the one recorded at callback " << | |
87 "registration time. This means that it is not the same object as " << | |
88 "the one recorded, even though their addresses are the same. " << | |
89 "Callback will NOT be sent!"; | |
90 LOG(TRACE) << " recorded fingerprint = " << observerFingerprint_ << | |
91 " current fingerprint = " << currentFingerprint; | |
85 } | 92 } |
86 else | 93 else |
87 { | 94 { |
95 LOG(TRACE) << "The recorded fingerprint is " << observerFingerprint_ << " and the current fingerprint is " << currentFingerprint << " -- callable will be called."; | |
88 (observer_.*function_) (message); | 96 (observer_.*function_) (message); |
89 } | 97 } |
90 } | 98 } |
91 | 99 |
92 virtual void Apply(const IMessage& message) | 100 virtual void Apply(const IMessage& message) |