dxFeed .Net API  5.13.0
dxFeed .Net API library intended to provide market data access for DX clients
Public Member Functions | Properties | Private Attributes
com.dxfeed.api.DXFeedTimeSeriesSubscription< E > Class Template Reference

More...

Inheritance diagram for com.dxfeed.api.DXFeedTimeSeriesSubscription< E >:
[legend]
Collaboration diagram for com.dxfeed.api.DXFeedTimeSeriesSubscription< E >:
[legend]

Public Member Functions

 DXFeedTimeSeriesSubscription (DXEndpoint endpoint)
 Creates detached time-series subscription for a single event type. More...
 
 DXFeedTimeSeriesSubscription (DXEndpoint endpoint, params Type[] eventTypes)
 Creates detached subscription for the given list of event types. More...
 
- Public Member Functions inherited from com.dxfeed.api.DXFeedSubscription< E >
 DXFeedSubscription (DXEndpoint endpoint)
 Creates detached subscription for a single event type. More...
 
 DXFeedSubscription (DXEndpoint endpoint, params Type[] eventTypes)
 Creates detached subscription for the given list of event types. More...
 
void Attach (IDXFeed feed)
 Attaches subscription to the specified feed. More...
 
void Detach (IDXFeed feed)
 Detaches subscription from the specified feed. More...
 
void Close ()
 
bool ContainsEventType (Type eventType)
 Returns true if this subscription contains the corresponding event type. More...
 
void Clear ()
 
ISet< object > GetSymbols ()
 Returns a set of subscribed symbols. The resulting set cannot be modified. The contents of the resulting set are undefined if the set of symbols is changed after invocation of this method, but the resulting set is safe for concurrent reads from any threads. The resulting set maybe either a snapshot of the set of the subscribed symbols at the time of invocation or a weakly consistent view of the set. More...
 
void SetSymbols (ICollection< object > symbols)
 
void SetSymbols (params object[] symbols)
 
void AddSymbols (ICollection< object > symbols)
 
void AddSymbols (params object[] symbols)
 
void AddSymbols (object symbol)
 
void RemoveSymbols (ICollection< object > symbols)
 
void RemoveSymbols (params object[] symbols)
 
void AddEventListener (IDXFeedEventListener< E > listener)
 Adds listener for events. Newly added listeners start receiving only new events. This method does nothing if this subscription is IsClosed. More...
 
void RemoveEventListener (IDXFeedEventListener< E > listener)
 Removes listener for events. More...
 

Properties

long FromTimeStamp [get, set]
 Gets or sets the earliest timestamp from which time-series of events shall be received. The timestamp is in milliseconds from midnight, January 1, 1970 UTC. More...
 
- Properties inherited from com.dxfeed.api.DXFeedSubscription< E >
bool IsClosed [get]
 Returns true if this subscription is closed.

See also
Close()
More...
 
ISet< Type > EventTypes [get]
 Returns a set of subscribed event types. The resulting set cannot be modified. More...
 
- Properties inherited from com.dxfeed.api.IDXFeedSubscription< E >
bool IsClosed [get]
 Returns true if this subscription is closed.

See also
Close()
More...
 
ISet< Type > EventTypes [get]
 Returns a set of subscribed event types. The resulting set cannot be modified. More...
 
- Properties inherited from com.dxfeed.api.IDXFeedTimeSeriesSubscription< E >
long FromTimeStamp [get, set]
 Gets or sets the earliest timestamp from which time-series of events shall be received. The timestamp is in milliseconds from midnight, January 1, 1970 UTC. More...
 

Private Attributes

long fromTime = long.MaxValue
 
DXEndpoint endpointInstance
 
object timeLocker = new object()
 

Additional Inherited Members

- Protected Member Functions inherited from com.dxfeed.api.DXFeedSubscription< E >
 DXFeedSubscription ()
 
 DXFeedSubscription (params Type[] eventTypes)
 
