1 { 2 ***************************************************************************** 3 * * 4 * This file is part of the ZCAD * 5 * * 6 * See the file COPYING.modifiedLGPL.txt, included in this distribution, * 7 * for details about the copyright. * 8 * * 9 * This program is distributed in the hope that it will be useful, * 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * 12 * * 13 ***************************************************************************** 14 } 15 { 16 @author(Andrey Zubarev <zamtmn@yandex.ru>) 17 } 18 19 unit gzctnrvectorobjects; 20 {$INCLUDE def.inc} 21 interface 22 uses uzbtypesbase,gzctnrvectordata, 23 uzbtypes,uzbmemman; 24 type 25 {Export+} 26 GZVectorObjects{-}<T>{//}={$IFNDEF DELPHI}packed{$ENDIF} 27 object(GZVectorData{-}<T>{//}) CreateObjectnull28 function CreateObject:PGDBaseObject; 29 procedure free;virtual; 30 end; 31 {Export-} 32 implementation GZVectorObjectsnull33function GZVectorObjects<T>.CreateObject; 34 {var addr: GDBPlatformint;} 35 begin 36 result:=getdatamutable(pushbackdata(default(T))); 37 {if parray=nil then 38 createarray; 39 if count = max then grow; 40 begin 41 GDBPointer(addr) := parray; 42 addr := addr + GDBPlatformint(count*SizeOfData); 43 result:=pointer(addr); 44 inc(count); 45 end;} 46 end; 47 procedure GZVectorObjects<T>.free; 48 var i:integer; 49 begin 50 for i:=0 to count-1 do 51 begin 52 parray[i].done; 53 end; 54 end; 55 begin 56 end. 57