comparison Plugin/PluginContext.cpp @ 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
22 #include <Core/Logging.h> 22 #include <Core/Logging.h>
23 23
24 24
25 namespace OrthancPlugins 25 namespace OrthancPlugins
26 { 26 {
27 PluginContext::PluginContext(OrthancPluginContext* context, 27 PluginContext::PluginContext(size_t threadsCount,
28 size_t threadsCount,
29 size_t targetBucketSize, 28 size_t targetBucketSize,
30 size_t maxPushTransactions, 29 size_t maxPushTransactions,
31 size_t memoryCacheSize) : 30 size_t memoryCacheSize) :
32 context_(context),
33 cache_(context),
34 pushTransactions_(maxPushTransactions), 31 pushTransactions_(maxPushTransactions),
35 semaphore_(threadsCount), 32 semaphore_(threadsCount),
36 threadsCount_(threadsCount), 33 threadsCount_(threadsCount),
37 targetBucketSize_(targetBucketSize) 34 targetBucketSize_(targetBucketSize)
38 { 35 {
56 static std::auto_ptr<PluginContext> singleton_; 53 static std::auto_ptr<PluginContext> singleton_;
57 return singleton_; 54 return singleton_;
58 } 55 }
59 56
60 57
61 void PluginContext::Initialize(OrthancPluginContext* context, 58 void PluginContext::Initialize(size_t threadsCount,
62 size_t threadsCount,
63 size_t targetBucketSize, 59 size_t targetBucketSize,
64 size_t maxPushTransactions, 60 size_t maxPushTransactions,
65 size_t memoryCacheSize) 61 size_t memoryCacheSize)
66 { 62 {
67 GetSingleton().reset(new PluginContext(context, threadsCount, targetBucketSize, 63 GetSingleton().reset(new PluginContext(threadsCount, targetBucketSize,
68 maxPushTransactions, memoryCacheSize)); 64 maxPushTransactions, memoryCacheSize));
69 } 65 }
70 66
71 67
72 PluginContext& PluginContext::GetInstance() 68 PluginContext& PluginContext::GetInstance()