![]() |
Diffusion Apple API 6.11.5
Unified Client Library for iOS, tvOS and OS X / macOS
|
An immutable record value with support for binary deltas.
Properties | |
PTDiffusionRequest * | request |
PTDiffusionResponse * | response |
PTDiffusionUpdateConstraint * | updateConstraint |
![]() | |
NSData * | data |
Instance Methods | |
(nullable PTDiffusionRecordV2Model *) | - modelWithSchema:error: |
(nullable PTDiffusionRecordV2Model *) | - validatedModelWithSchema:error: |
(nullable NSArray< NSArray< NSString * > * > *) | - recordsWithError: |
(nullable NSArray< NSString * > *) | - fieldsWithError: |
(PTDiffusionRecordV2Delta *) | - diffFromOriginalRecord: |
(BOOL) | - isEqualToRecord: |
![]() | |
(instancetype) | - initWithData: |
(BOOL) | - isEqualToBytes: |
- (PTDiffusionRecordV2Delta *) diffFromOriginalRecord: | (PTDiffusionRecordV2 *) | originalRecord |
Compare this value with an earlier version to calculate a structural delta.
originalRecord | The original value to compare with this value. |
- (nullable NSArray< NSString * > *) fieldsWithError: | (NSError **) | error |
Returns the data value as an array of fields.
This disregards record boundaries. If there is more than one record, they are concatenated to produce a list of all of the fields.
error | If this method returns nil to indicate that an error occurred then this will be populated with the reason for that failure. |
nil
if an error occurred, in which case *error
will be populated with the failure reason.- (BOOL) isEqualToRecord: | (nullable PTDiffusionRecordV2 *) | record |
Compares the receiver to the given record.
record | The record object with which to compare the receiver. |
YES
if the data in record is equal to the contents of the receiver, otherwise NO
.- (nullable PTDiffusionRecordV2Model *) modelWithSchema: | (PTDiffusionRecordV2Schema *) | schema | |
error: | (NSError **) | error | |
Parses the value into a model based upon a specified schema.
This assumes that data is compatible with the schema and does not do any validation. There is no need to validate the data if this has been done on entry or at the server. However, if the data is invalid then issues may occur when attempting to access it.
If it is not certain that the data is valid then the validatedModelWithSchema:error: method should be used instead.
schema | The schema to use for parsing the data. |
error | If this method returns nil to indicate that an error occurred then this will be populated with the reason for that failure. |
nil
if an error occurred, in which case *error
will be populated with the failure reason. Reasons for failure include:- (nullable NSArray< NSArray< NSString * > * > *) recordsWithError: | (NSError **) | error |
Returns the data value as an array of arrays of strings.
error | If this method returns nil to indicate that an error occurred then this will be populated with the reason for that failure. |
nil
if an error occurred, in which case *error
will be populated with the failure reason.+ (PTDiffusionRequestHandler *) requestHandlerWithDelegate: | (id< PTDiffusionRecordV2RequestDelegate >) | delegate |
Creates a request handler capable of receiving record requests for a handler registered at the server.
delegate | The object which will handle the incoming requests. A weak reference is maintained to this object by the returned handler. |
NSInvalidArgumentException | Raised if the delegate argument is `nil`. |
+ (PTDiffusionRequestStream *) requestStreamWithDelegate: | (id< PTDiffusionRecordV2RequestStreamDelegate >) | delegate |
Creates a request stream capable of receiving record requests.
delegate | The object which will handle the incoming requests. A weak reference is maintained to this object by the returned stream. |
NSInvalidArgumentException | Raised if the delegate argument is `nil`. |
+ (PTDiffusionSessionResponseStream *) sessionResponseStreamWithDelegate: | (id< PTDiffusionRecordV2SessionResponseStreamDelegate >) | delegate |
Creates a response stream capable of receiving record responses from discrete sessions.
delegate | The object which will handle the incoming responses. A weak reference is maintained to this object by the returned stream. |
NSInvalidArgumentException | Raised if the delegate argument is `nil`. |
+ (PTDiffusionValueStream *) timeSeriesEventValueStreamWithDelegate: | (id< PTDiffusionRecordV2TimeSeriesEventValueStreamDelegate >) | delegate |
Creates a value stream capable of receiving record time series events.
delegate | The object which will handle the incoming stream. A weak reference is maintained to this object by the returned stream. |
NSInvalidArgumentException | Raised if the delegate argument is `nil`. |
- (nullable PTDiffusionRecordV2Model *) validatedModelWithSchema: | (PTDiffusionRecordV2Schema *) | schema | |
error: | (NSError **) | error | |
Parses the value into a model based upon a specified schema.
schema | The schema to use for parsing the data. |
error | If this method returns nil to indicate that an error occurred then this will be populated with the reason for that failure. |
nil
if an error occurred, in which case *error
will be populated with the failure reason. Reasons for failure include:+ (PTDiffusionValueStream *) valueStreamWithDelegate: | (id< PTDiffusionRecordV2ValueStreamDelegate >) | delegate |
Creates a value stream capable of receiving record values.
delegate | The object which will handle the incoming stream. A weak reference is maintained to this object by the returned stream. |
NSInvalidArgumentException | Raised if the delegate argument is `nil`. |
|
readnonatomicassign |
A request that can be used to send this value using messaging.
|
readnonatomicassign |
A response that can be used to send this value using messaging.
|
readnonatomicassign |
An update constraint requiring the current value of a topic to match this value.
Use noValue (PTDiffusionUpdateConstraint) to check if the topic has no value.
This constraint is unsatisfied if no topic is present at the path.