comparison Framework/Oracle/ParseDicomFileCommand.cpp @ 1134:87fbeb823375 broker

allocating messages from oracle commands on the stack
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 06 Nov 2019 15:16:45 +0100
parents a8bf81756839
children a0a33e5ea5bb
comparison
equal deleted inserted replaced
1133:0e3a3be313fd 1134:87fbeb823375
25 25
26 #include <boost/filesystem/path.hpp> 26 #include <boost/filesystem/path.hpp>
27 27
28 namespace OrthancStone 28 namespace OrthancStone
29 { 29 {
30 void ParseDicomFileCommand::SuccessMessage::Setup() 30 ParseDicomFileCommand::SuccessMessage::SuccessMessage(ParseDicomFileCommand& command,
31 Orthanc::ParsedDicomFile& dicom,
32 size_t fileSize,
33 bool hasPixelData) :
34 OracleMessageBase(command),
35 dicom_(dicom),
36 fileSize_(fileSize),
37 hasPixelData_(hasPixelData)
31 { 38 {
32 if (!dicom_->GetTagValue(sopInstanceUid_, Orthanc::DICOM_TAG_SOP_INSTANCE_UID)) 39 if (!dicom.GetTagValue(sopInstanceUid_, Orthanc::DICOM_TAG_SOP_INSTANCE_UID))
33 { 40 {
34 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat, 41 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat,
35 "DICOM instance missing tag SOPInstanceUID"); 42 "DICOM instance missing tag SOPInstanceUID");
36 } 43 }
37 }
38
39
40 ParseDicomFileCommand::SuccessMessage::SuccessMessage(const ParseDicomFileCommand& command,
41 DcmFileFormat& dicom,
42 size_t fileSize,
43 bool hasPixelData) :
44 OriginMessage(command),
45 fileSize_(fileSize),
46 hasPixelData_(hasPixelData)
47 {
48 dicom_.reset(new Orthanc::ParsedDicomFile(dicom));
49 Setup();
50 }
51
52
53 ParseDicomFileCommand::SuccessMessage::SuccessMessage(const ParseDicomFileCommand& command,
54 boost::shared_ptr<Orthanc::ParsedDicomFile> dicom,
55 size_t fileSize,
56 bool hasPixelData) :
57 OriginMessage(command),
58 dicom_(dicom),
59 fileSize_(fileSize),
60 hasPixelData_(hasPixelData)
61 {
62 Setup();
63 } 44 }
64 45
65 46
66 std::string ParseDicomFileCommand::GetDicomDirPath(const std::string& dicomDirPath, 47 std::string ParseDicomFileCommand::GetDicomDirPath(const std::string& dicomDirPath,
67 const std::string& file) 48 const std::string& file)