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

Introduction

A topic selector identifies one or more topics.

Topic selector objects are only used by the local client library and are immutable.

For more information on topic selector evaluation see the Topic Selectors guide.

See Also
PTDiffusionMessagingFeature
PTDiffusionTopicsFeature
Since
5.6
Inheritance diagram for PTDiffusionTopicSelector:

Class Methods

(instancetype) + NS_UNAVAILABLE
 
(instancetype) + topicSelectorWithExpression:
 
(instancetype) + topicSelectorWithAnyOf:
 
(instancetype) + topicSelectorWithAnyExpression:
 

Properties

NSString * expression
 
NSString * pathPrefix
 

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
(BOOL) - selectsTopicPath:
 
(BOOL) - isEqualToTopicSelector:
 

Method Documentation

- (BOOL) isEqualToTopicSelector: (nullable PTDiffusionTopicSelector *)  topicSelector

Compares the receiver to the given topic selector.

Parameters
topicSelectorThe topic selector object with which to compare the receiver.
Returns
YES if the topic selector is equal to the receiver, otherwise NO.
Since
5.6
- (BOOL) selectsTopicPath: (nullable NSString *)  topicPath

Evaluate this receiver against a topic path.

Parameters
topicPathThe topic path to evaluate against. May be nil or an empty string, in which case this method returns NO.
Returns
YES if the receiver selects the topicPath.
Since
5.6
+ (instancetype) topicSelectorWithAnyExpression: (NSArray< NSString * > *)  expressions

A convenience wrapper around topicSelectorWithAnyOf:.

Parameters
expressionsThe selector expressions.
Returns
A selector which matches if any of expressions do
Since
5.9
+ (instancetype) topicSelectorWithAnyOf: (NSArray< PTDiffusionTopicSelector * > *)  selectors

Create a selector that matches if any of the provided selectors match.

Parameters
selectorsThe selectors
Returns
A selector which matches if any of selectors do.
Since
5.9
+ (instancetype) topicSelectorWithExpression: (NSString *)  expression

Return a topic selector object initialized with the given expression.

Parameters
expressionThe expression to be used for evalutating topic paths.
Since
5.6

Property Documentation

- (NSString*) expression
readnonatomicassign

The expression association with the receiver.

Since
5.6
- (NSString*) pathPrefix
readnonatomicassign

The topic path prefix from this selector pattern.

Returns the largest fixed topic path that begins the selector expression. For path selectors, this is the entire path. For split pattern or full pattern selectors, this is a topic path up to, but not including, the first part of the path that contains a regular expression.

For selector sets, this method will return the largest prefix that is common to all included selectors.

If there is no common prefix, an empty string will be returned.

Since
6.1