Interface IValueUpdater<TValue>
Represents an updater that may be used to update topics of a certain type by specifying new values.
Namespace: PushTechnology.ClientInterface.Client.Features.Control.Topics
Assembly: Diffusion.Client.dll
Syntax
public interface IValueUpdater<TValue>
Type Parameters
Name | Description |
---|---|
TValue | The value type which represents the IDataType of the topics that the updater can be used for. |
Remarks
Deprecated: The ITopicUpdateControl feature has been replaced by the ITopicUpdate feature and will be removed in a future release. The ITopicUpdate feature provides equivalent and additional functionality, such as conditional updates.
Such an updater may be obtained from an ITopicUpdater using the ValueUpdater<TValue>() method.
Since 5.8
Methods
GetCachedValue(String)
Returns the current cached value for a given topic path.
Declaration
TValue GetCachedValue(string topicPath)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath | The topic to obtain the current value for. |
Returns
Type | Description |
---|---|
TValue | The current (latest) value or null if there is no value for the given path, this might be because no value has been sent or the value has been removed from the cache |
RemoveCachedValues(ITopicSelector)
Removes values from the value cache.
Declaration
void RemoveCachedValues(ITopicSelector topics)
Parameters
Type | Name | Description |
---|---|---|
ITopicSelector | topics | The selector indicating the topics for which entries are to be removed. |
Remarks
If a cached value is removed, the next update for a topic will transmit the whole value to the server rather than a delta.
RemoveCachedValues(String)
Removes values from the value cache.
Declaration
void RemoveCachedValues(string topics)
Parameters
Type | Name | Description |
---|---|---|
String | topics | The selector expression or topic path indicating the topics for which entries are to be removed. |
Remarks
If a cached value is removed, the next update for a topic will transmit the whole value to the server rather than a delta.
Update(String, TValue, ITopicUpdaterUpdateCallback)
Updates a topic to a specified value.
Declaration
void Update(string topicPath, TValue value, ITopicUpdaterUpdateCallback callback)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath | The topic path. |
TValue | value | The new value for the topic. |
ITopicUpdaterUpdateCallback | callback | The callback for notifications on the update request. |
Remarks
For exclusive updaters, this method caches the supplied value so that subsequent calls for the same topic will be able to use the current value to calculate deltas of change to send to the server rather than having to send the whole value.
For non-exclusive updating, the complete value is always sent to the server, and the value is not cached.
Update<TContext>(String, TValue, TContext, ITopicUpdaterUpdateContextCallback<TContext>)
Updates a topic to a specified value.
Declaration
void Update<TContext>(string topicPath, TValue value, TContext context, ITopicUpdaterUpdateContextCallback<TContext> callback)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath | The topic path. |
TValue | value | The new value for the topic. |
TContext | context | The context to supply to callback notifications. May be null. |
ITopicUpdaterUpdateContextCallback<TContext> | callback | The callback for notifications on the update request. |
Type Parameters
Name | Description |
---|---|
TContext | The context type. |
Remarks
This method will cache the supplied value so that subsequent calls for the same topic will be able to use the current value to calculate deltas of change to send to the server rather than having to send the whole value.