comparison OrthancServer/Sources/Database/IDatabaseWrapper.h @ 5220:df39c7583a49 db-protobuf

preparing virtual methods for labels
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Apr 2023 18:09:04 +0200
parents 450ac804d3af
children d0f7c742d397
comparison
equal deleted inserted replaced
5218:afa96af2eb5a 5220:df39c7583a49
198 198
199 virtual void ApplyLookupResources(std::list<std::string>& resourcesId, 199 virtual void ApplyLookupResources(std::list<std::string>& resourcesId,
200 std::list<std::string>* instancesId, // Can be NULL if not needed 200 std::list<std::string>* instancesId, // Can be NULL if not needed
201 const std::vector<DatabaseConstraint>& lookup, 201 const std::vector<DatabaseConstraint>& lookup,
202 ResourceType queryLevel, 202 ResourceType queryLevel,
203 const std::set<std::string>& withLabels,
204 const std::set<std::string>& withoutLabels,
203 uint32_t limit) = 0; 205 uint32_t limit) = 0;
204 206
205 // Returns "true" iff. the instance is new and has been inserted 207 // Returns "true" iff. the instance is new and has been inserted
206 // into the database. If "false" is returned, the content of 208 // into the database. If "false" is returned, the content of
207 // "result" is undefined, but "instanceId" must be properly 209 // "result" is undefined, but "instanceId" must be properly
234 236
235 virtual bool LookupResourceAndParent(int64_t& id, 237 virtual bool LookupResourceAndParent(int64_t& id,
236 ResourceType& type, 238 ResourceType& type,
237 std::string& parentPublicId, 239 std::string& parentPublicId,
238 const std::string& publicId) = 0; 240 const std::string& publicId) = 0;
241
242
243 /**
244 * Primitives introduced in Orthanc 1.12.0
245 **/
246
247 virtual void AddLabel(int64_t resource,
248 const std::string& label) = 0;
249
250 virtual void RemoveLabel(int64_t resource,
251 const std::string& label) = 0;
252
253 virtual void GetLabels(std::set<std::string>& target,
254 int64_t resource) = 0;
239 }; 255 };
240 256
241 257
242 virtual ~IDatabaseWrapper() 258 virtual ~IDatabaseWrapper()
243 { 259 {
258 274
259 virtual void Upgrade(unsigned int targetVersion, 275 virtual void Upgrade(unsigned int targetVersion,
260 IStorageArea& storageArea) = 0; 276 IStorageArea& storageArea) = 0;
261 277
262 virtual bool HasRevisionsSupport() const = 0; 278 virtual bool HasRevisionsSupport() const = 0;
279
280 virtual bool HasLabelsSupport() const = 0;
263 }; 281 };
264 } 282 }