void AddSymbols (bool callUpdateEvent, params object[] symbols)
 
void Endpoint_OnClosing (object sender, EventArgs e)
 
- Protected Attributes inherited from com.dxfeed.api.DXFeedSubscription< E >
IDxSubscription subscriptionInstance = null
 
List< IDXFeedEventListener< E > > eventListeners = new List<IDXFeedEventListener<E>>()
 
object eventListenerLocker = new object()
 
- Package Functions inherited from com.dxfeed.api.DXFeedSubscription< E >
 DXFeedSubscription (DXEndpoint endpoint, long time, IndexedEventSource source)
 Creates detached snapshot subscription for a single event type. More...
 
- Events inherited from com.dxfeed.api.DXFeedSubscription< E >
DXFeedSymbolsUpdateEventHandler OnSymbolsAdded
 Event calls when any symbols is added to subscription. More...
 
DXFeedSymbolsUpdateEventHandler OnSymbolsRemoved
 Event calls when any symbols is removed from subscription. More...
 
DXFeedSubscriptionClosedEventHandler OnSubscriptionClosed
 Event calls when subscription is closing. More...
 
- Events inherited from com.dxfeed.api.IDXFeedSubscription< E >
DXFeedSymbolsUpdateEventHandler OnSymbolsAdded
 Event calls when any symbols is added to subscription. More...
 
DXFeedSymbolsUpdateEventHandler OnSymbolsRemoved
 Event calls when any symbols is removed from subscription. More...
 
DXFeedSubscriptionClosedEventHandler OnSubscriptionClosed
 Event calls when subscription is closing. More...
 

Detailed Description

Extends IDXFeedSubscription<E> to conveniently subscribe to time-series of events for a set of symbols and event types.

Only events that implement IDxTimeSeriesEvent<T> interface can be subscribed to with IDXFeedTimeSeriesSubscription<E>.

From time

The value of FromTimeStamp property defines the time-span of events that are subscribed to. Only events that satisfy event.TimeStamp >= thisSubscription.FromTime are looked for.

The value FromTimeStamp is initially set to long.MaxValue with a special meaning that no events will be received until FromTime is changed with FromTimeStamp setter.

Threads and locks.

This class is thread-safe and can be used concurrently from multiple threads without external synchronization.

Template Parameters
EThe type of events.
Type Constraints
E :IDxTimeSeriesEvent 

Constructor & Destructor Documentation

◆ DXFeedTimeSeriesSubscription() [1/2]

Creates detached time-series subscription for a single event type.

Parameters
endpointThe DXEndpoint instance.
Exceptions
ArgumentNullExceptionIf endpoint is null.
ArgumentExceptionIf type E is not event class.
DxExceptionInternal error.

◆ DXFeedTimeSeriesSubscription() [2/2]

com.dxfeed.api.DXFeedTimeSeriesSubscription< E >.DXFeedTimeSeriesSubscription ( DXEndpoint  endpoint,
params Type []  eventTypes 
)
inline

Creates detached subscription for the given list of event types.

Parameters
endpointThe DXEndpoint instance.
eventTypesThe list of event types.
Exceptions
ArgumentNullExceptionIf endpoint or eventTypes is null.
ArgumentExceptionIf eventTypes are empty or any type of eventTypes is not event class.
DxExceptionInternal error.

Field Documentation

◆ endpointInstance

◆ fromTime

long com.dxfeed.api.DXFeedTimeSeriesSubscription< E >.fromTime = long.MaxValue
private

◆ timeLocker

object com.dxfeed.api.DXFeedTimeSeriesSubscription< E >.timeLocker = new object()
private

Property Documentation

◆ FromTimeStamp

long com.dxfeed.api.DXFeedTimeSeriesSubscription< E >.FromTimeStamp
getset

Gets or sets the earliest timestamp from which time-series of events shall be received. The timestamp is in milliseconds from midnight, January 1, 1970 UTC.


The documentation for this class was generated from the following file: