CandidateSink

@interface CandidateSink : NSObject <ICandidateHandler>

This class implements the WallClock protocol’s Candidate measurement processing functionality. Candidate mesaurements received by the WCClient object are enqueued in the CandidateSink object for processing. A thread in this class services this queue; it takes a Candidate measurement, passes it through a number of filters (See IFilter.h) and if the measurement survives the filtering process, it then submit it to a WC algorithm object (See IWCAlgo.h) for WC offset and dispersion calculation.

  • A reference to a wallclock whose offset can be adjusted

    Declaration

    Objective-C

    @property (readonly, nonatomic) int *wallclockref;

    Swift

    var wallclockref: UnsafeMutablePointer
  • An algorithm to process Candidate instances and update the WallClock, if necessary

    Declaration

    Objective-C

    @property (readonly, nonatomic) id<IWCAlgo> algorithm;

    Swift

    var algorithm: IWCAlgo! { get }
  • List of filters (id)

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) NSMutableArray *filterList;

    Swift

    var filterList: NSMutableArray! { get set }
  • Unused initialiser

    Declaration

    Objective-C

    - (instancetype)init;

    Return Value

    nil

  • Initialise the Candidate measurements handling object

    Declaration

    Objective-C

    - (id)initWith:(id)wall_clock
         Algorithm:(id<IWCAlgo>)algorithm
        AndFilters:(NSArray *)filter_array;

    Swift

    init!(_ wall_clock: Any!, algorithm: IWCAlgo!, andFilters filter_array: [Any]!)

    Parameters

    wall_clock
    • the WallClock for which an offset is being calculated. We are using the feedback loop model (see pg 153 CSS Specs).
    algorithm
    • an object that conforms to the IWCAlgo.h protocol e.g. LowestDispersionAlgorithm
    filter_array
    • a set of filters for filtering the measurements e.g. LowestDispersionFilter

    Return Value

    initialised CandidateSink instance

  • Add a candidate filter to this object

    Declaration

    Objective-C

    - (id)addFilter:(id<IFilter>)filterobjref;

    Swift

    func add(_ filterobjref: IFilter!) -> Any!

    Parameters

    filterobjref
    • a filter object

    Return Value

    CandidateSink instance with filter

  • Start this component

    Declaration

    Objective-C

    - (void)start;

    Swift

    func start()
  • Stop this component

    Declaration

    Objective-C

    - (void)stop;

    Swift

    func stop()