Ignore:
Timestamp:
Jan 9, 2012, 2:22:31 PM (13 years ago)
Author:
chronos
Message:
  • Modified: TGStream is now implemented. TMemoryStreamByte have additional methods usable for byte streams.
  • Added: Few other missing methods in TGList.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Generic/GenericQueue.inc

    r112 r312  
    1111{$I 'GenericList.inc'}
    1212
    13   // TGQueue<TSetIndex, TSetItem> = class(TGList)
     13  // TGQueue<TQueueIndex, TQueueItem> = class(TGList)
    1414  TGQueue = class
    1515  private
    1616    FList: TGList;
     17    function GetCount: TGQueueIndex;
    1718  public
    1819    procedure Enqueue(Value: TGQueueItem);
     20    procedure EnqueueArray(Values: array of TGQueueItem);
     21    procedure EnqueueList(List: TGList);
    1922    function Dequeue: TGQueueItem;
    2023    function Peek: TGQueueItem;
     
    2225    destructor Destroy; override;
    2326    property List: TGList read FList;
     27    property Count: TGQueueIndex read GetCount;
    2428  end;
    2529
     
    5458end;
    5559
     60procedure TGQueue.EnqueueArray(Values: array of TGQueueItem);
     61begin
     62  FList.AddArray(Values);
     63end;
     64
     65procedure TGQueue.EnqueueList(List: TGList);
     66begin
     67  FList.AddList(List);
     68end;
     69
    5670function TGQueue.Peek: TGQueueItem;
    5771begin
     
    7589end;
    7690
     91function TGQueue.GetCount: TGQueueIndex;
     92begin
     93  Result := FList.Count;
     94end;
     95
    7796{$UNDEF IMPLEMENTATION}
    7897{$ENDIF}
Note: See TracChangeset for help on using the changeset viewer.