EventLog

public class EventLog<T> : SensorDelegateLogger where T : Event

Generic event log with optional data retention enforcement functions

  • Undocumented

    Declaration

    Swift

    public var events: [T]
  • Undocumented

    Declaration

    Swift

    public override init()
  • Undocumented

    Declaration

    Swift

    public override init(filename: String)
  • Undocumented

    Declaration

    Swift

    public func append(_ event: T)
  • Get records from start date (inclusive) to end date (exclusive)

    Declaration

    Swift

    public func subdata(start: Date, end: Date) -> [T]
  • Get all encounters from start date (inclusive)

    Declaration

    Swift

    public func subdata(start: Date) -> [T]
  • Remove all log records before date (exclusive). Use this function to implement data retention policy.

    Declaration

    Swift

    public func remove(before: Date)
  • Remove all log records before retention period.

    Declaration

    Swift

    public func removeBefore(retention: TimeInterval)
  • Get events in time windows

    Declaration

    Swift

    public func reduce(into timeWindow: TimeInterval) -> [(time: Date, events: [T])]