Skip to content

Commit 41ecee3

Browse files
committed
push pop user/robot/session data
1 parent e79db3c commit 41ecee3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export DFGVariableSummary, DFGFactorSummary, AbstractDFGSummary
2626

2727
#graph small data
2828
export getUserData, setUserData, getRobotData, setRobotData, getSessionData, setSessionData
29+
export pushUserData!, pushRobotData!, pushSessionData!, popUserData!, popRobotData!, popSessionData!
2930

3031
# Services/AbstractDFG Exports
3132
export hasFactor, hasVariable, isInitialized, getFactorFunction, isVariable, isFactor

src/services/AbstractDFG.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ function setSessionData(dfg::AbstractDFG, data::Dict{Symbol, String})::Bool
8585
return true
8686
end
8787

88+
pushUserData!(dfg::AbstractDFG, pair::Pair{Symbol,String}) = push!(dfg.userData, pair)
89+
pushRobotData!(dfg::AbstractDFG, pair::Pair{Symbol,String}) = push!(dfg.userData, pair)
90+
pushSessionData!(dfg::AbstractDFG, pair::Pair{Symbol,String}) = push!(dfg.userData, pair)
91+
92+
popUserData!(dfg::AbstractDFG, key::Symbol) = pop!(dfg.userData, key)
93+
popRobotData!(dfg::AbstractDFG, key::Symbol) = pop!(dfg.userData, key)
94+
popSessionData!(dfg::AbstractDFG, key::Symbol) = pop!(dfg.userData, key)
95+
8896
"""
8997
$(SIGNATURES)
9098
True if the variable or factor exists in the graph.

0 commit comments

Comments
 (0)