dxFeed .Net API  5.13.0
dxFeed .Net API library intended to provide market data access for DX clients
Public Member Functions | Static Package Functions | Private Member Functions | Private Attributes
com.dxfeed.native.NativeSubscription Class Reference

Class provides native event subscription More...

Inheritance diagram for com.dxfeed.native.NativeSubscription:
[legend]
Collaboration diagram for com.dxfeed.native.NativeSubscription:
[legend]

Public Member Functions

 NativeSubscription (NativeConnection connection, EventType eventType, EventSubscriptionFlag eventSubscriptionFlags, IDxEventListener listener)
 Create event subscription. More...
 
 NativeSubscription (NativeConnection connection, EventType eventType, IDxEventListener listener)
 Create event subscription. More...
 
 NativeSubscription (NativeConnection connection, EventType eventType, long time, EventSubscriptionFlag eventSubscriptionFlags, IDxEventListener listener)
 Create time event subscription. More...
 
 NativeSubscription (NativeConnection connection, EventType eventType, long time, IDxEventListener listener)
 Create time event subscription. More...
 
 NativeSubscription (NativeConnection connection, EventType eventType, DateTime time, EventSubscriptionFlag eventSubscriptionFlags, IDxEventListener listener)
 Create time event subscription. More...
 
 NativeSubscription (NativeConnection connection, EventType eventType, DateTime time, IDxEventListener listener)
 Create time event subscription. More...
 
 NativeSubscription (NativeConnection connection, DateTime? time, EventSubscriptionFlag eventSubscriptionFlags, IDxCandleListener listener)
 Create Candle event subscription. For rest events use another constructor. More...
 
 NativeSubscription (NativeConnection connection, DateTime? time, IDxCandleListener listener)
 Create Candle event subscription. For rest events use another constructor. More...
 
void Dispose ()
 
void AddSymbol (string symbol)
 
void AddSymbol (CandleSymbol symbol)
 Add candle symbol to subscription. More...
 
void AddSymbols (params string[] symbols)
 
void AddSymbols (params CandleSymbol[] symbols)
 Add multiply candle symbols to subscription. More...
 
void RemoveSymbols (params string[] symbols)
 
void RemoveSymbols (params CandleSymbol[] symbols)
 
void SetSymbols (params string[] symbols)
 Set multiply symbols to subscription. More...
 
void SetSymbols (params CandleSymbol[] symbols)
 Set multiply symbols to subscription. More...
 
void Clear ()
 
unsafe IList< string > GetSymbols ()
 Get all symbols from subscription. More...
 
void AddSource (params string[] sources)
 Add OrderSource to subscription. More...
 
void SetSource (params string[] sources)
 Remove existing OrderSource from subscription and set new. More...
 

Static Package Functions

static bool IsCandleSymbol (string symbol)
 
static bool HasCandleSymbol (params string[] symbols)
 

Private Member Functions

void OnEvent (EventType eventType, IntPtr symbol, IntPtr data, int dataCount, IntPtr eventParamsPtr, IntPtr userData)
 

Private Attributes

readonly IntPtr connectionPtr
 
IntPtr subscriptionPtr
 
readonly IDxEventListener eventListener
 
readonly C.dxf_event_listener_v2_t callback
 
readonly EventType eventType
 
NativeConnection connection = null
 

Detailed Description

Class provides native event subscription

Constructor & Destructor Documentation

◆ NativeSubscription() [1/8]

com.dxfeed.native.NativeSubscription.NativeSubscription ( NativeConnection  connection,
EventType  eventType,
EventSubscriptionFlag  eventSubscriptionFlags,
IDxEventListener  listener 
)
inline

Create event subscription.

Parameters
connectionnative connection pointer
eventTypetype of event to create
eventSubscriptionFlagsevent subscription flags
listenerevent listener
Exceptions
ArgumentExceptionOne of passed parameters is not valid.
DxException

◆ NativeSubscription() [2/8]

com.dxfeed.native.NativeSubscription.NativeSubscription ( NativeConnection  connection,
EventType  eventType,
IDxEventListener  listener 
)
inline

Create event subscription.

Parameters
connectionnative connection pointer
eventTypetype of event to create
listenerevent listener
Exceptions
ArgumentExceptionOne of passed parameters is not valid.
DxException

◆ NativeSubscription() [3/8]

com.dxfeed.native.NativeSubscription.NativeSubscription ( NativeConnection  connection,
EventType  eventType,
long  time,
EventSubscriptionFlag  eventSubscriptionFlags,
IDxEventListener  listener 
)
inline

