@@ -31,20 +31,30 @@ mutable struct GenericFunctionNodeData{T, S}
31
31
end
32
32
33
33
"""
34
- $(SIGNATURES)
34
+ $(TYPEDEF)
35
+
35
36
Fundamental structure for a DFG factor.
36
37
"""
37
38
mutable struct DFGFactor{T, S} <: AbstractDFGFactor
38
39
label:: Symbol
39
40
tags:: Vector{Symbol}
40
41
data:: GenericFunctionNodeData{T, S}
41
42
solvable:: Int
43
+ timestamp:: DateTime
42
44
_internalId:: Int64
43
45
_variableOrderSymbols:: Vector{Symbol}
44
- DFGFactor {T, S} (label:: Symbol ) where {T, S} = new {T, S} (label, Symbol[], GenericFunctionNodeData {T, S} (), 0 , 0 , Symbol[])
45
- DFGFactor {T, S} (label:: Symbol , _internalId:: Int64 ) where {T, S} = new {T, S} (label, Symbol[], GenericFunctionNodeData {T, S} (), 0 , _internalId, Symbol[])
46
+ # TODO back to front ts and _internalId for legacy reasons
47
+ DFGFactor {T, S} (label:: Symbol , _internalId:: Int64 = 0 , ts:: DateTime = now ()) where {T, S} = new {T, S} (label, Symbol[], GenericFunctionNodeData {T, S} (), 0 , ts, 0 , Symbol[])
48
+ # DFGFactor{T, S}(label::Symbol, _internalId::Int64) where {T, S} = new{T, S}(label, Symbol[], GenericFunctionNodeData{T, S}(), 0, now(), _internalId, Symbol[])
46
49
end
47
50
51
+ """
52
+ $(SIGNATURES)
53
+
54
+ Convenience constructor for DFG factor.
55
+ """
56
+ DFGFactor (label:: Symbol ; tags:: Vector{Symbol} = Symbol[], data:: GenericFunctionNodeData{T, S} = GenericFunctionNodeData {T, S} (), solvable:: Int = 0 , timestamp:: DateTime = now (), _internalId:: Int64 = 0 , _variableOrderSymbols:: Vector{Symbol} = Symbol[]) where {T, S} = DFGFactor {T,S} (label,tags,data,solvable,timestamp,_internalId,_variableOrderSymbols)
57
+
48
58
# Simply for convenience - don't export
49
59
const PackedFunctionNodeData{T} = GenericFunctionNodeData{T, <: AbstractString }
50
60
PackedFunctionNodeData (x1, x2, x3, x4, x5:: S , x6:: T , x7:: String = " " , x8:: Vector{Int} = Int[], x9:: Int = 0 ) where {T <: PackedInferenceType , S <: AbstractString } = GenericFunctionNodeData (x1, x2, x3, x4, x5, x6, x7, x8, x9)
@@ -80,6 +90,7 @@ SkeletonDFGFactor(label::Symbol, variableOrderSymbols::Vector{Symbol} = Symbol[]
80
90
81
91
const FactorDataLevel0 = Union{DFGFactor, DFGFactorSummary, SkeletonDFGFactor}
82
92
const FactorDataLevel1 = Union{DFGFactor, DFGFactorSummary}
93
+ # const FactorDataLevel2 = Union{DFGFactor}
83
94
84
95
"""
85
96
$SIGNATURES
@@ -100,7 +111,21 @@ $SIGNATURES
100
111
101
112
Set the tags for a factor.
102
113
"""
103
- setTag!s (f:: FactorDataLevel0 , tags:: Vector{Symbol} ) = f. tags = tags
114
+ setTags! (f:: FactorDataLevel0 , tags:: Vector{Symbol} ) = f. tags = tags
115
+
116
+ """
117
+ $SIGNATURES
118
+
119
+ Get the timestamp from a DFGFactor object.
120
+ """
121
+ timestamp (v:: FactorDataLevel1 ) = v. timestamp
122
+
123
+ """
124
+ $SIGNATURES
125
+
126
+ Set the timestamp of a DFGFactor object.
127
+ """
128
+ setTimestamp! (v:: FactorDataLevel1 , ts:: DateTime ) = v. timestamp = ts
104
129
105
130
"""
106
131
$SIGNATURES
0 commit comments