Mercurial > hg > orthanc-stone
comparison Framework/Oracle/ThreadedOracle.cpp @ 1124:a8bf81756839 broker
unsuccessful attempt to cache ParseDicomFileCommand
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 05 Nov 2019 18:49:06 +0100 |
parents | 79b1b541fe15 |
children | a8c3908ecba9 |
comparison
equal
deleted
inserted
replaced
1117:383aa2a7d426 | 1124:a8bf81756839 |
---|---|
179 | 179 |
180 { | 180 { |
181 boost::mutex::scoped_lock lock(mutex_); | 181 boost::mutex::scoped_lock lock(mutex_); |
182 runner.SetOrthanc(orthanc_); | 182 runner.SetOrthanc(orthanc_); |
183 runner.SetRootDirectory(rootDirectory_); | 183 runner.SetRootDirectory(rootDirectory_); |
184 | |
185 if (dicomCache_) | |
186 { | |
187 runner.SetDicomCache(dicomCache_); | |
188 } | |
184 } | 189 } |
185 | 190 |
186 std::auto_ptr<IMessage> message(runner.Run(item.GetCommand())); | 191 std::auto_ptr<IMessage> message(runner.Run(item.GetCommand())); |
187 | 192 |
188 emitter_.EmitMessage(item.GetReceiver(), *message); | 193 emitter_.EmitMessage(item.GetReceiver(), *message); |
353 sleepingTimeResolution_ = milliseconds; | 358 sleepingTimeResolution_ = milliseconds; |
354 } | 359 } |
355 } | 360 } |
356 | 361 |
357 | 362 |
363 void ThreadedOracle::SetDicomCacheSize(size_t size) | |
364 { | |
365 #if ORTHANC_ENABLE_DCMTK == 1 | |
366 boost::mutex::scoped_lock lock(mutex_); | |
367 | |
368 if (state_ != State_Setup) | |
369 { | |
370 LOG(ERROR) << "ThreadedOracle::SetDicomCacheSize(): (state_ != State_Setup)"; | |
371 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | |
372 } | |
373 else | |
374 { | |
375 if (size == 0) | |
376 { | |
377 dicomCache_.reset(); | |
378 } | |
379 else | |
380 { | |
381 dicomCache_.reset(new ParsedDicomFileCache(size)); | |
382 } | |
383 } | |
384 #endif | |
385 } | |
386 | |
387 | |
358 void ThreadedOracle::Start() | 388 void ThreadedOracle::Start() |
359 { | 389 { |
360 boost::mutex::scoped_lock lock(mutex_); | 390 boost::mutex::scoped_lock lock(mutex_); |
361 | 391 |
362 if (state_ != State_Setup) | 392 if (state_ != State_Setup) |