![]() |
Diffusion .NET Classic API - Core and Common
5.9.4
|
An ordered set of topic names and/or topic selectors. More...
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... | |
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.
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.
topics | An 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.
topics | A collection of topic strings. If this is null or empty then an empty topic set is created. |
bool PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.Add | ( | string | topic | ) |
Adds a topic.
topic |
bool PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.IsNullOrEmpty | ( | ) |
Returns whether this TopicSet is null or empty.
override string PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.ToString | ( | ) |
Converts this object to a human-readable string.
bool PushTechnology.DiffusionCore.Messaging.Topic.TopicSet.Validate | ( | bool | allowSelectors | ) |
Validates all of the entries in the topic set.
allowSelectors | If true then topic selectors will be allowed within the set otherwise all entries must be valid topic names. |
|
static |
The topic delimiter.
|
get |
Returns whether this TopicSet is empty.
|
get |
Returns the iterator, or enumerator.
|
get |
Returns the number of topics.
|
get |
Returns the list of topics.
|
get |
Returns the list of topics as an array.