lcontainersh.inc 876 B

1234567891011121314151617181920212223242526272829303132
  1. { This include is a little a-la-templates hack
  2. here are all the "default" type defines which you need to
  3. redefine yourself after including this file. You only redefine those
  4. which are used ofcourse }
  5. {$ifndef __front_type__}
  6. {$ERROR Undefined type for quasi-template!}
  7. {$endif}
  8. const
  9. MAX_FRONT_ITEMS = 10;
  10. type
  11. TLFront = class // it's a queue ladies and gents
  12. protected
  13. FEmptyItem: __front_type__;
  14. FItems: array[0..MAX_FRONT_ITEMS-1] of __front_type__;
  15. FTop, FBottom: Integer;
  16. FCount: Integer;
  17. function GetEmpty: Boolean;
  18. public
  19. constructor Create(const DefaultItem: __front_type__);
  20. function First: __front_type__;
  21. function Remove: __front_type__;
  22. function Insert(const Value: __front_type__): Boolean;
  23. procedure Clear;
  24. property Count: Integer read FCount;
  25. property Empty: Boolean read GetEmpty;
  26. end;