Diffusion Apple API  6.9.0
Unified Client Library for iOS, tvOS and OS X / macOS
 All Classes Files Functions Variables Enumerations Enumerator Properties Pages
Class Methods | Properties | Instance Methods | List of all members
PTDiffusionBinary Class Reference

Introduction

An immutable binary value with support for binary deltas.

Since
5.9
Inheritance diagram for PTDiffusionBinary:
PTDiffusionBytes

Class Methods

(PTDiffusionValueStream *) + valueStreamWithDelegate:
 
(PTDiffusionValueStream *) + timeSeriesEventValueStreamWithDelegate:
 
(PTDiffusionRequestHandler *) + requestHandlerWithDelegate:
 
(PTDiffusionRequestStream *) + requestStreamWithDelegate:
 
(PTDiffusionSessionResponseStream *) + sessionResponseStreamWithDelegate:
 

Properties

PTDiffusionRequestrequest
 
PTDiffusionResponseresponse
 
PTDiffusionUpdateConstraintupdateConstraint
 
- Properties inherited from PTDiffusionBytes
NSData * data
 

Instance Methods

(nullable PTDiffusionBinary *) - applyDelta:error:
 
(PTDiffusionBinaryDelta *) - diffFromBinary:
 
(BOOL) - isEqualToBinary:
 
- Instance Methods inherited from PTDiffusionBytes
(instancetype) - initWithData:
 
(BOOL) - isEqualToBytes:
 

Method Documentation

- (nullable PTDiffusionBinary *) applyDelta: (PTDiffusionBinaryDelta *)  delta
error: (NSError **)  error 

Apply a binary delta to the receiver's binary value to create a new value.

Parameters
deltaThe delta describing the changes to be applied to the receiver's value in order to create the value to be returned.
errorLocation to store a reason if this method returns nil to indicate failure.
Returns
The new binary value or nil if there was a failure when applying the delta (e.g. either the delta is invalid).
Exceptions
NSInvalidArgumentExceptionRaised if the delta argument is nil.
Since
5.9
- (PTDiffusionBinaryDelta *) diffFromBinary: (PTDiffusionBinary *)  binary

Compare the receiver's binary value with another (e.g. an earlier version) to create a binary delta.

Parameters
binaryThe original to which the delta should be able to be applied in order to generate the value represented by the receiver.
Returns
A binary delta representing the difference between binary and the receiver.
Exceptions
NSInvalidArgumentExceptionRaised if the binary argument is nil.
Since
5.9
- (BOOL) isEqualToBinary: (nullable PTDiffusionBinary *)  binary

Compares the receiver to the given binary.

Parameters
binaryThe binary object with which to compare the receiver.
Returns
YES if the data in binary is equal to the contents of the receiver, otherwise NO.
Note
Two binary objects are equal if they hold the same number of data bytes, and if the bytes at the same position in the objects are the same.
Since
5.9
+ (PTDiffusionRequestHandler *) requestHandlerWithDelegate: (id< PTDiffusionBinaryRequestDelegate >)  delegate

Creates a request handler capable of receiving Binary requests for a handler registered at the server.

Parameters
delegateThe object which will handle the incoming requests. A weak reference is maintained to this object by the returned handler.
Returns
An object reliant on the supplied delegate that can be registered at the server using the Messaging feature.
Exceptions
NSInvalidArgumentExceptionRaised if the delegate argument is nil.
See Also
PTDiffusionMessagingFeature
Since
6.0
+ (PTDiffusionRequestStream *) requestStreamWithDelegate: (id< PTDiffusionBinaryRequestStreamDelegate >)  delegate

Creates a request stream capable of receiving Binary requests.

Parameters
delegateThe object which will handle the incoming requests. A weak reference is maintained to this object by the returned stream.
Returns
An object reliant on the supplied delegate that can be set as the receiver of requests using the Messaging feature.
Exceptions
NSInvalidArgumentExceptionRaised if the delegate argument is nil.
See Also
PTDiffusionMessagingFeature
Since
6.0
+ (PTDiffusionSessionResponseStream *) sessionResponseStreamWithDelegate: (id< PTDiffusionBinarySessionResponseStreamDelegate >)  delegate

Creates a response stream capable of receiving Binary responses from discrete sessions.

Parameters
delegateThe object which will handle the incoming responses. A weak reference is maintained to this object by the returned stream.
Returns
An object reliant on the supplied delegate that can be set as the receiver of requests using the Messaging feature.
Exceptions
NSInvalidArgumentExceptionRaised if the delegate argument is nil.
See Also
PTDiffusionMessagingFeature
Since
6.1
+ (PTDiffusionValueStream *) timeSeriesEventValueStreamWithDelegate: (id< PTDiffusionBinaryTimeSeriesEventValueStreamDelegate >)  delegate

Creates a value stream capable of receiving binary time series events.

Parameters
delegateThe object which will handle the incoming stream. A weak reference is maintained to this object by the returned stream.
Returns
An object reliant on the supplied delegate that can be added as a receiver of values using the Topics feature.
Exceptions
NSInvalidArgumentExceptionRaised if the delegate argument is nil.
See Also
PTDiffusionTopicsFeature
Since
6.0
+ (PTDiffusionValueStream *) valueStreamWithDelegate: (id< PTDiffusionBinaryValueStreamDelegate >)  delegate

Creates a value stream capable of receiving binary values.

Parameters
delegateThe object which will handle the incoming stream. A weak reference is maintained to this object by the returned stream.
Returns
An object reliant on the supplied delegate that can be added as a receiver of values using the Topics feature.
Exceptions
NSInvalidArgumentExceptionRaised if the delegate argument is nil.
See Also
PTDiffusionTopicsFeature
Since
5.9

Property Documentation

- (PTDiffusionRequest*) request
readnonatomicassign

A request that can be used to send this value using messaging.

Since
6.0
- (PTDiffusionResponse*) response
readnonatomicassign

A response that can be used to send this value using messaging.

Since
6.1
- (PTDiffusionUpdateConstraint*) updateConstraint
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 useful when changing the value of a topic. It is unsatisfied if no topic is present at the path, making it unsuitable for operations that try to add topics.

Since
6.3