Skip to content

Commit f32ea2a

Browse files
authored
Merge pull request #297 from JuliaRobotics/maint/20q1/dep_fncargvID##288
Start deprecate on field fncargvID close #288
2 parents 294c1f3 + 77fb351 commit f32ea2a

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/CommonAccessors.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ getTimestamp(v::DataLevel1) = v.timestamp
3737
"""
3838
$SIGNATURES
3939
40-
Set the timestamp of a DFGFactor object.
41-
Dev note:
42-
Since it is not mutable it has to return a new variable with the updated timestamp.
40+
Set the timestamp of a DFGVariable object returning a new DFGVariable.
41+
Note:
42+
Since `timestamp` is not mutable `setTimestamp` returns a new variable with the updated timestamp.
4343
Use `updateVariable!` to update it in the factor graph.
44-
TODO either this or we should make the field/variable mutable
4544
"""
4645
function setTimestamp(v::DFGVariable, ts::DateTime)
4746
return DFGVariable(v.label, ts, v.tags, v.ppeDict, v.solverDataDict, v.smallData, v.bigData, v._dfgNodeParams)

src/entities/DFGFactor.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ mutable struct GenericFunctionNodeData{T, S}
3030
# GenericFunctionNodeData(x1, x2, x3, x4, x5::S, x6::T, x7::String) where {T, S} = new{T,S}(x1, x2, x3, x4, x5, x6, x7)
3131
end
3232

33+
Base.getproperty(x::GenericFunctionNodeData,f::Symbol) = begin
34+
f == :fncargvID && Base.depwarn("GenericFunctionNodeData field fncargvID will be deprecated, use `getVariableOrder` instead",:getproperty)#@warn "fncargvID is deprecated, use `getVariableOrder` instead"
35+
36+
getfield(x, f)
37+
38+
end
39+
40+
Base.setproperty!(x::GenericFunctionNodeData,f::Symbol, val) = begin
41+
f == :fncargvID && Base.depwarn("GenericFunctionNodeData field fncargvID will be deprecated, use `getVariableOrder` instead",:getproperty)#@warn "fncargvID is deprecated, use `getVariableOrder` instead"
42+
43+
setfield!(x,f,val)
44+
45+
end
46+
3347
"""
3448
$(TYPEDEF)
3549
Complete factor structure for a DistributedFactorGraph factor.

0 commit comments

Comments
 (0)