comparison OrthancServer/Sources/ServerIndex.cpp @ 4571:9224e107d613 db-changes

simplifying IDatabaseListener::SignalChange() as IDatabaseListener::SignalResourceDeleted()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 08 Mar 2021 16:49:34 +0100
parents 648defffc8cc
children c12d4e5f469b
comparison
equal deleted inserted replaced
4570:648defffc8cc 4571:9224e107d613
175 context_.SignalChange(*it); 175 context_.SignalChange(*it);
176 } 176 }
177 } 177 }
178 178
179 virtual void SignalRemainingAncestor(ResourceType parentType, 179 virtual void SignalRemainingAncestor(ResourceType parentType,
180 const std::string& publicId) 180 const std::string& publicId) ORTHANC_OVERRIDE
181 { 181 {
182 LOG(TRACE) << "Remaining ancestor \"" << publicId << "\" (" << parentType << ")"; 182 LOG(TRACE) << "Remaining ancestor \"" << publicId << "\" (" << parentType << ")";
183 183
184 if (hasRemainingLevel_) 184 if (hasRemainingLevel_)
185 { 185 {
195 remainingType_ = parentType; 195 remainingType_ = parentType;
196 remainingPublicId_ = publicId; 196 remainingPublicId_ = publicId;
197 } 197 }
198 } 198 }
199 199
200 virtual void SignalFileDeleted(const FileInfo& info) 200 virtual void SignalAttachmentDeleted(const FileInfo& info) ORTHANC_OVERRIDE
201 { 201 {
202 assert(Toolbox::IsUuid(info.GetUuid())); 202 assert(Toolbox::IsUuid(info.GetUuid()));
203 pendingFilesToRemove_.push_back(FileToRemove(info)); 203 pendingFilesToRemove_.push_back(FileToRemove(info));
204 sizeOfFilesToRemove_ += info.GetCompressedSize(); 204 sizeOfFilesToRemove_ += info.GetCompressedSize();
205 } 205 }
206 206
207 virtual void SignalChange(const ServerIndexChange& change) 207 virtual void SignalResourceDeleted(ResourceType type,
208 const std::string& publicId) ORTHANC_OVERRIDE
209 {
210 SignalChange(ServerIndexChange(ChangeType_Deleted, type, publicId));
211 }
212
213 void SignalChange(const ServerIndexChange& change)
208 { 214 {
209 LOG(TRACE) << "Change related to resource " << change.GetPublicId() << " of type " 215 LOG(TRACE) << "Change related to resource " << change.GetPublicId() << " of type "
210 << EnumerationToString(change.GetResourceType()) << ": " 216 << EnumerationToString(change.GetResourceType()) << ": "
211 << EnumerationToString(change.GetChangeType()); 217 << EnumerationToString(change.GetChangeType());
212 218