GPKGUserRowSync

Objective-C

@interface GPKGUserRowSync : NSObject

Swift

class GPKGUserRowSync : NSObject

User Row Sync to support sharing a single user row read copy when multiple near simultaneous asynchronous requests are made

  • Initialize

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()

    Return Value

    new user row sync

  • Get the row if another same id request has been made by waiting until the row has been set. If no current request, lock the for the calling thread which should read the row and call “setRow: (GPKGUserRow *) row withId: (int) id” when complete.

    Declaration

    Objective-C

    - (GPKGUserRow *)rowOrLockId:(int)id;

    Swift

    func rowOrLockId(_ id: Int32) -> GPKGUserRow!

    Parameters

    id

    user row id

    Return Value

    row if retrieved from a previous request, null if calling thread should read row and set using “setRow: (GPKGUserRow *) row withId: (int) id”

  • Get the row if another same id number request has been made by waiting until the row has been set. If no current request, lock the for the calling thread which should read the row and call “setRow: (GPKGUserRow *) row withNumber: (NSNumber *) id” when complete.

    Declaration

    Objective-C

    - (GPKGUserRow *)rowOrLockNumber:(NSNumber *)id;

    Swift

    func rowOrLock(_ id: NSNumber!) -> GPKGUserRow!

    Parameters

    id

    user row id

    Return Value

    row if retrieved from a previous request, null if calling thread should read row and set using “setRow: (GPKGUserRow *) row withNumber: (NSNumber *) id”

  • Set the row, row id, and notify all waiting threads to retrieve the row.

    Declaration

    Objective-C

    - (void)setRow:(GPKGUserRow *)row withId:(int)id;

    Swift

    func setRow(_ row: GPKGUserRow!, withId id: Int32)

    Parameters

    row

    user row or null

    id

    user row id

  • Set the row, row id number, and notify all waiting threads to retrieve the row.

    Declaration

    Objective-C

    - (void)setRow:(GPKGUserRow *)row withNumber:(NSNumber *)id;

    Swift

    func setRow(_ row: GPKGUserRow!, with id: NSNumber!)

    Parameters

    row

    user row or null

    id

    user row number id