Mercurial > hg > orthanc
comparison OrthancServer/ServerContext.cpp @ 1632:eb8fbcf008b5
fix build with plugins disabled
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 21 Sep 2015 14:05:06 +0200 |
parents | bd1889029cbb |
children | de1413733c97 f5ddbd9239dd |
comparison
equal
deleted
inserted
replaced
1631:0d074f5f6069 | 1632:eb8fbcf008b5 |
---|---|
106 storeMD5_(true), | 106 storeMD5_(true), |
107 provider_(*this), | 107 provider_(*this), |
108 dicomCache_(provider_, DICOM_CACHE_SIZE), | 108 dicomCache_(provider_, DICOM_CACHE_SIZE), |
109 scheduler_(Configuration::GetGlobalIntegerParameter("LimitJobs", 10)), | 109 scheduler_(Configuration::GetGlobalIntegerParameter("LimitJobs", 10)), |
110 lua_(*this), | 110 lua_(*this), |
111 #if ORTHANC_PLUGINS_ENABLED == 1 | |
111 plugins_(NULL), | 112 plugins_(NULL), |
113 #endif | |
112 done_(false), | 114 done_(false), |
113 queryRetrieveArchive_(Configuration::GetGlobalIntegerParameter("QueryRetrieveSize", 10)), | 115 queryRetrieveArchive_(Configuration::GetGlobalIntegerParameter("QueryRetrieveSize", 10)), |
114 defaultLocalAet_(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC")) | 116 defaultLocalAet_(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC")) |
115 { | 117 { |
116 uint64_t s = Configuration::GetGlobalIntegerParameter("DicomAssociationCloseDelay", 5); // In seconds | 118 uint64_t s = Configuration::GetGlobalIntegerParameter("DicomAssociationCloseDelay", 5); // In seconds |
433 { | 435 { |
434 pendingChanges_.Enqueue(change.Clone()); | 436 pendingChanges_.Enqueue(change.Clone()); |
435 } | 437 } |
436 | 438 |
437 | 439 |
440 #if ORTHANC_PLUGINS_ENABLED == 1 | |
438 void ServerContext::SetPlugins(OrthancPlugins& plugins) | 441 void ServerContext::SetPlugins(OrthancPlugins& plugins) |
439 { | 442 { |
440 boost::recursive_mutex::scoped_lock lock(listenersMutex_); | 443 boost::recursive_mutex::scoped_lock lock(listenersMutex_); |
441 | 444 |
442 plugins_ = &plugins; | 445 plugins_ = &plugins; |
458 listeners_.clear(); | 461 listeners_.clear(); |
459 listeners_.push_back(ServerListener(lua_, "Lua")); | 462 listeners_.push_back(ServerListener(lua_, "Lua")); |
460 } | 463 } |
461 | 464 |
462 | 465 |
466 const OrthancPlugins& ServerContext::GetPlugins() const | |
467 { | |
468 if (HasPlugins()) | |
469 { | |
470 return *plugins_; | |
471 } | |
472 else | |
473 { | |
474 throw OrthancException(ErrorCode_InternalError); | |
475 } | |
476 } | |
477 | |
478 #endif | |
479 | |
480 | |
463 bool ServerContext::HasPlugins() const | 481 bool ServerContext::HasPlugins() const |
464 { | 482 { |
483 #if ORTHANC_PLUGINS_ENABLED == 1 | |
465 return (plugins_ != NULL); | 484 return (plugins_ != NULL); |
466 } | 485 #else |
467 | 486 return false; |
468 | 487 #endif |
469 const OrthancPlugins& ServerContext::GetPlugins() const | |
470 { | |
471 if (HasPlugins()) | |
472 { | |
473 return *plugins_; | |
474 } | |
475 else | |
476 { | |
477 throw OrthancException(ErrorCode_InternalError); | |
478 } | |
479 } | 488 } |
480 } | 489 } |