comparison OrthancServer/Sources/Database/StatelessDatabaseOperations.h @ 5237:cd2258ca7894 db-protobuf

log about missing support for labels
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Apr 2023 09:07:47 +0200
parents 3a61fd50f804
children 367e8af46cfd
comparison
equal deleted inserted replaced
5236:5e0db9eac1f8 5237:cd2258ca7894
164 164
165 class ReadOnlyTransaction : public boost::noncopyable 165 class ReadOnlyTransaction : public boost::noncopyable
166 { 166 {
167 private: 167 private:
168 ITransactionContext& context_; 168 ITransactionContext& context_;
169 bool hasLabelsSupport_;
169 170
170 protected: 171 protected:
171 IDatabaseWrapper::ITransaction& transaction_; 172 IDatabaseWrapper::ITransaction& transaction_;
172 173
173 public: 174 public:
174 explicit ReadOnlyTransaction(IDatabaseWrapper::ITransaction& transaction, 175 explicit ReadOnlyTransaction(IDatabaseWrapper::ITransaction& transaction,
175 ITransactionContext& context) : 176 ITransactionContext& context,
177 bool hasLabelsSupport) :
176 context_(context), 178 context_(context),
179 hasLabelsSupport_(hasLabelsSupport),
177 transaction_(transaction) 180 transaction_(transaction)
178 { 181 {
179 } 182 }
180 183
181 ITransactionContext& GetTransactionContext() 184 ITransactionContext& GetTransactionContext()
182 { 185 {
183 return context_; 186 return context_;
187 }
188
189 bool HasLabelsSupport() const
190 {
191 return hasLabelsSupport_;
184 } 192 }
185 193
186 /** 194 /**
187 * Higher-level constructions 195 * Higher-level constructions
188 **/ 196 **/
365 373
366 class ReadWriteTransaction : public ReadOnlyTransaction 374 class ReadWriteTransaction : public ReadOnlyTransaction
367 { 375 {
368 public: 376 public:
369 ReadWriteTransaction(IDatabaseWrapper::ITransaction& transaction, 377 ReadWriteTransaction(IDatabaseWrapper::ITransaction& transaction,
370 ITransactionContext& context) : 378 ITransactionContext& context,
371 ReadOnlyTransaction(transaction, context) 379 bool hasLabelsSupport) :
380 ReadOnlyTransaction(transaction, context, hasLabelsSupport)
372 { 381 {
373 } 382 }
374 383
375 void AddAttachment(int64_t id, 384 void AddAttachment(int64_t id,
376 const FileInfo& attachment, 385 const FileInfo& attachment,