Mercurial > hg > orthanc-stone
comparison Framework/Messages/IObserver.h @ 1262:ca2058bd74ef toa2020012702
Changed fingerprint from uuid_t to int64_t + poor man's
checksum (to fix emscripten syscall error + make it faster)
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 27 Jan 2020 15:13:00 +0100 |
parents | f6be9412e42a |
children | 6e162d59e4f9 |
comparison
equal
deleted
inserted
replaced
1261:4c1c9df47d46 | 1262:ca2058bd74ef |
---|---|
27 { | 27 { |
28 class IObserver : public boost::noncopyable | 28 class IObserver : public boost::noncopyable |
29 { | 29 { |
30 private: | 30 private: |
31 MessageBroker& broker_; | 31 MessageBroker& broker_; |
32 // the following is a UUID that is used to disambiguate different observers | 32 // the following is a int64_t with some checks that is used to |
33 // that may have the same address | 33 // disambiguate different observers that may have the same address |
34 char fingerprint_[37]; | 34 int64_t fingerprint_[3]; |
35 | |
36 void AssignFingerprint(); | |
35 | 37 |
36 public: | 38 public: |
37 IObserver(MessageBroker& broker); | 39 IObserver(MessageBroker& broker); |
38 | 40 |
39 virtual ~IObserver(); | 41 virtual ~IObserver(); |
40 | 42 |
41 const char* GetFingerprint() const | 43 int64_t GetFingerprint() const |
42 { | 44 { |
43 return fingerprint_; | 45 return fingerprint_[0]; |
44 } | 46 } |
45 | 47 |
46 bool DoesFingerprintLookGood() const; | 48 bool DoesFingerprintLookGood() const; |
47 | 49 |
48 MessageBroker& GetBroker() const | 50 MessageBroker& GetBroker() const |