Description

October 10, 2018 ยท View on GitHub

Holds a set of subscriptions use by both TMQTTServers and TMQTTClients and performs set operations on these lists of subscriptions.

Clients can subscribe to topics either by creating TMQTTClientSubscription components and linking them to TMQTTClient, or by constructing a TMQTTSubscriptionList object and passing it to TMQTTClient.Subscribe()

Server sessions use TMQTTSubscriptionList to keep track of what topics each client is subscribed to.

Properties

NameVisibilityAccessDescription
CountpublicROThe number of subscriptions in the Items[] property
Items[]publicROAn indexed array of TMQTTSubscription objects

Methods

NameVisibilityDescription
AssignpublicIf Source is a TMQTTSubscriptionList object, then clear the list and copy the items from Source
ClearpublicClears the list of subscriptions
FindpublicFind a subscription by Filter string. Returns nil if nothing found.
NewpublicFactory method to create a new TMQTTSubscription object and add it to the list. Use this method to quickly construct a Subscription list.
UpdatepublicFind a subscription object with a matching Filter and replace it with the object provided. Free's the replaced object.
RemovepublicRemove a subscription from the list and free it from memory
DeletepublicDelete the subscription at the indexth position in the list and free it from memory
MergeListpublicMerge's another subscription list into this list without creating duplicates. If two subscriptions share the same Filter text then the existing one is replaced by the one provided.
DeleteListpublicDelete's a list of subscriptions from this subscription list. Any subscription with a matching Filter are removed and destroyed.
RemoveDuplicatespublicRemoves duplicate subscriptions, preserving the copy with the highes QoS value. Must be called after RemoveInvalidSubscriptions. Returns the number of duplicate subscriptions removed.
RemoveInvalidSubscriptionspublicRemove any subscription that could not be parsed into tokens by the TMQTTTokenizer or that contain invalid tokens according to the MQTT specifications. Returns the number of invalid subscriptions removed.