Create time event subscription.

Parameters
connectionNative connection pointer.
eventTypeType of event to create.
timeUnix time stamp (the number of milliseconds from 1.1.1970)
eventSubscriptionFlagsevent subscription flags
listenerEvent listener.
Exceptions
ArgumentExceptionOne of passed parameters is not valid.
DxException

◆ NativeSubscription() [4/8]

com.dxfeed.native.NativeSubscription.NativeSubscription ( NativeConnection  connection,
EventType  eventType,
long  time,
IDxEventListener  listener 
)
inline

Create time event subscription.

Parameters
connectionNative connection pointer.
eventTypeType of event to create.
timeUnix time stamp (the number of milliseconds from 1.1.1970)
listenerEvent listener.
Exceptions
ArgumentExceptionOne of passed parameters is not valid.
DxException

◆ NativeSubscription() [5/8]

com.dxfeed.native.NativeSubscription.NativeSubscription ( NativeConnection  connection,
EventType  eventType,
DateTime  time,
EventSubscriptionFlag  eventSubscriptionFlags,
IDxEventListener  listener 
)
inline

Create time event subscription.

Parameters
connectionNative connection pointer.
eventTypeType of event to create.
timeTime to getting events from.
eventSubscriptionFlagsevent subscription flags
listenerEvent listener.
Exceptions
ArgumentExceptionOne of passed parameters is not valid.
DxException

◆ NativeSubscription() [6/8]

com.dxfeed.native.NativeSubscription.NativeSubscription ( NativeConnection  connection,
EventType  eventType,
DateTime  time,
IDxEventListener  listener 
)
inline

Create time event subscription.

Parameters
connectionNative connection pointer.
eventTypeType of event to create.
timeTime to getting events from.
listenerEvent listener.
Exceptions
ArgumentExceptionOne of passed parameters is not valid.
DxException

◆ NativeSubscription() [7/8]

com.dxfeed.native.NativeSubscription.NativeSubscription ( NativeConnection  connection,
DateTime?  time,
EventSubscriptionFlag  eventSubscriptionFlags,
IDxCandleListener  listener 
)
inline

Create Candle event subscription. For rest events use another constructor.

Parameters
connectionNative connection pointer.
timeDate time in the past.
eventSubscriptionFlagsevent subscription flags
listenerCandle event listener.
Exceptions
ArgumentExceptionOne of passed parameters is not valid.
DxException

◆ NativeSubscription() [8/8]

com.dxfeed.native.NativeSubscription.NativeSubscription ( NativeConnection  connection,
DateTime?  time,
IDxCandleListener  listener 
)
inline

Create Candle event subscription. For rest events use another constructor.

Parameters
connectionNative connection pointer.
timeDate time in the past.
listenerCandle event listener.
Exceptions
ArgumentExceptionOne of passed parameters is not valid.
DxException

Member Function Documentation

◆ AddSource()

void com.dxfeed.native.NativeSubscription.AddSource ( params string []  sources)
inline

Add OrderSource to subscription.

Parameters
sourcesList of OrderSource names.
Exceptions
ArgumentExceptionInvalid sources parameter.
InvalidOperationExceptionYou try to add more than one source to subscription.
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ AddSymbol() [1/2]

void com.dxfeed.native.NativeSubscription.AddSymbol ( string  symbol)
inline

Add symbol to subscription.

A wildcard symbol "*" will replace all symbols: there will be an unsubscription from messages on all current symbols and a subscription to "*". The subscription type will be changed to STREAM If there is already a subscription to "*", then nothing will happen

Parameters
symbolSymbol.
Exceptions
ArgumentExceptionInvalid symbol parameter.
InvalidOperationExceptionYou try to add more than one symbol to snapshot subscription.
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ AddSymbol() [2/2]

void com.dxfeed.native.NativeSubscription.AddSymbol ( CandleSymbol  symbol)
inline

Add candle symbol to subscription.

Parameters
symbolCandleSymbol.
Exceptions
ArgumentExceptionInvalid symbol parameter.
InvalidOperationExceptionYou try to add more than one symbol to snapshot subscription.
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ AddSymbols() [1/2]

void com.dxfeed.native.NativeSubscription.AddSymbols ( params string []  symbols)
inline

Add multiply symbols to subscription.

First met the "*" symbol (wildcard) will overwrite all other symbols: there will be an unsubscription from messages on all current symbols and a subscription to "*". The subscription type will be changed to STREAM If there is already a subscription to "*", then nothing will happen.

