baselist.pas 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {
  2. Copyright (C) <avx-testfile-generator> <Torsten Grundke>
  3. This source is free software; you can redistribute it and/or modify it under
  4. the terms of the GNU General Public License as published by the Free
  5. Software Foundation; either version 2 of the License, or (at your option)
  6. any later version.
  7. This code is distributed in the hope that it will be useful, but WITHOUT ANY
  8. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. details.
  11. A copy of the GNU General Public License is available on the World Wide Web
  12. at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
  13. to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  14. MA 02111-1307, USA.
  15. }
  16. {$mode objfpc}
  17. unit baselist;
  18. interface
  19. uses Contnrs, Classes;
  20. type
  21. // basisliste
  22. TBaseList = class(TPersistent)
  23. private
  24. protected
  25. FList: TObjectlist;
  26. public
  27. constructor Create; virtual;
  28. destructor Destroy; override;
  29. function count: integer;
  30. procedure clear;
  31. end;
  32. implementation
  33. { TBaseList }
  34. uses SysUtils;
  35. procedure TBaseList.clear;
  36. begin
  37. FList.Clear;
  38. end;
  39. function TBaseList.count: integer;
  40. begin
  41. result := FList.Count;
  42. end;
  43. constructor TBaseList.Create;
  44. begin
  45. inherited;
  46. FList := TObjectList.Create;
  47. end;
  48. destructor TBaseList.Destroy;
  49. begin
  50. FreeAndNil(FList);
  51. inherited;
  52. end;
  53. end.