Click or drag to resize

HistoryDataQueueT Class

Represents a generic dynamic circle queue. It has four method of work: SingleElement: Queue store only one single element. (Useful as default method for indicators history storing) ManualControl: Support all typical operations specific to Dequeue. (Useful for some custom work). AutoStatic: Store all elements in sliding window specified by number elements to store. Automatically drop element when it out of the window. AutoDynamic: Store all elements in sliding window specified by time period. Automatically drop element when it out of the window. Also it supports direct access to element. Using two indexers: by index (int) and by time (DateTime). All methods have two versions, with and without DateTime parameter. Please do not use both for the same class instance. Using method with DateTime is mandatory if you want to use DateTime indexer or time period sliding window (AutoDynamic type.) You can specify number of listener (IDataQueueListener), to do some additional work when queue stores or drops element.
Inheritance Hierarchy
SystemObject
  FinAnalysis.BaseHistoryDataQueueT
    FinAnalysis.BaseBaseIndicatorT
    FinAnalysis.BaseTimeSeriesDataQueueT

Namespace:  FinAnalysis.Base
Assembly:  FinAnalysis.Base (in FinAnalysis.Base.dll) Version: 2.1.13-cc97e13414b71fde928e8f3a546ac1daf26f295f
Syntax
C#
public class HistoryDataQueue<T> : IDataStorageClient
where T : new()

Type Parameters

T
Queue data type. Note: T must has default public constructor.

The HistoryDataQueueT type exposes the following members.

Constructors
  NameDescription
Public methodHistoryDataQueueT
Initializes a new instance of the FinAnalysis.Base.TimeSeriesDataQueue class that contains circle queue of Data and DateTime (optional). Default method of use is ManualControl. Queue capacity will be dynamic. You can manage it manually Put\Remove Last or First ements as in Dequeue.
Public methodHistoryDataQueueT(Int32)
Initializes a new instance of the FinAnalysis.Base.TimeSeriesDataQueue class that contains circle queue of of Data and DateTime (optional). In this case method of use will be AutoStatic, or SingleElement if you specify capacity equal to one. Queue capacity will be fixed and it will be enough for exact "capacity" elements.
Public methodHistoryDataQueueT(TimeSpan)
Initializes a new instance of the FinAnalysis.Base.TimeSeriesDataQueue class that contains circle queue of of Data and DateTime. In this case method of use will be AutoDynamic, Queue capacity will be dynamic and it will be enough for contain all elements on specified time period. Using Put method with DateTime is mandatory in this case. Note: You can give queue a hint, what initial arrays size it should use, by seting Capacity field.
Top
Properties
  NameDescription
Public propertyFirst
Get first(oldest) data element stored in container. Note: if there is not elements in queue it returns DefaltValue.
Public propertyFirstDateTime
Get first(oldest) data element DateTime stored in container. Note: if there is not elements in queue it returns DefaltDateTime.
Public propertyItemDateTime
Return historically latest element with smaller or equal DateTime. Note: do not try to use this method if you didn't specify DateTime to data elements.
Public propertyItemInt32
Get data which was store "index" steps ago.
Public propertyLast
Get last data element stored in container. Note: if there is not elements in queue it returns DefaltValue.
Public propertyLastDateTime
Get last data element DateTime stored in container. Note: if there is no elements in the queue it returns DefaultDateTime.
Public propertyPrevious
Get previous data element stored in container. Note: if there is such not elements in queue it returns DefaltValue.
Public propertyReady
Ready flag is set if and only if queue contain something.
Top
Methods
  NameDescription
Public methodClone
Makes full copy of this instance.
Public methodCopyTo(Object)
Gets internal state from source object.
Public methodCopyTo(Object, IL_Clone)
Gets internal state from source object.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetIndexByTime
Get offset index of element by element time. If there no element with such time, we return latest element with time smaller than specified. If we can't find valid index, we return -1.
Public methodGetTimeByIndex
Return time associated with specified point.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodSetOnPopDelegate
Set delegate that will be invoked every time a new element is dequeued.
Public methodSetOnPushDelegate
Set delegate that will be invoked every time a new element is enqueued.
Public methodSetQueueListener
Set listener to queue capacity. Queue will call OnPop method every time, when queue drop some element. And OnPush method, when queue store element. Do not use listener with single element queue. Queue support any number of listeners.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberDefaultDateTime
Default DateTime, which will be assumed as default date value. Note: if you call indicator Add function with DefaultDateTime, it will automatically forward this call to Add without DateTime parameter.
Public fieldStatic memberDefaultValue
Default value, which will be returned for invalid request or request for empty queue.
Top
See Also