Skip to content

Commit 5078296

Browse files
committed
better API names
1 parent f5329a3 commit 5078296

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/CloudGraphsDFG/services/CommonFunctions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function _structToNeo4jProps(inst::Union{User, Robot, Session, PVND, N, APPE, AB
179179
if fieldname == :solverData
180180
fnctype = getSolverData(inst).fnc.usrfnc!
181181
try
182-
packtype = convert(PackedInferenceType, fnctype)
182+
packtype = convertPackedType(fnctype)
183183
packed = convert(PackedFunctionNodeData{packtype}, getSolverData(inst))
184184
packedJson = JSON2.write(packed)
185185
val = "\"$(replace(packedJson, "\"" => "\\\""))\"" # Escape slashes too

src/Common.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ _getmodule(t::T) where T = T.name.module
44
_getname(t::T) where T = T.name.name
55

66

7-
Base.convert(::Type{<:PackedInferenceType}, t::Union{T, Type{T}}) where {T <: FunctorInferenceType} = getfield(_getmodule(t), Symbol("Packed$(_getname(t))"))
8-
Base.convert(::Type{<:FunctorInferenceType}, ::Type{PT}) where {PT <: PackedInferenceType} = getfield(PT.name.module, Symbol(string(PT.name.name)[7:end]))
7+
convertPackedType(t::Union{T, Type{T}}) where {T <: FunctorInferenceType} = getfield(_getmodule(t), Symbol("Packed$(_getname(t))"))
8+
convertStructType(::Type{PT}) where {PT <: PackedInferenceType} = getfield(PT.name.module, Symbol(string(PT.name.name)[7:end]))
99

1010

1111
##==============================================================================

src/DistributedFactorGraphs.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ export getFactorType, getFactorFunction
200200
# Node Data
201201
export mergeVariableData!, mergeGraphVariableData!
202202

203+
# Serialization type conversion
204+
export convertPackedType, convertStructType
205+
203206
##------------------------------------------------------------------------------
204207
## Other utility functions
205208
##------------------------------------------------------------------------------

src/services/Serialization.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function packFactor(dfg::G, f::DFGFactor)::Dict{String, Any} where G <: Abstract
238238
# Pack the node data
239239
fnctype = getSolverData(f).fnc.usrfnc!
240240
try
241-
packtype = convert(PackedInferenceType, fnctype)
241+
packtype = convertPackedType(fnctype)
242242
packed = convert(PackedFunctionNodeData{packtype}, getSolverData(f))
243243
props["data"] = JSON2.write(packed)
244244
catch ex
@@ -259,7 +259,7 @@ end
259259
function decodePackedType(::Type{T}, packeddata::GenericFunctionNodeData{PT}) where {T<:FactorOperationalMemory, PT}
260260
# usrtyp = convert(FunctorInferenceType, packeddata.fnc)
261261
# Also look at parentmodule
262-
usrtyp = convert(FunctorInferenceType, PT)
262+
usrtyp = convertStructType(PT)
263263
fulltype = DFG.FunctionNodeData{T{usrtyp}}
264264
factordata = convert(fulltype, packeddata)
265265
return factordata

0 commit comments

Comments
 (0)