ActionStack
public class ActionStack : CustomDebugStringConvertible
An Action Stack is a trail of actions a user has performed from a specific Feature, with sub-stacks created when the user then uses an action from another feature, so each stack can represent a graph of actions broken down by feature.
Certain actions will Close
their stack, e.g. a Close
option on a document editing feature. Some stacks
may never be closed however, say a DrawingFeature
that allows use of many drawing tools. There is no
clear end to that except closing the document, an operation on a different feature.
!!! TODO: Work out what this means for sub-stacks. We want to retain information about what was
done in other features, in amongst the current stack’s features, but when the stack closes we
don’t want to lose that history if there was not a closing
action of the sub stack. Some sub-stacks
should be implicitly discarded however - e.g. drawing functions.
We need reference semantics here because we have parent relationships and navigate the graph.
!!! TODO: Use LIFOQueue to limit to the number of past items held to avoid blowing/leaking memory over time
-
The date and time this stack started.
Declaration
Swift
public let startDate: Date
-
Undocumented
Declaration
Swift
public let id: String
-
Undocumented
Declaration
Swift
public let parent: ActionStack?
-
Undocumented
Declaration
Swift
public let feature: FeatureDefinition.Type
-
Undocumented
Declaration
Swift
public let sessionName: String
-
Undocumented
Declaration
Swift
public var timeIntervalSinceStart: TimeInterval { get }
-
Undocumented
Declaration
Swift
public var timeIntervalToLastEntry: TimeInterval { get }
-
Undocumented
Declaration
Swift
public let userInitiated: Bool
-
Threadsafe access to the first entry, if any
Declaration
Swift
public var first: ActionStackEntry? { get }
-
Undocumented
Declaration
Swift
public init(id: String, sessionName: String, feature: FeatureDefinition.Type, userInitiated: Bool, parent: ActionStack?, maxEntries: Int)
-
Use this to access the entries of this stack. Not doing so is not threadsafe.
Declaration
Swift
public func withEntries<T>(_ block: ([ActionStackEntry]) -> T) -> T
-
Declaration
Swift
public var debugDescription: String { get }