Skip to content

Commit c33caea

Browse files
committed
Deprecate softtype fields and add getManifolds and getDimension interface
1 parent e73933d commit c33caea

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
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
##==============================================================================

0 commit comments

Comments
 (0)