Skip to content

Commit c3d9950

Browse files
authored
Merge pull request #571 from JuliaRobotics/maint/20Q3/softtypedepr
Deprecate softtype fields, add getManifolds and getDimension interface
2 parents e73933d + 8951535 commit c3d9950

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

src/Deprecated.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,15 @@ const fetchDataEntryElement = getDataEntryBlob
174174
const fetchData = getDataEntryBlob
175175

176176
#
177+
178+
## softtype deprections
179+
function Base.getproperty(x::InferenceVariable, f::Symbol)
180+
if f==:dims
181+
Base.depwarn("Softtype $(typeof(x)), field dims is deprecated, extend and use `getDims` instead",:getproperty)
182+
elseif f==:manifolds
183+
Base.depwarn("Softtype $(typeof(x)), field manifolds is deprecated, extend and use `getManifolds` instead",:getproperty)
184+
else
185+
Base.depwarn("Softtype $(typeof(x)), will be required to be a singleton type in the future and can no longer have fields. *.$f called",:getproperty)
186+
end
187+
return getfield(x,f)
188+
end

src/entities/DFGVariable.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
abstract type InferenceVariable end
66

7+
"""
8+
$SIGNATURES
9+
Interface function to return the softtype dimention of an InferenceVariable, extend this function for all Types<:InferenceVariable.
10+
"""
11+
function getDimension end
12+
"""
13+
$SIGNATURES
14+
Interface function to return the softtype manifolds of an InferenceVariable, extend this function for all Types<:InferenceVariable.
15+
"""
16+
function getManifolds end
717
##==============================================================================
818
## VariableNodeData
919
##==============================================================================

src/services/CompareUtils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For now abstract `InferenceVariable`s are considered equal if they are the same
1010
If your implentation has aditional properties such as `DynPose2` with `ut::Int64` (microsecond time) or support different manifolds
1111
implement compare if needed.
1212
=#
13-
==(a::InferenceVariable,b::InferenceVariable) = typeof(a) == typeof(b) && a.dims == b.dims && a.manifolds == b.manifolds
13+
# ==(a::InferenceVariable,b::InferenceVariable) = typeof(a) == typeof(b) && a.dims == b.dims && a.manifolds == b.manifolds
1414

1515
==(a::FactorOperationalMemory, b::FactorOperationalMemory) = typeof(a) == typeof(b)
1616

0 commit comments

Comments
 (0)