comparison OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp @ 5216:450ac804d3af db-protobuf

simplifying IDatabaseWrapper::LogChange()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Apr 2023 14:49:33 +0200
parents 8b6da4fdf9fe
children df39c7583a49
comparison
equal deleted inserted replaced
5215:8b6da4fdf9fe 5216:450ac804d3af
1053 } 1053 }
1054 } 1054 }
1055 } 1055 }
1056 1056
1057 1057
1058 virtual void LogChange(int64_t internalId, 1058 virtual void LogChange(ChangeType changeType,
1059 const ServerIndexChange& change) ORTHANC_OVERRIDE 1059 ResourceType resourceType,
1060 int64_t internalId,
1061 const std::string& publicId,
1062 const std::string& date) ORTHANC_OVERRIDE
1060 { 1063 {
1061 OrthancPluginChange tmp; 1064 OrthancPluginChange tmp;
1062 tmp.seq = change.GetSeq(); 1065 tmp.seq = -1; // Unused (it is attributed by the database engine)
1063 tmp.changeType = static_cast<int32_t>(change.GetChangeType()); 1066 tmp.changeType = static_cast<int32_t>(changeType);
1064 tmp.resourceType = Plugins::Convert(change.GetResourceType()); 1067 tmp.resourceType = Plugins::Convert(resourceType);
1065 tmp.publicId = change.GetPublicId().c_str(); 1068 tmp.publicId = publicId.c_str();
1066 tmp.date = change.GetDate().c_str(); 1069 tmp.date = date.c_str();
1067 1070
1068 CheckSuccess(that_.backend_.logChange(that_.payload_, &tmp)); 1071 CheckSuccess(that_.backend_.logChange(that_.payload_, &tmp));
1069 } 1072 }
1070 1073
1071 1074