comparison OrthancServer/DatabaseWrapper.h @ 1286:b4acdb37e43b

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Feb 2015 16:51:19 +0100
parents ee43f0d611a8
children 6e7e5ed91c2d
comparison
equal deleted inserted replaced
1285:5730f374e4e6 1286:b4acdb37e43b
66 void GetExportedResourcesInternal(std::list<ExportedResource>& target, 66 void GetExportedResourcesInternal(std::list<ExportedResource>& target,
67 bool& done, 67 bool& done,
68 SQLite::Statement& s, 68 SQLite::Statement& s,
69 unsigned int maxResults); 69 unsigned int maxResults);
70 70
71 void ClearTable(const std::string& tableName);
72
71 public: 73 public:
72 DatabaseWrapper(const std::string& path); 74 DatabaseWrapper(const std::string& path);
73 75
74 DatabaseWrapper(); 76 DatabaseWrapper();
75 77
125 127
126 virtual bool LookupAttachment(FileInfo& attachment, 128 virtual bool LookupAttachment(FileInfo& attachment,
127 int64_t id, 129 int64_t id,
128 FileContentType contentType); 130 FileContentType contentType);
129 131
130 virtual void SetMainDicomTags(int64_t id, 132 virtual void SetMainDicomTag(int64_t id,
131 const DicomMap& tags); 133 const DicomTag& tag,
134 const std::string& value);
132 135
133 virtual void GetMainDicomTags(DicomMap& map, 136 virtual void GetMainDicomTags(DicomMap& map,
134 int64_t id); 137 int64_t id);
135 138
136 virtual void GetChildrenPublicId(std::list<std::string>& result, 139 virtual void GetChildrenPublicId(std::list<std::string>& result,
185 virtual void FlushToDisk() 188 virtual void FlushToDisk()
186 { 189 {
187 db_.FlushToDisk(); 190 db_.FlushToDisk();
188 } 191 }
189 192
190 virtual void ClearTable(const std::string& tableName); 193 virtual void ClearChanges()
194 {
195 ClearTable("Changes");
196 }
197
198 virtual void ClearExportedResources()
199 {
200 ClearTable("ExportedResources");
201 }
191 202
192 virtual bool IsExistingResource(int64_t internalId); 203 virtual bool IsExistingResource(int64_t internalId);
193 204
194 virtual void LookupIdentifier(std::list<int64_t>& result, 205 virtual void LookupIdentifier(std::list<int64_t>& result,
195 const DicomTag& tag, 206 const DicomTag& tag,
211 const char* GetErrorMessage() const 222 const char* GetErrorMessage() const
212 { 223 {
213 return db_.GetErrorMessage(); 224 return db_.GetErrorMessage();
214 } 225 }
215 226
216 virtual void GetChildren(std::list<std::string>& childrenPublicIds, 227 void GetChildren(std::list<std::string>& childrenPublicIds,
217 int64_t id); 228 int64_t id);
218 229
219 virtual int64_t GetTableRecordCount(const std::string& table); 230 int64_t GetTableRecordCount(const std::string& table);
220 231
221 virtual bool GetParentPublicId(std::string& result, 232 bool GetParentPublicId(std::string& result,
222 int64_t id); 233 int64_t id);
223 234
224 }; 235 };
225 } 236 }