Skip to content

Commit 5efa24d

Browse files
committed
Remove get/setSerializationModule and always use Main
close #462
1 parent 1814391 commit 5efa24d

File tree

3 files changed

+1
-35
lines changed

3 files changed

+1
-35
lines changed

src/CloudGraphsDFG/services/CloudGraphsDFG.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ function setDescription!(dfg::CloudGraphsDFG, description::String)
3838
return getDescription(dfg)
3939
end
4040

41-
function getSerializationModule(dfg::CloudGraphsDFG)::Module where G <: AbstractDFG
42-
# TODO: If we need to specialize this for RoME etc, here is where we'll change it.
43-
return Main
44-
end
45-
4641
##==============================================================================
4742
## User/Robot/Session Data CRUD
4843
##==============================================================================

src/DistributedFactorGraphs.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ export hasTags, hasTagsNeighbors
207207
export findClosestTimestamp, findVariableNearTimestamp
208208

209209
# Serialization
210-
export setSerializationModule!, getSerializationModule
211210
export packVariable, unpackVariable, packFactor, unpackFactor
212211

213212
# File import and export

src/services/Serialization.jl

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -176,42 +176,14 @@ end
176176
## Serialization
177177
##==============================================================================
178178

179-
"""
180-
$(SIGNATURES)
181-
182-
Deserialization of IncrementalInference objects require discovery of foreign types.
183-
184-
Example:
185-
186-
Template to tunnel types from a user module:
187-
```julia
188-
# or more generic solution -- will always try Main if available
189-
IIF.setSerializationNamespace!(Main)
190-
191-
# or a specific package such as RoME if you import all variable and factor types into a specific module.
192-
using RoME
193-
IIF.setSerializationNamespace!(RoME)
194-
```
195-
"""
196-
function setSerializationModule!(dfg::G, mod::Module)::Nothing where G <: AbstractDFG
197-
@warn "Setting serialization module from AbstractDFG - override this in the '$(typeof(dfg)) structure! This is being ignored."
198-
end
199-
200-
function getSerializationModule(dfg::G)::Module where G <: AbstractDFG
201-
@warn "Retrieving serialization module from AbstractDFG - override this in the '$(typeof(dfg)) structure! This is returning Main"
202-
return Main
203-
end
204-
205179
"""
206180
$(SIGNATURES)
207181
Get a type from the serialization module inside DFG.
208182
"""
209183
function getTypeFromSerializationModule(dfg::G, moduleType::Symbol) where G <: AbstractDFG
210184
st = nothing
211-
mainmod = getSerializationModule(dfg)
212-
mainmod == nothing && error("Serialization module is null - please call setSerializationNamespace!(\"Main\" => Main) in your main program.")
213185
try
214-
st = getfield(mainmod, Symbol(moduleType))
186+
st = getfield(Main, Symbol(moduleType))
215187
catch ex
216188
@error "Unable to deserialize soft type $(d.softtype)"
217189
io = IOBuffer()

0 commit comments

Comments
 (0)