comparison OrthancServer/DicomInstanceToStore.h @ 1005:84b6d7bca6db lua-scripting

refactoring of ServerContext::Store
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Jul 2014 14:34:11 +0200
parents a226e0959d8b
children 649d47854314
comparison
equal deleted inserted replaced
1004:a226e0959d8b 1005:84b6d7bca6db
85 } 85 }
86 86
87 Deallocate(); 87 Deallocate();
88 content_ = content; 88 content_ = content;
89 toDelete_ = true; 89 toDelete_ = true;
90 isReadOnly_ = true; 90 isReadOnly_ = false;
91 } 91 }
92 92
93 void SetReference(const T& content) // Read-only assign, without transfering ownership 93 void SetReference(T& content) // Read and write assign, without transfering ownership
94 {
95 Deallocate();
96 content_ = &content;
97 toDelete_ = false;
98 isReadOnly_ = false;
99 }
100
101 void SetConstReference(const T& content) // Read-only assign, without transfering ownership
94 { 102 {
95 Deallocate(); 103 Deallocate();
96 content_ = &const_cast<T&>(content); 104 content_ = &const_cast<T&>(content);
97 toDelete_ = false; 105 toDelete_ = false;
98 isReadOnly_ = true; 106 isReadOnly_ = true;
184 void ComputeMissingInformation(); 192 void ComputeMissingInformation();
185 193
186 public: 194 public:
187 void SetBuffer(const std::string& dicom) 195 void SetBuffer(const std::string& dicom)
188 { 196 {
189 buffer_.SetReference(dicom); 197 buffer_.SetConstReference(dicom);
190 } 198 }
191 199
192 void SetParsedDicomFile(ParsedDicomFile& parsed) 200 void SetParsedDicomFile(ParsedDicomFile& parsed)
193 { 201 {
194 parsed_.SetReference(parsed); 202 parsed_.SetReference(parsed);
195 } 203 }
196 204
197 void SetSummary(const DicomMap& summary) 205 void SetSummary(const DicomMap& summary)
198 { 206 {
199 summary_.SetReference(summary); 207 summary_.SetConstReference(summary);
200 } 208 }
201 209
202 void SetJson(const Json::Value& json) 210 void SetJson(const Json::Value& json)
203 { 211 {
204 json_.SetReference(json); 212 json_.SetConstReference(json);
205 } 213 }
206 214
207 const std::string GetRemoteAet() const 215 const std::string GetRemoteAet() const
208 { 216 {
209 return remoteAet_; 217 return remoteAet_;