Unit GenericTosDataNode; Interface Uses Classes, DataNodes; Type TTosData = Record Price : Double; Time : TDateTime; TodaysClose : Double; // Last non-formT-Trade if not closed yet. Size : Integer; // This print Exchange : String; FormT : Boolean; Volume : Integer; // Total for the day. SaleCondition : Smallint; // This is just for debugging. EventType : (etNewPrint, etMostRecentPrice); // When we first connect // to the datafeed, we will // get the most recent price // and notify the listeners. // It may happen at other // times, such as a price // correction. End; PTosData = ^TTosData; TGenericTosDataNode = Class; TTGenericTosDataNode = Class Of TGenericTosDataNode; TGenericTosDataNode = Class(TDataNodeWithStringKey) Protected Class Function CreateNew(Data : String) : TDataNodeWithStringKey; Override; Public Class Procedure Find(Symbol : String; OnChange : TThreadMethod; Out Node : TGenericTosDataNode; Out Link : TDataNodeLink); Virtual; Function IsValid : Boolean; Virtual; Function GetLast : PTosData; Virtual; Class Procedure SetImplementation(I : TTGenericTosDataNode); End; Implementation Var RealImplementation : TTGenericTosDataNode; Class Procedure TGenericTosDataNode.SetImplementation(I : TTGenericTosDataNode); Begin RealImplementation := I End; Class Function TGenericTosDataNode.CreateNew(Data : String) : TDataNodeWithStringKey; Begin Result := Create End; Function TGenericTosDataNode.IsValid : Boolean; Begin Result := False End; Function TGenericTosDataNode.GetLast : PTosData; Begin Result := Nil End; Class Procedure TGenericTosDataNode.Find(Symbol : String; OnChange : TThreadMethod; Out Node : TGenericTosDataNode; Out Link : TDataNodeLink); Var TempNode : TDataNodeWithStringKey; Begin If Assigned(RealImplementation) Then RealImplementation.Find(Symbol, OnChange, Node, Link) Else Begin FindCommon(TGenericTosDataNode, '' {Symbol}, Nil {OnChange}, TempNode, Link); Node := TempNode As TGenericTosDataNode End End; End.