{$IFNDEF TYPED_DP_COLLECTION_TEMPLATE}
unit dpCollection_tmpl;
// written by MaxHub (maximov) 10.07.2004
// dpCollection: [url]http://www.delphipraxis.net/topic28945_tcollection+und+tcollectionitem.html[/url]
// thanks to Thomas Mueller for his 'Object Pascal Templates' article
// -> [url]http://www.dummzeuch.de/delphi/object_pascal_templates/deutsch.html[/url]
// thanks to Rossen Assenov for the original narticle 'Templates in Object Pascal'
// -> [url]http://community.borland.com/article/0,1410,27603,00.html[/url]
interface
uses Classes, dpCollection;
type
_COLLECTION_ITEM_ = TCollectionItem;
{$ENDIF TYPED_DP_COLLECTION_TEMPLATE}
{$IFNDEF TYPED_DP_COLLECTION_TEMPLATE_SECOND_PASS}
type
_COLLECTION_ =
class (TmxJsCollection)
protected
function GetItem (
const aIndex : Integer) : _COLLECTION_ITEM_;
procedure SetItem (
const aIndex : Integer;
const aValue : _COLLECTION_ITEM_);
public
constructor Create;
function Add : _COLLECTION_ITEM_;
function FindItemID (
const aID : Integer) : _COLLECTION_ITEM_;
function Insert (
const aIndex : Integer) : _COLLECTION_ITEM_;
property Items [
const aIndex : Integer] : _COLLECTION_ITEM_
read GetItem
write SetItem;
end;
{$ENDIF TYPED_DP_COLLECTION_TEMPLATE_SECOND_PASS}
{$IFNDEF TYPED_DP_COLLECTION_TEMPLATE}
implementation
{$DEFINE TYPED_DP_COLLECTION_TEMPLATE_SECOND_PASS}
{$ENDIF TYPED_DP_COLLECTION_TEMPLATE}
{$IFDEF TYPED_DP_COLLECTION_TEMPLATE_SECOND_PASS}
{ TYPED_DP_COLLECTION }
constructor _COLLECTION_.Create;
begin
inherited Create(_COLLECTION_ITEM_);
end;
function _COLLECTION_.Add : _COLLECTION_ITEM_;
begin
Result := _COLLECTION_ITEM_ (
inherited Add);
end;
function _COLLECTION_.FindItemID (
const aID : Integer) : _COLLECTION_ITEM_;
begin
Result := _COLLECTION_ITEM_ (
inherited FindItemID (aID));
end;
function _COLLECTION_.GetItem (
const aIndex : Integer) : _COLLECTION_ITEM_;
begin
Result := _COLLECTION_ITEM_ (
inherited GetItem (aIndex));
end;
function _COLLECTION_.Insert (
const aIndex : Integer) : _COLLECTION_ITEM_;
begin
Result := _COLLECTION_ITEM_ (
inherited Insert (aIndex));
end;
procedure _COLLECTION_.SetItem (
const aIndex : Integer;
const aValue : _COLLECTION_ITEM_);
begin
inherited SetItem (aIndex, aValue);
end;
{$WARNINGS off}
{$IFNDEF TYPED_DP_COLLECTION_TEMPLATE}
end.
{$ENDIF TYPED_DP_COLLECTION_TEMPLATE}
{$ENDIF TYPED_DP_COLLECTION_TEMPLATE_SECOND_PASS}
{$DEFINE TYPED_DP_COLLECTION_TEMPLATE_SECOND_PASS}