Infront Data Manager Connect Client (.NET)
Public Member Functions | Static Public Attributes | Properties | Events | List of all members
Gevasys.DataCore.Tools.Cache.PriceCache Class Reference

More...

Inherits Gevasys.DataCore.Client.PushClient, and Gevasys.DataCore.Tools.Cache.IPriceCacheAccess.

Public Member Functions

 PriceCache (string configDir, string configFilename, string name, string user, string password, string configurationName, TimeSpan lifeTime)
 
 PriceCache (ConfigurationHelper configHelper, string configDir, string configFilename, string name, string user, string password, string configurationName, TimeSpan lifeTime)
 
override void ProcessUpdates (List< UpdateMessage > updates)
 
override void Update (IConsumer source, ConsumerStateChangedEventArgs arg)
 Method for processing incoming status notifications for a Consumer. More...
 
Dictionary< short, FieldData > GetValuesForInstrument (string instrument, bool useRecap, out bool instrumentNotAvailable)
 Gets all field values for a instrument. More...
 
Dictionary< string, Dictionary< short, FieldData > > GetValuesForInstruments (List< string > instruments, bool useRecap)
 
void RequestRecap (string instrument)
 Request a recap for a instrument. More...
 
void RequestRecaps (List< string > instruments)
 Request recaps for a list of instruments. More...
 
void RequestUpdate (string instrument)
 Request updates for a instrument. More...
 
void RequestUpdates (List< string > instruments)
 Request updates for a list of instruments. More...
 
void StopCache ()
 Stops this cache. More...
 
- Public Member Functions inherited from Gevasys.DataCore.Client.PushClient
long GetCountUpdates ()
 
String GetName ()
 
void Start ()
 
void AddNewData (List< UpdateMessage > newUpdates)
 
void Run ()
 For internal use only. More...
 
void Stop ()
 
abstract void Update (DataCore.Core.IConsumer source, ConsumerStateChangedEventArgs arg)
 Abstract method that must be implemented in derived classes to recive status notifications for the underlying consumers. More...
 

Static Public Attributes

static readonly short FIELDID_LAST_PRICE = 20001
 
static readonly short FIELDID_LAST_DATE = 20004
 
static readonly short FIELDID_LAST_TIME = 20005
 
static readonly short FIELDID_LAST_CHANGE = 20006
 
static readonly short FIELDID_LAST_CHANGE_PERCENT = 20007
 
static readonly short FIELDID_LAST_DATETIME = 20008
 

Properties

bool IsPriceServiceOnline [get]
 Indicates if the price service is online More...
 
static PriceCache Instance [get]
 Gets a instance of the price cache for use with static design pattern. Before using this method be sure to cerate first a instance of PriceCache More...
 
bool IsAutoRequestUnknownInstruments [get]
 If true, unknown instruments will be requested automatically More...
 
TimeSpan InstrumentLifeTime [get]
 Gets the lifetime for instruments. If a instrument is not requested from the cache for the given period, the instrument is automatically unsubscribed. More...
 
- Properties inherited from Gevasys.DataCore.Client.PushClient
string Name [get]
 Name of the push client. The name is also used as the name of the push client thread to make identifying your thread during debugging easier. More...
 

Events

UpdateReceivedDelegate OnUpdate
 Event for incoming update.Event will fire asynchronously. More...
 
RecapReceivedDelegate OnRecap
 Event for incoming recap.Event will fire asynchronously. More...
 
NotFoundDelegate OnNotFound
 Event for not found instrument.Event will fire asynchronously. More...
 
NotPermissionedDelegate OnNotPermissioned
 Event for not permissioned instrument. Event will fire asynchronously. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Gevasys.DataCore.Client.PushClient
 PushClient (String name)
 

Detailed Description

Provides a cache for incoming streaming price data. Provides addtionally the following calculated field (calculated on each update) for each instrument, regardless of the type of the instrument:

- Last Price (FIELDID_LAST_PRICE)

- Date of Last Price (FIELDID_LAST_DATE)

- Time of Last Price (FIELDID_LAST_TIME)

- Last Change (FIELDID_LAST_CHANGE)

- Last Change in Percent(FIELDID_LAST_CHANGE_PERCENT)

- Last Date and Time of last update(FIELDID_LAST_DATETIME)

Access to fields is thread safe.

Constructor & Destructor Documentation

◆ PriceCache() [1/2]

Gevasys.DataCore.Tools.Cache.PriceCache.PriceCache ( string  configDir,
string  configFilename,
string  name,
string  user,
string  password,
string  configurationName,
TimeSpan  lifeTime 
)
inline

