comparison OrthancServer/Sources/ServerIndex.h @ 4565:3495a3d97ab6 db-changes

start of read-write transactions
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 08 Mar 2021 12:34:17 +0100
parents bb1c365f9e44
children b812a5f2cef3
comparison
equal deleted inserted replaced
4564:5a0adc1c19a9 4565:3495a3d97ab6
153 bool hasTransferSyntax, 153 bool hasTransferSyntax,
154 DicomTransferSyntax transferSyntax, 154 DicomTransferSyntax transferSyntax,
155 bool hasPixelDataOffset, 155 bool hasPixelDataOffset,
156 uint64_t pixelDataOffset); 156 uint64_t pixelDataOffset);
157 157
158 bool DeleteResource(Json::Value& target /* out */,
159 const std::string& uuid,
160 ResourceType expectedType);
161
162 void LogExportedResource(const std::string& publicId,
163 const std::string& remoteModality);
164
165 void SetProtectedPatient(const std::string& publicId, 158 void SetProtectedPatient(const std::string& publicId,
166 bool isProtected); 159 bool isProtected);
167 160
168 void SetMetadata(const std::string& publicId, 161 void SetMetadata(const std::string& publicId,
169 MetadataType type, 162 MetadataType type,
399 explicit ReadWriteTransaction(IDatabaseWrapper& db) : 392 explicit ReadWriteTransaction(IDatabaseWrapper& db) :
400 ReadOnlyTransaction(db) 393 ReadOnlyTransaction(db)
401 { 394 {
402 } 395 }
403 396
397 void DeleteResource(int64_t id)
398 {
399 db_.DeleteResource(id);
400 }
401
402 void LogExportedResource(const ExportedResource& resource)
403 {
404 db_.LogExportedResource(resource);
405 }
404 }; 406 };
405 407
406 408
407 class IReadOnlyOperations : public boost::noncopyable 409 class IReadOnlyOperations : public boost::noncopyable
408 { 410 {
420 public: 422 public:
421 virtual ~IReadWriteOperations() 423 virtual ~IReadWriteOperations()
422 { 424 {
423 } 425 }
424 426
425 virtual void Apply(ReadWriteTransaction& transaction) = 0; 427 virtual void Apply(ReadWriteTransaction& transaction,
428 Listener& listener) = 0;
426 }; 429 };
427 430
428 private: 431 private:
429 void ApplyInternal(IReadOnlyOperations* readOperations, 432 void ApplyInternal(IReadOnlyOperations* readOperations,
430 IReadWriteOperations* writeOperations); 433 IReadWriteOperations* writeOperations);
537 void ApplyLookupResources(std::vector<std::string>& resourcesId, 540 void ApplyLookupResources(std::vector<std::string>& resourcesId,
538 std::vector<std::string>* instancesId, // Can be NULL if not needed 541 std::vector<std::string>* instancesId, // Can be NULL if not needed
539 const DatabaseLookup& lookup, 542 const DatabaseLookup& lookup,
540 ResourceType queryLevel, 543 ResourceType queryLevel,
541 size_t limit); 544 size_t limit);
545
546 bool DeleteResource(Json::Value& target /* out */,
547 const std::string& uuid,
548 ResourceType expectedType);
549
550 void LogExportedResource(const std::string& publicId,
551 const std::string& remoteModality);
542 }; 552 };
543 } 553 }