Mercurial > hg > orthanc-stone
comparison Framework/Messages/IObserver.h @ 1273:398ea4259e65
merge
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Mon, 03 Feb 2020 14:57:22 +0100 |
parents | 2d8ab34c8c91 |
children | 7ec8fea061b9 |
comparison
equal
deleted
inserted
replaced
1272:a989c7d46b9a | 1273:398ea4259e65 |
---|---|
1 /** | 1 /** |
2 * Stone of Orthanc | 2 * Stone of Orthanc |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
4 * Department, University Hospital of Liege, Belgium | 4 * Department, University Hospital of Liege, Belgium |
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium | 5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
6 * | 6 * |
7 * This program is free software: you can redistribute it and/or | 7 * This program is free software: you can redistribute it and/or |
8 * modify it under the terms of the GNU Affero General Public License | 8 * modify it under the terms of the GNU Affero General Public License |
9 * as published by the Free Software Foundation, either version 3 of | 9 * as published by the Free Software Foundation, either version 3 of |
10 * the License, or (at your option) any later version. | 10 * the License, or (at your option) any later version. |
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include "MessageBroker.h" | 24 #include "MessageBroker.h" |
25 | 25 |
26 #include <stdint.h> | |
27 | |
26 namespace OrthancStone | 28 namespace OrthancStone |
27 { | 29 { |
28 class IObserver : public boost::noncopyable | 30 class IObserver : public boost::noncopyable |
29 { | 31 { |
30 private: | 32 private: |
31 MessageBroker& broker_; | 33 MessageBroker& broker_; |
32 // the following is a UUID that is used to disambiguate different observers | 34 // the following is a int64_t with some checks that is used to |
33 // that may have the same address | 35 // disambiguate different observers that may have the same address |
34 char fingerprint_[37]; | 36 int64_t fingerprint_[3]; |
37 | |
38 void AssignFingerprint(); | |
35 | 39 |
36 public: | 40 public: |
37 IObserver(MessageBroker& broker); | 41 IObserver(MessageBroker& broker); |
38 | 42 |
39 virtual ~IObserver(); | 43 virtual ~IObserver(); |
40 | 44 |
41 const char* GetFingerprint() const | 45 int64_t GetFingerprint() const |
42 { | 46 { |
43 return fingerprint_; | 47 return fingerprint_[0]; |
44 } | 48 } |
45 | 49 |
46 bool DoesFingerprintLookGood() const; | 50 bool DoesFingerprintLookGood() const; |
47 | 51 |
48 MessageBroker& GetBroker() const | 52 MessageBroker& GetBroker() const |