@@ -27,6 +27,8 @@ buildSourceString(dfg::AbstractDFG, label::Symbol) =
27
27
"""
28
28
$(SIGNATURES)
29
29
Get data entry
30
+
31
+ Also see: [`addDataEntry`](@ref), [`getDataBlob`](@ref), [`listDataEntries`](@ref)
30
32
"""
31
33
function getDataEntry (var:: AbstractDFGVariable , key:: Symbol )
32
34
! hasDataEntry (var, key) && error (" No dataEntry label $(key) found in variable $(getLabel (var)) " )
@@ -48,19 +50,16 @@ getDataEntry(dfg::AbstractDFG, label::Symbol, key::Union{Symbol,UUID}) = getData
48
50
"""
49
51
$(SIGNATURES)
50
52
Add Data Entry to a DFG variable
53
+ Should be extended if DFG variable is not returned by reference.
54
+
55
+ Also see: [`getDataEntry`](@ref), [`addDataBlob`](@ref), [`copyDataEntry!`](@ref)
51
56
"""
52
57
function addDataEntry! (var:: AbstractDFGVariable , bde:: AbstractDataEntry )
53
58
haskey (var. dataDict, bde. label) && error (" Data entry $(bde. label) already exists in variable $(getLabel (var)) " )
54
59
var. dataDict[bde. label] = bde
55
60
return bde
56
61
end
57
62
58
-
59
- """
60
- $(SIGNATURES)
61
- Add Data Entry to distributed factor graph.
62
- Should be extended if DFG variable is not returned by reference.
63
- """
64
63
function addDataEntry! (dfg:: AbstractDFG , label:: Symbol , bde:: AbstractDataEntry )
65
64
return addDataEntry! (getVariable (dfg, label), bde)
66
65
end
@@ -173,3 +172,23 @@ function listDataEntrySequence( dfg::AbstractDFG,
173
172
entMsk = entReg .!= = nothing
174
173
ents_[findall (entMsk)] |> _sort
175
174
end
175
+
176
+ """
177
+ $SIGNATURES
178
+
179
+ Add a data entry into the destination variable which already exists
180
+ in a source variable.
181
+
182
+ See also: [`addDataEntry!`](@ref), [`getDataEntry`](@ref), [`listDataEntries`](@ref), [`getDataBlob`](@ref)
183
+ """
184
+ function copyDataEntry! (
185
+ dst:: AbstractDFG ,
186
+ dlbl:: Symbol ,
187
+ src:: AbstractDFG ,
188
+ slbl:: Symbol ,
189
+ bllb:: Union{Symbol, UUID, <:AbstractString, Regex}
190
+ )
191
+ #
192
+ de = getDataEntry (src, slbl, bllb)
193
+ addDataEntry! (dst, dlbl, de)
194
+ end
0 commit comments