Diffusion .NET Classic API - Core and Common  5.9.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
PushTechnology.DiffusionCore.Messaging.Topic.TopicSet Class Reference

An ordered set of topic names and/or topic selectors. More...

Inheritance diagram for PushTechnology.DiffusionCore.Messaging.Topic.TopicSet:

Public Member Functions

 TopicSet ()
 Constructor. More...
 
 TopicSet (params string[] topics)
 Constructs a topic set from any number of topic specifier strings. More...
 
 TopicSet (IEnumerable< string > topics)
 Constructs a topic set from a collection of topic names and/or selectors. More...
 
bool Validate (bool allowSelectors)
 Validates all of the entries in the topic set. More...
 
bool Add (string topic)
 Adds a topic. More...
 
override string ToString ()
 Converts this object to a human-readable string. More...
 
bool IsNullOrEmpty ()
 Returns whether this TopicSet is null or empty. More...
 

Static Public Attributes

static char delimiter = ','
 The topic delimiter. More...
 

Properties

bool IsEmpty [get]
 Returns whether this TopicSet is empty. More...
 
IEnumerator< string > Iterator [get]
 Returns the iterator, or enumerator. More...
 
int Size [get]
 Returns the number of topics. More...
 
List< string > Topics [get]
 Returns the list of topics. More...
 
string[] TopicsArray [get]
 Returns the list of topics as an array. More...
 

Detailed Description

An ordered set of topic names and/or topic selectors.

A topic name may be a simple topic name or a hierarchical topic name representing a topic with a hierarchy of topics (e.g. a/b).

A topic selector takes the form of a hierarchic name, but each element can be a regular expression matching against topic names at that level of the topic tree. A selector can therefore be used to represent more than one topic.

A selector that ends with a '/' indicates that all topics beneath the matching topic(s) in the hierarchy are to be selected.

A selector that ends with '//' indicates that the matching topic(s) AND all topics beneath the matching topic(s) in the topic hierarchy are to be selected.

In addition to the above syntax it is also possible to specify each and every specifier element as a regex pattern so that the string would represent any topic that matched the hierarchical specifier in all of its elements. So you could say "A/.+X" which would indicate all topics subordinate to all topics owned by "A" that end in the letter "X".

The set order is maintained in the order that topic names/selectors are added to the set.

Whether selectors are allowed within the set depends upon what the set is to be used for.

Constructor & Destructor Documentation

PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.TopicSet ( )

Constructor.

PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.TopicSet ( params string[]  topics)

Constructs a topic set from any number of topic specifier strings.

A topic specifier string can contain a topic name or selector or a comma delimited list of topic names and/or selectors.

If no topic strings are supplied then an empty topic set is created.

Parameters
topicsAn array of topic specifier strings.
PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.TopicSet ( IEnumerable< string >  topics)

Constructs a topic set from a collection of topic names and/or selectors.

Parameters
topicsA collection of topic strings. If this is null or empty then an empty topic set is created.

Member Function Documentation

bool PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.Add ( string  topic)

Adds a topic.

Parameters
topic
Returns
bool PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.IsNullOrEmpty ( )

Returns whether this TopicSet is null or empty.

Returns
override string PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.ToString ( )

Converts this object to a human-readable string.

Returns
bool PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.Validate ( bool  allowSelectors)

Validates all of the entries in the topic set.

Parameters
allowSelectorsIf true then topic selectors will be allowed within the set otherwise all entries must be valid topic names.

Member Data Documentation

char PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.delimiter = ','
static

The topic delimiter.

Property Documentation

bool PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.IsEmpty
get

Returns whether this TopicSet is empty.

IEnumerator<string> PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.Iterator
get

Returns the iterator, or enumerator.

int PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.Size
get

Returns the number of topics.

List<string> PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.Topics
get

Returns the list of topics.

string [] PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.TopicsArray
get

Returns the list of topics as an array.