Mercurial > hg > orthanc
changeset 776:be87dd517416
rename
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 30 Apr 2014 17:53:01 +0200 |
parents | 4e3593c3511d |
children | 9ae0bb3f188b aebf0071020e |
files | OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp OrthancServer/DicomProtocol/ReusableDicomUserConnection.h OrthancServer/OrthancMoveRequestHandler.cpp OrthancServer/OrthancRestApi/OrthancRestModalities.cpp UnitTestsSources/MultiThreading.cpp |
diffstat | 5 files changed, 38 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp Wed Apr 30 15:17:10 2014 +0200 +++ b/OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp Wed Apr 30 17:53:01 2014 +0200 @@ -102,21 +102,21 @@ } } - ReusableDicomUserConnection::Connection::Connection(ReusableDicomUserConnection& that, - const std::string& aet, - const std::string& address, - int port, - ModalityManufacturer manufacturer) : - Locker(that) + ReusableDicomUserConnection::Locker::Locker(ReusableDicomUserConnection& that, + const std::string& aet, + const std::string& address, + int port, + ModalityManufacturer manufacturer) : + ::Orthanc::Locker(that) { that.Open(aet, address, port, manufacturer); connection_ = that.connection_; } - ReusableDicomUserConnection::Connection::Connection(ReusableDicomUserConnection& that, - const RemoteModalityParameters& remote) : - Locker(that) + ReusableDicomUserConnection::Locker::Locker(ReusableDicomUserConnection& that, + const RemoteModalityParameters& remote) : + ::Orthanc::Locker(that) { that.Open(remote.GetApplicationEntityTitle(), remote.GetHost(), remote.GetPort(), remote.GetManufacturer()); @@ -124,7 +124,7 @@ } - DicomUserConnection& ReusableDicomUserConnection::Connection::GetConnection() + DicomUserConnection& ReusableDicomUserConnection::Locker::GetConnection() { if (connection_ == NULL) {
--- a/OrthancServer/DicomProtocol/ReusableDicomUserConnection.h Wed Apr 30 15:17:10 2014 +0200 +++ b/OrthancServer/DicomProtocol/ReusableDicomUserConnection.h Wed Apr 30 17:53:01 2014 +0200 @@ -66,20 +66,20 @@ virtual void Unlock(); public: - class Connection : public Locker + class Locker : public ::Orthanc::Locker { private: DicomUserConnection* connection_; public: - Connection(ReusableDicomUserConnection& that, - const RemoteModalityParameters& remote); + Locker(ReusableDicomUserConnection& that, + const RemoteModalityParameters& remote); - Connection(ReusableDicomUserConnection& that, - const std::string& aet, - const std::string& address, - int port, - ModalityManufacturer manufacturer); + Locker(ReusableDicomUserConnection& that, + const std::string& aet, + const std::string& address, + int port, + ModalityManufacturer manufacturer); DicomUserConnection& GetConnection(); };
--- a/OrthancServer/OrthancMoveRequestHandler.cpp Wed Apr 30 15:17:10 2014 +0200 +++ b/OrthancServer/OrthancMoveRequestHandler.cpp Wed Apr 30 17:53:01 2014 +0200 @@ -88,9 +88,9 @@ context_.ReadFile(dicom, id, FileContentType_Dicom); { - ReusableDicomUserConnection::Connection connection + ReusableDicomUserConnection::Locker locker (context_.GetReusableDicomUserConnection(), remote_); - connection.GetConnection().Store(dicom); + locker.GetConnection().Store(dicom); } return Status_Success;
--- a/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp Wed Apr 30 15:17:10 2014 +0200 +++ b/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp Wed Apr 30 17:53:01 2014 +0200 @@ -75,10 +75,10 @@ } RemoteModalityParameters remote = GetModalityUsingSymbolicName(call.GetUriComponent("id", "")); - ReusableDicomUserConnection::Connection connection(context.GetReusableDicomUserConnection(), remote); + ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), remote); DicomFindAnswers answers; - connection.GetConnection().FindPatient(answers, m); + locker.GetConnection().FindPatient(answers, m); Json::Value result; answers.ToJson(result); @@ -103,10 +103,10 @@ } RemoteModalityParameters remote = GetModalityUsingSymbolicName(call.GetUriComponent("id", "")); - ReusableDicomUserConnection::Connection connection(context.GetReusableDicomUserConnection(), remote); + ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), remote); DicomFindAnswers answers; - connection.GetConnection().FindStudy(answers, m); + locker.GetConnection().FindStudy(answers, m); Json::Value result; answers.ToJson(result); @@ -132,10 +132,10 @@ } RemoteModalityParameters remote = GetModalityUsingSymbolicName(call.GetUriComponent("id", "")); - ReusableDicomUserConnection::Connection connection(context.GetReusableDicomUserConnection(), remote); + ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), remote); DicomFindAnswers answers; - connection.GetConnection().FindSeries(answers, m); + locker.GetConnection().FindSeries(answers, m); Json::Value result; answers.ToJson(result); @@ -162,10 +162,10 @@ } RemoteModalityParameters remote = GetModalityUsingSymbolicName(call.GetUriComponent("id", "")); - ReusableDicomUserConnection::Connection connection(context.GetReusableDicomUserConnection(), remote); + ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), remote); DicomFindAnswers answers; - connection.GetConnection().FindInstance(answers, m); + locker.GetConnection().FindInstance(answers, m); Json::Value result; answers.ToJson(result); @@ -184,10 +184,10 @@ } RemoteModalityParameters remote = GetModalityUsingSymbolicName(call.GetUriComponent("id", "")); - ReusableDicomUserConnection::Connection connection(context.GetReusableDicomUserConnection(), remote); + ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), remote); DicomFindAnswers patients; - connection.GetConnection().FindPatient(patients, m); + locker.GetConnection().FindPatient(patients, m); // Loop over the found patients Json::Value result = Json::arrayValue; @@ -204,7 +204,7 @@ m.CopyTagIfExists(patients.GetAnswer(i), DICOM_TAG_PATIENT_ID); DicomFindAnswers studies; - connection.GetConnection().FindStudy(studies, m); + locker.GetConnection().FindStudy(studies, m); patient["Studies"] = Json::arrayValue; @@ -223,7 +223,7 @@ m.CopyTagIfExists(studies.GetAnswer(j), DICOM_TAG_STUDY_INSTANCE_UID); DicomFindAnswers series; - connection.GetConnection().FindSeries(series, m); + locker.GetConnection().FindSeries(series, m); // Loop over the found series study["Series"] = Json::arrayValue; @@ -319,7 +319,7 @@ } RemoteModalityParameters p = GetModalityUsingSymbolicName(remote); - ReusableDicomUserConnection::Connection connection(context.GetReusableDicomUserConnection(), p); + ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), p); for (std::list<std::string>::const_iterator it = instances.begin(); it != instances.end(); ++it) @@ -328,7 +328,7 @@ std::string dicom; context.ReadFile(dicom, *it, FileContentType_Dicom); - connection.GetConnection().Store(dicom); + locker.GetConnection().Store(dicom); } call.GetOutput().AnswerBuffer("{}", "application/json");
--- a/UnitTestsSources/MultiThreading.cpp Wed Apr 30 15:17:10 2014 +0200 +++ b/UnitTestsSources/MultiThreading.cpp Wed Apr 30 17:53:01 2014 +0200 @@ -225,8 +225,8 @@ c.SetMillisecondsBeforeClose(200); printf("START\n"); fflush(stdout); { - ReusableDicomUserConnection::Connection cc(c, "STORESCP", "localhost", 2000, ModalityManufacturer_Generic); - cc.GetConnection().StoreFile("/home/jodogne/DICOM/Cardiac/MR.X.1.2.276.0.7230010.3.1.4.2831157719.2256.1336386844.676281"); + ReusableDicomUserConnection::Locker lock(c, "STORESCP", "localhost", 2000, ModalityManufacturer_Generic); + lock.GetConnection().StoreFile("/home/jodogne/DICOM/Cardiac/MR.X.1.2.276.0.7230010.3.1.4.2831157719.2256.1336386844.676281"); } printf("**\n"); fflush(stdout); @@ -234,8 +234,8 @@ printf("**\n"); fflush(stdout); { - ReusableDicomUserConnection::Connection cc(c, "STORESCP", "localhost", 2000, ModalityManufacturer_Generic); - cc.GetConnection().StoreFile("/home/jodogne/DICOM/Cardiac/MR.X.1.2.276.0.7230010.3.1.4.2831157719.2256.1336386844.676277"); + ReusableDicomUserConnection::Locker lock(c, "STORESCP", "localhost", 2000, ModalityManufacturer_Generic); + lock.GetConnection().StoreFile("/home/jodogne/DICOM/Cardiac/MR.X.1.2.276.0.7230010.3.1.4.2831157719.2256.1336386844.676277"); } Toolbox::ServerBarrier();