Skip to content

Commit 86c7d4b

Browse files
authored
deleteBlobEntry! in PackedVariable (#1051)
1 parent 378f6d0 commit 86c7d4b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/DataBlobs/services/BlobEntry.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,18 @@ Notes:
195195
function deleteBlobEntry!(var::AbstractDFGVariable, key::Symbol)
196196
return pop!(var.dataDict, key)
197197
end
198+
199+
function deleteBlobEntry!(var::PackedVariable, key::Symbol)
200+
if !hasBlobEntry(var, key)
201+
throw(
202+
KeyError(
203+
"No dataEntry label $(key) found in variable $(getLabel(var)). Available keys: $(keys(var.dataDict))",
204+
),
205+
)
206+
end
207+
return deleteat!(var.blobEntries, findfirst(x -> x.label == key, var.blobEntries))
208+
end
209+
198210
function deleteBlobEntry!(dfg::AbstractDFG, label::Symbol, key::Symbol)
199211
#users responsibility to delete data in db before deleting entry
200212
# !isVariable(dfg, label) && return nothing

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ export copyGraph!, deepcopyGraph, deepcopyGraph!, buildSubgraph, mergeGraph!
233233

234234
export hasBlobEntry,
235235
getBlobEntry,
236+
getBlobEntryFirst,
236237
addBlobEntry!,
237238
updateBlobEntry!,
238239
deleteBlobEntry!,

0 commit comments

Comments
 (0)