comparison Plugin/PluginContext.h @ 5:5e6de82bb10f

use of user properties instead of BidirectionalPeers option
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 Sep 2018 15:39:02 +0200
parents 95226b754d9e
children 4c3437217518
comparison
equal deleted inserted replaced
4:1ed03945c057 5:5e6de82bb10f
29 namespace OrthancPlugins 29 namespace OrthancPlugins
30 { 30 {
31 class PluginContext : public boost::noncopyable 31 class PluginContext : public boost::noncopyable
32 { 32 {
33 private: 33 private:
34 typedef std::map<std::string, std::string> BidirectionalPeers;
35
36 // Runtime structures 34 // Runtime structures
37 OrthancPluginContext* context_; 35 OrthancPluginContext* context_;
38 OrthancInstancesCache cache_; 36 OrthancInstancesCache cache_;
39 ActivePushTransactions pushTransactions_; 37 ActivePushTransactions pushTransactions_;
40 Orthanc::Semaphore semaphore_; 38 Orthanc::Semaphore semaphore_;
41 std::string pluginUuid_; 39 std::string pluginUuid_;
42 40
43 // Configuration 41 // Configuration
44 size_t threadsCount_; 42 size_t threadsCount_;
45 size_t targetBucketSize_; 43 size_t targetBucketSize_;
46 BidirectionalPeers bidirectionalPeers_;
47 44
48 45
49 PluginContext(OrthancPluginContext* context, 46 PluginContext(OrthancPluginContext* context,
50 size_t threadsCount, 47 size_t threadsCount,
51 size_t targetBucketSize, 48 size_t targetBucketSize,
88 size_t GetTargetBucketSize() const 85 size_t GetTargetBucketSize() const
89 { 86 {
90 return targetBucketSize_; 87 return targetBucketSize_;
91 } 88 }
92 89
93 void AddBidirectionalPeer(const std::string& remotePeer,
94 const std::string& remoteSelf)
95 {
96 bidirectionalPeers_[remotePeer] = remoteSelf;
97 }
98
99 void LoadBidirectionalPeers(const BidirectionalPeers& peers)
100 {
101 bidirectionalPeers_ = peers;
102 }
103
104 bool LookupBidirectionalPeer(std::string& remoteSelf,
105 const std::string& remotePeer) const;
106
107 static void Initialize(OrthancPluginContext* context, 90 static void Initialize(OrthancPluginContext* context,
108 size_t threadsCount, 91 size_t threadsCount,
109 size_t targetBucketSize, 92 size_t targetBucketSize,
110 size_t maxPushTransactions, 93 size_t maxPushTransactions,
111 size_t memoryCacheSize); 94 size_t memoryCacheSize);