Parameters
symbolsList of symbols.
Exceptions
ArgumentExceptionInvalid symbol parameter.
InvalidOperationExceptionYou try to add more than one symbol to snapshot subscription.
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ AddSymbols() [2/2]

void com.dxfeed.native.NativeSubscription.AddSymbols ( params CandleSymbol []  symbols)
inline

Add multiply candle symbols to subscription.

Parameters
symbolsList of CandleSymbol.
Exceptions
ArgumentExceptionInvalid symbols parameter.
InvalidOperationExceptionYou try to add more than one symbol to snapshot subscription.
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ Clear()

void com.dxfeed.native.NativeSubscription.Clear ( )
inline

Clear all symbols from subscription.

Snapshot will be IDisposable.Dispose().

Exceptions
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ Dispose()

void com.dxfeed.native.NativeSubscription.Dispose ( )
inline

◆ GetSymbols()

unsafe IList<string> com.dxfeed.native.NativeSubscription.GetSymbols ( )
inline

Get all symbols from subscription.

Returns
List of subscribed symbols.
Exceptions
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ HasCandleSymbol()

static bool com.dxfeed.native.NativeSubscription.HasCandleSymbol ( params string []  symbols)
inlinestaticpackage

◆ IsCandleSymbol()

static bool com.dxfeed.native.NativeSubscription.IsCandleSymbol ( string  symbol)
inlinestaticpackage

◆ OnEvent()

void com.dxfeed.native.NativeSubscription.OnEvent ( EventType  eventType,
IntPtr  symbol,
IntPtr  data,
int  dataCount,
IntPtr  eventParamsPtr,
IntPtr  userData 
)
inlineprivate

◆ RemoveSymbols() [1/2]

void com.dxfeed.native.NativeSubscription.RemoveSymbols ( params string []  symbols)
inline

Remove multiply symbols from subscription.

First met the "*" symbol (wildcard) will remove all symbols: there will be an unsubscription from messages on all current symbols. If there is already a subscription to "*" and the symbols to remove are not contain a "*", then nothing will happen.

Snapshot will be disposed if symbols contains snapshot symbol (for Snapshots only).

Parameters
symbolsList of symbols.
Exceptions
ArgumentExceptionInvalid symbols parameter.
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ RemoveSymbols() [2/2]

void com.dxfeed.native.NativeSubscription.RemoveSymbols ( params CandleSymbol []  symbols)
inline

Remove multiply symbols from subscription.

Snapshot will be disposed if symbols contains snapshot symbol (for Snapshots only).

Parameters
symbolsList of CandleSymbol.
Exceptions
ArgumentExceptionInvalid symbols parameter.
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ SetSource()

void com.dxfeed.native.NativeSubscription.SetSource ( params string []  sources)
inline

Remove existing OrderSource from subscription and set new.

Parameters
sourcesList of OrderSource names.
Exceptions
ArgumentExceptionInvalid sources parameter.
InvalidOperationExceptionYou try to add more than one source to subscription.
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ SetSymbols() [1/2]

void com.dxfeed.native.NativeSubscription.SetSymbols ( params string []  symbols)
inline

Set multiply symbols to subscription.

Parameters
symbolsList of symbols.
Exceptions
ArgumentExceptionInvalid symbols parameter.
InvalidOperationExceptionYou try to add more than one symbol to snapshot subscription.
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

◆ SetSymbols() [2/2]

void com.dxfeed.native.NativeSubscription.SetSymbols ( params CandleSymbol []  symbols)
inline

Set multiply symbols to subscription.

Parameters
symbolsList of CandleSymbol.
Exceptions
ArgumentExceptionInvalid symbols parameter.
InvalidOperationExceptionYou try to add more than one symbol to snapshot subscription.
DxExceptionInternal error.

Implements com.dxfeed.api.IDxSubscription.

Field Documentation

◆ callback

readonly C.dxf_event_listener_v2_t com.dxfeed.native.NativeSubscription.callback
private

◆ connection

NativeConnection com.dxfeed.native.NativeSubscription.connection = null
private

◆ connectionPtr

readonly IntPtr com.dxfeed.native.NativeSubscription.connectionPtr
private

◆ eventListener

readonly IDxEventListener com.dxfeed.native.NativeSubscription.eventListener
private

◆ eventType

readonly EventType com.dxfeed.native.NativeSubscription.eventType
private

◆ subscriptionPtr

IntPtr com.dxfeed.native.NativeSubscription.subscriptionPtr
private

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