Parameters
configDirDirectory of the configuration file
configFilenameName of the configuration file
nameName of this instance
userUser
passwordPassword
configurationNameName of the ConsumerStore in the configuration file that this instance will be attached to
lifeTimeInstrument liefe time

◆ PriceCache() [2/2]

Gevasys.DataCore.Tools.Cache.PriceCache.PriceCache ( ConfigurationHelper  configHelper,
string  configDir,
string  configFilename,
string  name,
string  user,
string  password,
string  configurationName,
TimeSpan  lifeTime 
)
inline

Parameters
configHelperInstance of a ConfigurationHelper
configDirDirectory of the configuration file
configFilenameName of the configuration file
nameName of this instance
userUser
passwordPassword
configurationNameName of the ConsumerStore in the configuration file that this instance will be attached to
lifeTimeInstrument liefe time

Member Function Documentation

◆ GetValuesForInstrument()

Dictionary<short, FieldData> Gevasys.DataCore.Tools.Cache.PriceCache.GetValuesForInstrument ( string  instrument,
bool  useRecap,
out bool  instrumentNotAvailable 
)
inline

Gets all field values for a instrument.

Parameters
instrumentvwd code
useRecapUse recap for automatic requesting
instrumentNotAvailableTrue, if the instrument is not available
Returns

◆ ProcessUpdates()

override void Gevasys.DataCore.Tools.Cache.PriceCache.ProcessUpdates ( List< UpdateMessage updates)
inlinevirtual

Abstract method which must be overridden in derived classes. This is the

entry point for user specific code for processing updates.

Implements Gevasys.DataCore.Client.PushClient.

◆ RequestRecap()

void Gevasys.DataCore.Tools.Cache.PriceCache.RequestRecap ( string  instrument)
inline

Request a recap for a instrument.

Parameters
instrument

◆ RequestRecaps()

void Gevasys.DataCore.Tools.Cache.PriceCache.RequestRecaps ( List< string >  instruments)
inline

Request recaps for a list of instruments.

Parameters
instruments

◆ RequestUpdate()

void Gevasys.DataCore.Tools.Cache.PriceCache.RequestUpdate ( string  instrument)
inline

Request updates for a instrument.

Parameters
instrument

◆ RequestUpdates()

void Gevasys.DataCore.Tools.Cache.PriceCache.RequestUpdates ( List< string >  instruments)
inline

Request updates for a list of instruments.

Parameters
instruments

◆ StopCache()

void Gevasys.DataCore.Tools.Cache.PriceCache.StopCache ( )
inline

Stops this cache.

◆ Update()

override void Gevasys.DataCore.Tools.Cache.PriceCache.Update ( IConsumer  source,
ConsumerStateChangedEventArgs  arg 
)
inline

Method for processing incoming status notifications for a Consumer.

Parameters
sourceThe IConsumer source.
argThe notification.

Implements Gevasys.DataCore.Client.IPushClient.

Property Documentation

◆ Instance

PriceCache Gevasys.DataCore.Tools.Cache.PriceCache.Instance
staticget

Gets a instance of the price cache for use with static design pattern. Before using this method be sure to cerate first a instance of PriceCache

◆ InstrumentLifeTime

TimeSpan Gevasys.DataCore.Tools.Cache.PriceCache.InstrumentLifeTime
get

Gets the lifetime for instruments. If a instrument is not requested from the cache for the given period, the instrument is automatically unsubscribed.

◆ IsAutoRequestUnknownInstruments

bool Gevasys.DataCore.Tools.Cache.PriceCache.IsAutoRequestUnknownInstruments
get

If true, unknown instruments will be requested automatically

◆ IsPriceServiceOnline

bool Gevasys.DataCore.Tools.Cache.PriceCache.IsPriceServiceOnline
get

Indicates if the price service is online

Event Documentation

◆ OnNotFound

NotFoundDelegate Gevasys.DataCore.Tools.Cache.PriceCache.OnNotFound

Event for not found instrument.Event will fire asynchronously.

◆ OnNotPermissioned

NotPermissionedDelegate Gevasys.DataCore.Tools.Cache.PriceCache.OnNotPermissioned

Event for not permissioned instrument. Event will fire asynchronously.

◆ OnRecap

RecapReceivedDelegate Gevasys.DataCore.Tools.Cache.PriceCache.OnRecap

Event for incoming recap.Event will fire asynchronously.

◆ OnUpdate

UpdateReceivedDelegate Gevasys.DataCore.Tools.Cache.PriceCache.OnUpdate

Event for incoming update.Event will fire asynchronously.


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

Copyright (C) 2021 Infront Financial Technology GmbH
Mainzer Landstrasse 178 – 190
60327 Frankfurt am Main
Infront Data Manager Connect V4.1