Download Now

    Reference TDataBuffer<T>

    Declared in Codebot.Render.Buffers.pas on line 90

    TDataBuffer<T> is a class for incrementally adding large amounts of growing data
      TDataBuffer<T> = class(TBaseBuffer)
      protected
        procedure Added(N: Integer); virtual;
      public
        { Create a new dynamic buffer optionally allocating room for a N number of
          future items }
        constructor Create(N: Integer = 0); override;
        { Remove any extra data allocated by the previous grow }
        procedure Pack;
        { Create a copy of the data buffer }
        function Clone: TObject; virtual;
        { Add a range of items to the buffer }
        procedure AddRange(const Range: array of T);
        { Add a single item to the buffer }
        procedure AddItem(const Item: T);
        { Clear the buffer optionally allocating room for a N number of future items }
        procedure Clear(N: Integer = 0);
        { Pointer to the data at a specified index }
        property Data[Index: Integer]: Pointer read GetData; default;
        { Item at specified index }
        property Item[Index: Integer]: T read GetItem write SetItem;
        { The number of items in the buffer }
        property Count: Integer read FCount;
      end;

    See also