Skip to content

Commit

Permalink
addDataEntry!,
Browse files Browse the repository at this point in the history
fix #391
  • Loading branch information
dehann committed Apr 26, 2020
1 parent e63d336 commit b8e256a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions src/BigData/services/AbstractBigDataEntries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ function addBigDataEntry!(dfg::AbstractDFG, label::Symbol, bde::AbstractBigDataE
return addBigDataEntry!(getVariable(dfg, label), bde)
end

addDataEntry!(x...) = addBigDataEntry!(x...)

"""
$(SIGNATURES)
Add Big Data Entry to distributed factor graph.
Should be extended if DFG variable is not returned by reference.
"""
function addDataEntry!(dfg::AbsstractDFG,
lbl::Symbol,
descr::Symbol,
mimeType::AbstractString,
data::Vector{UInt8} )
#
node = isVariable(dfg, lbl) ? getVariable(dfg, lbl) : getFactor(dfg, lbl)
# Make a big data entry in the graph - use JSON2 to just write this
element = GeneralBigDataEntry(dfg, node, descr, mimeType=mimeType)
# Set it in the store
addBigData!(fec.datastore, element, data)
# Add the entry to the graph
addBigDataEntry!(node, element)
end

"""
$SIGNATURES
Expand Down
2 changes: 1 addition & 1 deletion src/DistributedFactorGraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export getNeighborhood, getNeighbors, _getDuplicatedEmptyDFG
export copyGraph!, deepcopyGraph, deepcopyGraph!, buildSubgraph, mergeGraph!
# Big Data
##------------------------------------------------------------------------------
export addBigDataEntry!, getBigDataEntry, updateBigDataEntry!, deleteBigDataEntry!, getBigDataEntries, getBigDataKeys, hasDataEntry, hasBigDataEntry
export addBigDataEntry!, addDataEntry!, getBigDataEntry, updateBigDataEntry!, deleteBigDataEntry!, getBigDataEntries, getBigDataKeys, hasDataEntry, hasBigDataEntry


##------------------------------------------------------------------------------
Expand Down

0 comments on commit b8e256a

Please sign in to comment.