comparison Plugin/PluginContext.h @ 8:4c3437217518

fix for compatibility with simplified OrthancPluginCppWrapper
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Dec 2018 09:16:51 +0100
parents 5e6de82bb10f
children 7e207ade2f1a
comparison
equal deleted inserted replaced
7:151e29acbb13 8:4c3437217518
30 { 30 {
31 class PluginContext : public boost::noncopyable 31 class PluginContext : public boost::noncopyable
32 { 32 {
33 private: 33 private:
34 // Runtime structures 34 // Runtime structures
35 OrthancPluginContext* context_;
36 OrthancInstancesCache cache_; 35 OrthancInstancesCache cache_;
37 ActivePushTransactions pushTransactions_; 36 ActivePushTransactions pushTransactions_;
38 Orthanc::Semaphore semaphore_; 37 Orthanc::Semaphore semaphore_;
39 std::string pluginUuid_; 38 std::string pluginUuid_;
40 39
41 // Configuration 40 // Configuration
42 size_t threadsCount_; 41 size_t threadsCount_;
43 size_t targetBucketSize_; 42 size_t targetBucketSize_;
44 43
45 44
46 PluginContext(OrthancPluginContext* context, 45 PluginContext(size_t threadsCount,
47 size_t threadsCount,
48 size_t targetBucketSize, 46 size_t targetBucketSize,
49 size_t maxPushTransactions, 47 size_t maxPushTransactions,
50 size_t memoryCacheSize); 48 size_t memoryCacheSize);
51 49
52 static std::auto_ptr<PluginContext>& GetSingleton(); 50 static std::auto_ptr<PluginContext>& GetSingleton();
53 51
54 public: 52 public:
55 OrthancPluginContext* GetOrthanc()
56 {
57 return context_;
58 }
59
60 OrthancInstancesCache& GetCache() 53 OrthancInstancesCache& GetCache()
61 { 54 {
62 return cache_; 55 return cache_;
63 } 56 }
64 57
85 size_t GetTargetBucketSize() const 78 size_t GetTargetBucketSize() const
86 { 79 {
87 return targetBucketSize_; 80 return targetBucketSize_;
88 } 81 }
89 82
90 static void Initialize(OrthancPluginContext* context, 83 static void Initialize(size_t threadsCount,
91 size_t threadsCount,
92 size_t targetBucketSize, 84 size_t targetBucketSize,
93 size_t maxPushTransactions, 85 size_t maxPushTransactions,
94 size_t memoryCacheSize); 86 size_t memoryCacheSize);
95 87
96 static PluginContext& GetInstance(); 88 static PluginContext& GetInstance();