comparison OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp @ 5804:25df40a274fd find-refactoring

/changes: allowing filtering on multiple changes
author Alain Mazy <am@orthanc.team>
date Mon, 23 Sep 2024 15:40:27 +0200
parents 9990b4140c1c
children 272b0d0eef38
comparison
equal deleted inserted replaced
5803:e219e272650d 5804:25df40a274fd
1094 1094
1095 void StatelessDatabaseOperations::GetChangesExtended(Json::Value& target, 1095 void StatelessDatabaseOperations::GetChangesExtended(Json::Value& target,
1096 int64_t since, 1096 int64_t since,
1097 int64_t to, 1097 int64_t to,
1098 unsigned int maxResults, 1098 unsigned int maxResults,
1099 ChangeType changeType) 1099 const std::set<ChangeType>& changeType)
1100 { 1100 {
1101 class Operations : public ReadOnlyOperationsT5<Json::Value&, int64_t, int64_t, unsigned int, unsigned int> 1101 class Operations : public ReadOnlyOperationsT5<Json::Value&, int64_t, int64_t, unsigned int, const std::set<ChangeType>&>
1102 { 1102 {
1103 public: 1103 public:
1104 virtual void ApplyTuple(ReadOnlyTransaction& transaction, 1104 virtual void ApplyTuple(ReadOnlyTransaction& transaction,
1105 const Tuple& tuple) ORTHANC_OVERRIDE 1105 const Tuple& tuple) ORTHANC_OVERRIDE
1106 { 1106 {
1107 std::list<ServerIndexChange> changes; 1107 std::list<ServerIndexChange> changes;
1108 bool done; 1108 bool done;
1109 bool hasLast = false; 1109 bool hasLast = false;
1110 int64_t last = 0; 1110 int64_t last = 0;
1111 1111
1112 transaction.GetChangesExtended(changes, done, tuple.get<1>(), tuple.get<2>(), tuple.get<3>(), static_cast<ChangeType>(tuple.get<4>())); 1112 transaction.GetChangesExtended(changes, done, tuple.get<1>(), tuple.get<2>(), tuple.get<3>(), tuple.get<4>());
1113 if (changes.empty()) 1113 if (changes.empty())
1114 { 1114 {
1115 last = transaction.GetLastChangeIndex(); 1115 last = transaction.GetLastChangeIndex();
1116 hasLast = true; 1116 hasLast = true;
1117 } 1117 }