mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 00:50:33 +02:00
iterators for fcl-stl containers
git-svn-id: trunk@17310 -
This commit is contained in:
parent
83e0b5207d
commit
5dd0d99368
@ -2,7 +2,7 @@
|
||||
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/11/14]
|
||||
#
|
||||
default: all
|
||||
MAKEFILETARGETS=x86_64-linux
|
||||
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
|
||||
BSDs = freebsd netbsd openbsd darwin
|
||||
UNIXs = linux $(BSDs) solaris qnx haiku
|
||||
LIMIT83fs = go32v2 os2 emx watcom
|
||||
@ -266,14 +266,545 @@ endif
|
||||
PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
|
||||
override PACKAGE_NAME=fcl-stl
|
||||
override PACKAGE_VERSION=2.5.1
|
||||
ifeq ($(FULL_TARGET),i386-linux)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-go32v2)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-win32)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-os2)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-freebsd)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-beos)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-haiku)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netbsd)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-solaris)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-qnx)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netware)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-openbsd)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wdosx)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-darwin)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-emx)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-watcom)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netwlibc)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wince)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-embedded)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-symbian)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-linux)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-freebsd)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-netbsd)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-amiga)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-atari)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-openbsd)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-palmos)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-embedded)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-linux)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-netbsd)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-amiga)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-macos)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-darwin)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-morphos)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-embedded)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-linux)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-netbsd)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-solaris)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-embedded)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-linux)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-freebsd)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-solaris)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-darwin)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-win64)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-embedded)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-linux)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-palmos)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-darwin)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-wince)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-gba)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-nds)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-embedded)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-symbian)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-linux)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-darwin)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-embedded)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),avr-embedded)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),armeb-linux)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),armeb-embedded)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),mipsel-linux)
|
||||
override TARGET_UNITS+=garrayutils gdeque gmap gpriorityqueue gqueue gset gstack gutil gvector ghashset ghashmap
|
||||
endif
|
||||
override INSTALL_FPCPACKAGE=y
|
||||
ifeq ($(FULL_TARGET),x86_64-linux)
|
||||
ifeq ($(FULL_TARGET),i386-linux)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-go32v2)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-win32)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-os2)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-freebsd)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-beos)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-haiku)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netbsd)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-solaris)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-qnx)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netware)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-openbsd)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wdosx)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-darwin)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-emx)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-watcom)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netwlibc)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wince)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-embedded)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-symbian)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-linux)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-freebsd)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-netbsd)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-amiga)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-atari)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-openbsd)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-palmos)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-embedded)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-linux)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-netbsd)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-amiga)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-macos)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-darwin)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-morphos)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-embedded)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-linux)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-netbsd)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-solaris)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-embedded)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-linux)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-freebsd)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-solaris)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-darwin)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-win64)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-embedded)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-linux)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-palmos)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-darwin)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-wince)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-gba)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-nds)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-embedded)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-symbian)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-linux)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-darwin)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-embedded)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),avr-embedded)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),armeb-linux)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),armeb-embedded)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),mipsel-linux)
|
||||
override COMPILER_OPTIONS+=-S2h
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-linux)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-go32v2)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-win32)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-os2)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-freebsd)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-beos)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-haiku)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netbsd)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-solaris)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-qnx)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netware)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-openbsd)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wdosx)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-darwin)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-emx)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-watcom)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netwlibc)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wince)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-embedded)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-symbian)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-linux)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-freebsd)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-netbsd)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-amiga)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-atari)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-openbsd)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-palmos)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-embedded)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-linux)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-netbsd)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-amiga)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-macos)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-darwin)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-morphos)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-embedded)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-linux)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-netbsd)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-solaris)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-embedded)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-linux)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-freebsd)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-solaris)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-darwin)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-win64)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-embedded)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-linux)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-palmos)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-darwin)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-wince)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-gba)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-nds)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-embedded)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-symbian)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-linux)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-darwin)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-embedded)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),avr-embedded)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),armeb-linux)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),armeb-embedded)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),mipsel-linux)
|
||||
override COMPILER_SOURCEDIR+=src
|
||||
endif
|
||||
ifdef REQUIRE_UNITSDIR
|
||||
@ -1043,9 +1574,186 @@ TAROPT=vz
|
||||
TAREXT=.tar.gz
|
||||
endif
|
||||
override REQUIRE_PACKAGES=rtl
|
||||
ifeq ($(FULL_TARGET),i386-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-go32v2)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-win32)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-os2)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-freebsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-beos)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-haiku)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-solaris)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-qnx)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netware)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-openbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wdosx)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-darwin)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-emx)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-watcom)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-netwlibc)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wince)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-symbian)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-freebsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-netbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-amiga)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-atari)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-openbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-palmos)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),m68k-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-netbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-amiga)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-macos)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-darwin)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-morphos)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-netbsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-solaris)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),sparc-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-freebsd)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-solaris)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-darwin)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-win64)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),x86_64-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-palmos)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-darwin)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-wince)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-gba)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-nds)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-symbian)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-darwin)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),powerpc64-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),avr-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),armeb-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),armeb-embedded)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),mipsel-linux)
|
||||
REQUIRE_PACKAGES_RTL=1
|
||||
endif
|
||||
ifdef REQUIRE_PACKAGES_RTL
|
||||
PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
|
||||
ifneq ($(PACKAGEDIR_RTL),)
|
||||
|
@ -216,14 +216,14 @@ end;
|
||||
class function TOrderingArrayUtils.NextPermutation(var Arr: TArr; size: SizeUInt):boolean;
|
||||
var i,f:SizeUInt; temp:TValue;
|
||||
begin
|
||||
f := -1;
|
||||
f := size;
|
||||
for i:=size-1 downto 1 do begin
|
||||
if (TCompare.c(arr[i-1], arr[i])) then begin
|
||||
f := i-1;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
if f = -1 then exit(false);
|
||||
if f = size then exit(false);
|
||||
for i:=size-1 downto 1 do begin
|
||||
if (TCompare.c(arr[f], arr[i])) then begin
|
||||
temp:=arr[f]; arr[f] := arr[i]; arr[i] := temp;
|
||||
|
@ -23,13 +23,19 @@ const baseFDataSize = 8;
|
||||
value in range <0,n-1> base only on arguments, n will be always power of 2}
|
||||
|
||||
type
|
||||
generic THashmapIterator<T, TTable>=class
|
||||
generic THashmapIterator<TKey, TValue, T, TTable>=class
|
||||
public
|
||||
var
|
||||
Fh,Fp:SizeUInt;
|
||||
FData:TTable;
|
||||
function Next:boolean;
|
||||
function GetValue:T;
|
||||
function Next:boolean;inline;
|
||||
function GetData:T;inline;
|
||||
function GetKey:TKey;inline;
|
||||
function GetValue:TValue;inline;
|
||||
procedure SetValue(value:TValue);inline;
|
||||
property Data:T read GetData;
|
||||
property Key:TKey read GetKey;
|
||||
property Value:TValue read GetValue write SetValue;
|
||||
end;
|
||||
|
||||
generic THashmap<TKey, TValue, Thash>=class
|
||||
@ -50,7 +56,7 @@ type
|
||||
procedure EnlargeTable;
|
||||
public
|
||||
type
|
||||
TIterator = specialize THashmapIterator<TPair, TTable>;
|
||||
TIterator = specialize THashmapIterator<TKey, TValue, TPair, TTable>;
|
||||
constructor create;
|
||||
destructor destroy;override;
|
||||
procedure insert(key:TKey;value:TValue);inline;
|
||||
@ -58,9 +64,9 @@ type
|
||||
function size:SizeUInt;inline;
|
||||
procedure delete(key:TKey);inline;
|
||||
function IsEmpty:boolean;inline;
|
||||
function GetValue(key:TKey):TValue;inline;
|
||||
function GetData(key:TKey):TValue;inline;
|
||||
|
||||
property Items[i : TKey]: TValue read GetValue write Insert; default;
|
||||
property Items[i : TKey]: TValue read GetData write Insert; default;
|
||||
|
||||
function Iterator:TIterator;
|
||||
end;
|
||||
@ -132,7 +138,7 @@ begin
|
||||
exit(false);
|
||||
end;
|
||||
|
||||
function THashmap.GetValue(key:TKey):TValue;inline;
|
||||
function THashmap.GetData(key:TKey):TValue;inline;
|
||||
var i,h,bs:longint;
|
||||
begin
|
||||
h:=Thash.hash(key,FData.size);
|
||||
@ -192,9 +198,9 @@ begin
|
||||
Next := true;
|
||||
end;
|
||||
|
||||
function THashmapIterator.GetValue:T;
|
||||
function THashmapIterator.GetData:T;
|
||||
begin
|
||||
GetValue:=(FData[Fh])[Fp];
|
||||
GetData:=(FData[Fh])[Fp];
|
||||
end;
|
||||
|
||||
function THashmap.Iterator:TIterator;
|
||||
@ -213,4 +219,19 @@ begin
|
||||
Iterator.FData := FData;
|
||||
end;
|
||||
|
||||
function THashmapIterator.GetKey:TKey;inline;
|
||||
begin
|
||||
GetKey:=((FData[Fh])[Fp]).Key;
|
||||
end;
|
||||
|
||||
function THashmapIterator.GetValue:TValue;inline;
|
||||
begin
|
||||
GetValue:=((FData[Fh])[Fp]).Value;
|
||||
end;
|
||||
|
||||
procedure THashmapIterator.SetValue(value:TValue);inline;
|
||||
begin
|
||||
((FData[Fh]).mutable[Fp])^.Value := value;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -29,8 +29,9 @@ type
|
||||
Fh,Fp:SizeUInt;
|
||||
FData:TTable;
|
||||
function Next:boolean;
|
||||
function GetValue:T;
|
||||
end;
|
||||
function GetData:T;
|
||||
property Data:T read GetData;
|
||||
end;
|
||||
|
||||
generic THashSet<T, Thash>=class
|
||||
private
|
||||
@ -162,9 +163,9 @@ begin
|
||||
Next := true;
|
||||
end;
|
||||
|
||||
function THashSetIterator.GetValue:T;
|
||||
function THashSetIterator.GetData:T;
|
||||
begin
|
||||
GetValue:=(FData[Fh])[Fp];
|
||||
GetData:=(FData[Fh])[Fp];
|
||||
end;
|
||||
|
||||
function THashSet.Iterator:TIterator;
|
||||
|
@ -23,6 +23,21 @@ type
|
||||
class function c(a,b :TPair):boolean;
|
||||
end;
|
||||
|
||||
generic TMapIterator<TKey, TValue, TPair, TNode>=class
|
||||
public
|
||||
type PNode=^TNode;
|
||||
var FNode:PNode;
|
||||
function GetData:TPair;inline;
|
||||
function GetKey:TKey;inline;
|
||||
function GetValue:TValue;inline;
|
||||
procedure SetValue(value:TValue);inline;
|
||||
function Next:boolean;inline;
|
||||
function Prev:boolean;inline;
|
||||
property Data:TPair read GetData;
|
||||
property Key:TKey read GetKey;
|
||||
property Value:TValue read GetValue write SetValue;
|
||||
end;
|
||||
|
||||
generic TMap<TKey, TValue, TCompare>=class
|
||||
public
|
||||
type
|
||||
@ -32,23 +47,23 @@ type
|
||||
end;
|
||||
TMCompare = specialize TMapCompare<TPair, TCompare>;
|
||||
TMSet = specialize TSet<TPair, TMCompare>;
|
||||
TIterator = specialize TMapIterator<TKey, TValue, TPair, TMSet.Node>;
|
||||
PTValue = ^TValue;
|
||||
PTPair = ^TPair;
|
||||
var
|
||||
private
|
||||
FSet:TMSet;
|
||||
public
|
||||
function Find(key:TKey):TMSet.PNode;inline;
|
||||
function FindLess(key:TKey):TMSet.PNode;inline;
|
||||
function FindLessEqual(key:TKey):TMSet.PNode;inline;
|
||||
function FindGreater(key:TKey):TMSet.PNode;inline;
|
||||
function FindGreaterEqual(key:TKey):TMSet.PNode;inline;
|
||||
function Find(key:TKey):TIterator;inline;
|
||||
function FindLess(key:TKey):TIterator;inline;
|
||||
function FindLessEqual(key:TKey):TIterator;inline;
|
||||
function FindGreater(key:TKey):TIterator;inline;
|
||||
function FindGreaterEqual(key:TKey):TIterator;inline;
|
||||
function GetValue(key:TKey):TValue;inline;
|
||||
procedure Insert(key:TKey; value:TValue);inline;
|
||||
function Min:TMSet.PNode;inline;
|
||||
function Max:TMSet.PNode;inline;
|
||||
function Next(x:TMSet.PNode):TMSet.PNode;inline;
|
||||
function Prev(x:TMSet.PNode):TMSet.PNode;inline;
|
||||
function InsertAndGetIterator(key:TKey; value:TValue):TIterator;inline;
|
||||
function Min:TIterator;inline;
|
||||
function Max:TIterator;inline;
|
||||
procedure Delete(key:TKey);inline;
|
||||
function Size:SizeUInt;inline;
|
||||
function IsEmpty:boolean;inline;
|
||||
@ -81,73 +96,110 @@ begin
|
||||
FSet.Delete(Pair);
|
||||
end;
|
||||
|
||||
function TMap.Find(key:TKey):TMSet.PNode;inline;
|
||||
var Pair:TPair;
|
||||
function TMap.Find(key:TKey):TIterator;inline;
|
||||
var Pair:TPair; ret:TIterator;
|
||||
begin
|
||||
Pair.Key:=key;
|
||||
Find:=FSet.Find(Pair);
|
||||
ret := TIterator.create;
|
||||
ret.FNode:=FSet.NFind(Pair);
|
||||
if ret.FNode = nil then begin
|
||||
ret.Destroy; ret := nil;
|
||||
end;
|
||||
Find := ret;
|
||||
end;
|
||||
|
||||
function TMap.FindLess(key:TKey):TMSet.PNode;inline;
|
||||
var Pair:TPair;
|
||||
function TMap.FindLess(key:TKey):TIterator;inline;
|
||||
var Pair:TPair; ret:TIterator;
|
||||
begin
|
||||
Pair.Key:=key;
|
||||
FindLess:=FSet.FindLess(Pair);
|
||||
ret := TIterator.create;
|
||||
ret.FNode:=FSet.NFindLess(Pair);
|
||||
if ret.FNode = nil then begin
|
||||
ret.Destroy; ret := nil;
|
||||
end;
|
||||
FindLess := ret;
|
||||
end;
|
||||
|
||||
function TMap.FindLessEqual(key:TKey):TMSet.PNode;inline;
|
||||
var Pair:TPair;
|
||||
function TMap.FindLessEqual(key:TKey):TIterator;inline;
|
||||
var Pair:TPair; ret:TIterator;
|
||||
begin
|
||||
Pair.Key:=key;
|
||||
FindLessEqual:=FSet.FindLessEqual(Pair);
|
||||
ret := TIterator.create;
|
||||
ret.FNode:=FSet.NFindLessEqual(Pair);
|
||||
if ret.FNode = nil then begin
|
||||
ret.Destroy; ret := nil;
|
||||
end;
|
||||
FindLessEqual := ret;
|
||||
end;
|
||||
|
||||
function TMap.FindGreater(key:TKey):TMSet.PNode;inline;
|
||||
var Pair:TPair;
|
||||
function TMap.FindGreater(key:TKey):TIterator;inline;
|
||||
var Pair:TPair; ret:TIterator;
|
||||
begin
|
||||
Pair.Key:=key;
|
||||
FindGreater:=FSet.FindGreater(Pair);
|
||||
ret := TIterator.create;
|
||||
ret.FNode:=FSet.NFindGreater(Pair);
|
||||
if ret.FNode = nil then begin
|
||||
ret.Destroy; ret := nil;
|
||||
end;
|
||||
FindGreater := ret;
|
||||
end;
|
||||
|
||||
function TMap.FindGreaterEqual(key:TKey):TMSet.PNode;inline;
|
||||
var Pair:TPair;
|
||||
function TMap.FindGreaterEqual(key:TKey):TIterator;inline;
|
||||
var Pair:TPair; ret:TIterator;
|
||||
begin
|
||||
Pair.Key:=key;
|
||||
FindGreaterEqual:=FSet.FindGreaterEqual(Pair);
|
||||
ret := TIterator.create;
|
||||
ret.FNode:=FSet.NFindGreaterEqual(Pair);
|
||||
if ret.FNode = nil then begin
|
||||
ret.Destroy; ret := nil;
|
||||
end;
|
||||
FindGreaterEqual := ret;
|
||||
end;
|
||||
|
||||
function TMap.GetValue(key:TKey):TValue;inline;
|
||||
var Pair:TPair;
|
||||
begin
|
||||
Pair.Key:=key;
|
||||
GetValue:=FSet.Find(Pair)^.Data.Value;
|
||||
GetValue:=FSet.NFind(Pair)^.Data.Value;
|
||||
end;
|
||||
|
||||
procedure TMap.Insert(key:TKey; value:TValue);inline;
|
||||
var Pair:TPair;
|
||||
begin
|
||||
Pair.Key:=key;
|
||||
FSet.Insert(Pair)^.Data.Value := value;
|
||||
FSet.NInsert(Pair)^.Data.Value := value;
|
||||
end;
|
||||
|
||||
function TMap.Min:TMSet.PNode;inline;
|
||||
function TMap.InsertAndGetIterator(key:TKey; value:TValue):TIterator;inline;
|
||||
var Pair:TPair; ret:TIterator;
|
||||
begin
|
||||
Min:=FSet.Min;
|
||||
ret := TIterator.create;
|
||||
Pair.Key:=key;
|
||||
ret.FNode := FSet.NInsert(Pair);
|
||||
ret.FNode^.Data.Value := value;
|
||||
InsertAndGetIterator := ret;
|
||||
end;
|
||||
|
||||
function TMap.Max:TMSet.PNode;inline;
|
||||
function TMap.Min:TIterator;inline;
|
||||
var ret:TIterator;
|
||||
begin
|
||||
Max:=FSet.Max;
|
||||
ret := TIterator.create;
|
||||
ret.FNode:=FSet.NMin;
|
||||
if ret.FNode = nil then begin
|
||||
ret.Destroy; ret := nil;
|
||||
end;
|
||||
Min := ret;
|
||||
end;
|
||||
|
||||
function TMap.Next(x:TMSet.PNode):TMSet.PNode;inline;
|
||||
function TMap.Max:TIterator;inline;
|
||||
var ret:TIterator;
|
||||
begin
|
||||
Next:=FSet.Next(x);
|
||||
end;
|
||||
|
||||
function TMap.Prev(x:TMSet.PNode):TMSet.PNode;inline;
|
||||
begin
|
||||
Prev:=FSet.Prev(x);
|
||||
ret := TIterator.create;
|
||||
ret.FNode:=FSet.NMax;
|
||||
if ret.FNode = nil then begin
|
||||
ret.Destroy; ret := nil;
|
||||
end;
|
||||
Max := ret;
|
||||
end;
|
||||
|
||||
function TMap.Size:SizeUInt;inline;
|
||||
@ -160,4 +212,66 @@ begin
|
||||
IsEmpty:=FSet.IsEmpty;
|
||||
end;
|
||||
|
||||
function TMapIterator.GetData:TPair;inline;
|
||||
begin
|
||||
GetData:=FNode^.Data;
|
||||
end;
|
||||
|
||||
function TMapIterator.GetKey:TKey;inline;
|
||||
begin
|
||||
GetKey:=FNode^.Data.Key;
|
||||
end;
|
||||
|
||||
function TMapIterator.GetValue:TValue;inline;
|
||||
begin
|
||||
GetValue:=FNode^.Data.Value;
|
||||
end;
|
||||
|
||||
procedure TMapIterator.SetValue(value:TValue);inline;
|
||||
begin
|
||||
FNode^.Data.Value := value;
|
||||
end;
|
||||
|
||||
function TMapIterator.Next:boolean;inline;
|
||||
var temp:PNode;
|
||||
begin
|
||||
if(FNode=nil) then exit(false);
|
||||
if(FNode^.Right<>nil) then begin
|
||||
temp:=FNode^.Right;
|
||||
while(temp^.Left<>nil) do temp:=temp^.Left;
|
||||
end
|
||||
else begin
|
||||
temp:=FNode;
|
||||
while(true) do begin
|
||||
if(temp^.Parent=nil) then begin temp:=temp^.Parent; break; end;
|
||||
if(temp^.Parent^.Left=temp) then begin temp:=temp^.Parent; break; end;
|
||||
temp:=temp^.Parent;
|
||||
end;
|
||||
end;
|
||||
if (temp = nil) then exit(false);
|
||||
FNode:=temp;
|
||||
Next:=true;
|
||||
end;
|
||||
|
||||
function TMapIterator.Prev:boolean;inline;
|
||||
var temp:PNode;
|
||||
begin
|
||||
if(FNode=nil) then exit(false);
|
||||
if(FNode^.Left<>nil) then begin
|
||||
temp:=FNode^.Left;
|
||||
while(temp^.Right<>nil) do temp:=temp^.Right;
|
||||
end
|
||||
else begin
|
||||
temp:=FNode;
|
||||
while(true) do begin
|
||||
if(temp^.Parent=nil) then begin temp:=temp^.Parent; break; end;
|
||||
if(temp^.Parent^.Right=temp) then begin temp:=temp^.Parent; break; end;
|
||||
temp:=temp^.Parent;
|
||||
end;
|
||||
end;
|
||||
if (temp = nil) then exit(false);
|
||||
FNode:=temp;
|
||||
Prev:=true;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -20,6 +20,16 @@ const RED=true;
|
||||
const BLACK=false;
|
||||
|
||||
type
|
||||
generic TSetIterator<T, TNode>=class
|
||||
public
|
||||
type PNode=^TNode;
|
||||
var FNode:PNode;
|
||||
function GetData:T;
|
||||
function Next:boolean;
|
||||
function Prev:boolean;
|
||||
property Data:T read GetData;
|
||||
end;
|
||||
|
||||
generic TSet<T, TCompare>=class
|
||||
public
|
||||
type
|
||||
@ -30,6 +40,7 @@ type
|
||||
Parent:PNode;
|
||||
Color:boolean;
|
||||
end;
|
||||
TIterator=specialize TSetIterator<T, Node>;
|
||||
var
|
||||
private
|
||||
FBase:PNode;
|
||||
@ -48,24 +59,31 @@ type
|
||||
function MoveRedRight(nod:PNode):PNode;inline;
|
||||
function DeleteMin(nod:PNode):PNode;
|
||||
function Delete(value:T; nod:PNode):PNode;
|
||||
function Min(nod:PNode):PNode;inline;
|
||||
|
||||
function Min(nod:PNode):PNode;inline;
|
||||
public
|
||||
function Find(value:T):PNode;inline;
|
||||
function FindLess(value:T):PNode;inline;
|
||||
function FindLessEqual(value:T):PNode;inline;
|
||||
function FindGreater(value:T):PNode;inline;
|
||||
function FindGreaterEqual(value:T):PNode;inline;
|
||||
function Insert(value:T):PNode;inline;
|
||||
function Min:PNode;inline;
|
||||
function Max:PNode;inline;
|
||||
function Next(x:PNode):PNode;inline;
|
||||
function Prev(x:PNode):PNode;inline;
|
||||
function Find(value:T):TIterator;inline;
|
||||
function FindLess(value:T):TIterator;inline;
|
||||
function FindLessEqual(value:T):TIterator;inline;
|
||||
function FindGreater(value:T):TIterator;inline;
|
||||
function FindGreaterEqual(value:T):TIterator;inline;
|
||||
function InsertAndGetIterator(value:T):TIterator;inline;
|
||||
procedure Insert(value:T);inline;
|
||||
function Min:TIterator;inline;
|
||||
function Max:TIterator;inline;
|
||||
procedure Delete(value:T);inline;
|
||||
public constructor Create;
|
||||
public destructor Destroy;override;
|
||||
function Size:SizeUInt;
|
||||
function IsEmpty:boolean;
|
||||
|
||||
function NFind(value:T):PNode;inline;
|
||||
function NFindLess(value:T):PNode;inline;
|
||||
function NFindLessEqual(value:T):PNode;inline;
|
||||
function NFindGreater(value:T):PNode;inline;
|
||||
function NFindGreaterEqual(value:T):PNode;inline;
|
||||
function NInsert(value:T):PNode;inline;
|
||||
function NMin:PNode;inline;
|
||||
function NMax:PNode;inline;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -242,19 +260,41 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function TSet.Find(value:T):PNode;inline;
|
||||
function TSet.Find(value:T):TIterator;inline;
|
||||
var ret:TIterator; x:PNode;
|
||||
begin
|
||||
x := NFind(value);
|
||||
if x = nil then exit(nil);
|
||||
ret := TIterator.create;
|
||||
ret.FNode := x;
|
||||
Find := ret;
|
||||
end;
|
||||
|
||||
function TSet.NFind(value:T):PNode;inline;
|
||||
var x:PNode;
|
||||
begin
|
||||
x:=FBase;
|
||||
while(x <> nil) do begin
|
||||
if(TCompare.c(value,x^.Data)) then x:=x^.Left
|
||||
else if(TCompare.c(x^.Data,value)) then x:=x^.Right
|
||||
else exit(x);
|
||||
else begin
|
||||
exit(x);
|
||||
end;
|
||||
end;
|
||||
exit(nil);
|
||||
end;
|
||||
|
||||
function TSet.FindLess(value:T):PNode;inline;
|
||||
function TSet.FindLess(value:T):TIterator;inline;
|
||||
var ret:TIterator; x:PNode;
|
||||
begin
|
||||
x := NFindLess(value);
|
||||
if x = nil then exit(nil);
|
||||
ret := TIterator.create;
|
||||
ret.FNode := x;
|
||||
FindLess := ret;
|
||||
end;
|
||||
|
||||
function TSet.NFindLess(value:T):PNode;inline;
|
||||
var x,cur:PNode;
|
||||
begin
|
||||
x:=nil;
|
||||
@ -267,10 +307,20 @@ begin
|
||||
end else
|
||||
cur:=cur^.left;
|
||||
end;
|
||||
FindLess:=x;
|
||||
NFindLess := x;
|
||||
end;
|
||||
|
||||
function TSet.FindLessEqual(value:T):PNode;inline;
|
||||
function TSet.FindLessEqual(value:T):TIterator;inline;
|
||||
var ret:TIterator; x:PNode;
|
||||
begin
|
||||
x := NFindLessEqual(value);
|
||||
if x = nil then exit(nil);
|
||||
ret := TIterator.create;
|
||||
ret.FNode := x;
|
||||
FindLessEqual := ret;
|
||||
end;
|
||||
|
||||
function TSet.NFindLessEqual(value:T):PNode;inline;
|
||||
var x,cur:PNode;
|
||||
begin
|
||||
x:=nil;
|
||||
@ -283,10 +333,20 @@ begin
|
||||
end else
|
||||
cur:=cur^.left;
|
||||
end;
|
||||
FindLessEqual:=x;
|
||||
NFindLessEqual := x
|
||||
end;
|
||||
|
||||
function TSet.FindGreater(value:T):PNode;inline;
|
||||
function TSet.FindGreater(value:T):TIterator;inline;
|
||||
var ret:TIterator; x:PNode;
|
||||
begin
|
||||
x := NFindGreater(value);
|
||||
if x = nil then exit(nil);
|
||||
ret := TIterator.create;
|
||||
ret.FNode := x;
|
||||
FindGreater := ret;
|
||||
end;
|
||||
|
||||
function TSet.NFindGreater(value:T):PNode;inline;
|
||||
var x,cur:PNode;
|
||||
begin
|
||||
x:=nil;
|
||||
@ -299,10 +359,20 @@ begin
|
||||
end else
|
||||
cur:=cur^.right;
|
||||
end;
|
||||
FindGreater:=x;
|
||||
NFindGreater := x;
|
||||
end;
|
||||
|
||||
function TSet.FindGreaterEqual(value:T):PNode;inline;
|
||||
function TSet.FindGreaterEqual(value:T):TIterator;inline;
|
||||
var ret:TIterator; x:PNode;
|
||||
begin
|
||||
x := NFindGreaterEqual(value);
|
||||
if x = nil then exit(nil);
|
||||
ret := TIterator.create;
|
||||
ret.FNode := x;
|
||||
FindGreaterEqual := ret;
|
||||
end;
|
||||
|
||||
function TSet.NFindGreaterEqual(value:T):PNode;inline;
|
||||
var x,cur:PNode;
|
||||
begin
|
||||
x:=nil;
|
||||
@ -315,15 +385,32 @@ begin
|
||||
end else
|
||||
cur:=cur^.right;
|
||||
end;
|
||||
FindGreaterEqual:=x;
|
||||
NFindGreaterEqual := x;
|
||||
end;
|
||||
|
||||
function TSet.Insert(value:T):PNode;inline;
|
||||
procedure TSet.Insert(value:T);inline;
|
||||
var position:PNode;
|
||||
begin
|
||||
FBase:=Insert(value, FBase, position);
|
||||
FBase^.Color:=BLACK;
|
||||
Insert:=position;
|
||||
end;
|
||||
|
||||
function TSet.NInsert(value:T):PNode;inline;
|
||||
var position:PNode;
|
||||
begin
|
||||
FBase:=Insert(value, FBase, position);
|
||||
FBase^.Color:=BLACK;
|
||||
NInsert := position;
|
||||
end;
|
||||
|
||||
function TSet.InsertAndGetIterator(value:T):TIterator;inline;
|
||||
var position:PNode; ret:TIterator;
|
||||
begin
|
||||
FBase:=Insert(value, FBase, position);
|
||||
FBase^.Color:=BLACK;
|
||||
ret := TIterator.create;
|
||||
ret.FNode := position;
|
||||
InsertAndGetIterator := ret;
|
||||
end;
|
||||
|
||||
function TSet.Insert(value:T; nod:PNode; var position:PNode):PNode;
|
||||
@ -367,57 +454,93 @@ begin
|
||||
exit(temp);
|
||||
end;
|
||||
|
||||
function TSet.Min:PNode;inline;
|
||||
function TSet.NMin:PNode;inline;
|
||||
var nod:PNode;
|
||||
begin
|
||||
if FBase=nil then exit(nil);
|
||||
Min:=Min(FBase);
|
||||
nod:=Min(FBase);
|
||||
if (nod = nil) then exit(nil);
|
||||
NMin := nod;
|
||||
end;
|
||||
|
||||
function TSet.Max:PNode;inline;
|
||||
var temp:PNode;
|
||||
function TSet.Min:TIterator;inline;
|
||||
var nod:PNode;
|
||||
ret:TIterator;
|
||||
begin
|
||||
nod:=NMin;
|
||||
if (nod = nil) then exit(nil);
|
||||
ret := TIterator.create;
|
||||
ret.FNode := nod;
|
||||
Min := ret;
|
||||
end;
|
||||
|
||||
function TSet.NMax:PNode;inline;
|
||||
var temp:PNode;
|
||||
begin
|
||||
if FBase=nil then exit(nil);
|
||||
temp:=FBase;
|
||||
while(temp^.Right<>nil) do temp:=temp^.Right;
|
||||
exit(temp);
|
||||
|
||||
NMax := temp;
|
||||
end;
|
||||
|
||||
function TSet.Next(x:PNode):PNode;inline;
|
||||
function TSet.Max:TIterator;inline;
|
||||
var temp:PNode; ret:TIterator;
|
||||
begin
|
||||
if FBase=nil then exit(nil);
|
||||
temp:=FBase;
|
||||
while(temp^.Right<>nil) do temp:=temp^.Right;
|
||||
|
||||
ret := TIterator.create;
|
||||
ret.FNode := temp;
|
||||
Max := ret;
|
||||
end;
|
||||
|
||||
function TSetIterator.GetData:T;
|
||||
begin
|
||||
GetData:= FNode^.Data;
|
||||
end;
|
||||
|
||||
function TSetIterator.Next:boolean;
|
||||
var temp:PNode;
|
||||
begin
|
||||
if(x=nil) then exit(nil);
|
||||
if(x^.Right<>nil) then begin
|
||||
temp:=x^.Right;
|
||||
if(FNode=nil) then exit(false);
|
||||
if(FNode^.Right<>nil) then begin
|
||||
temp:=FNode^.Right;
|
||||
while(temp^.Left<>nil) do temp:=temp^.Left;
|
||||
end
|
||||
else begin
|
||||
temp:=x;
|
||||
temp:=FNode;
|
||||
while(true) do begin
|
||||
if(temp^.Parent=nil) then begin temp:=temp^.Parent; break; end;
|
||||
if(temp^.Parent^.Left=temp) then begin temp:=temp^.Parent; break; end;
|
||||
temp:=temp^.Parent;
|
||||
end;
|
||||
end;
|
||||
exit(temp);
|
||||
if (temp = nil) then exit(false);
|
||||
FNode:=temp;
|
||||
Next:=true;
|
||||
end;
|
||||
|
||||
function TSet.Prev(x:PNode):PNode;inline;
|
||||
function TSetIterator.Prev:boolean;
|
||||
var temp:PNode;
|
||||
begin
|
||||
if(x=nil) then exit(nil);
|
||||
if(x^.Left<>nil) then begin
|
||||
temp:=x^.Left;
|
||||
if(FNode=nil) then exit(false);
|
||||
if(FNode^.Left<>nil) then begin
|
||||
temp:=FNode^.Left;
|
||||
while(temp^.Right<>nil) do temp:=temp^.Right;
|
||||
end
|
||||
else begin
|
||||
temp:=x;
|
||||
temp:=FNode;
|
||||
while(true) do begin
|
||||
if(temp^.Parent=nil) then begin temp:=temp^.Parent; break; end;
|
||||
if(temp^.Parent^.Right=temp) then begin temp:=temp^.Parent; break; end;
|
||||
temp:=temp^.Parent;
|
||||
end;
|
||||
end;
|
||||
exit(temp);
|
||||
if (temp = nil) then exit(false);
|
||||
FNode:=temp;
|
||||
Prev:=true;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -81,8 +81,12 @@ begin
|
||||
end;
|
||||
it:=data.Iterator;
|
||||
repeat
|
||||
inc(x[it.GetValue.key]);
|
||||
AssertEquals('bad value', it.GetValue.key*47, it.GetValue.value);
|
||||
inc(x[it.Data.key]);
|
||||
AssertEquals('bad value', it.Data.key*47, it.Data.value);
|
||||
AssertEquals('bad value2', it.Key*47, it.Value);
|
||||
it.Value := it.Key+23;
|
||||
it.Value := it.Value*2;
|
||||
AssertEquals('bad value3', it.Key*2+46, it.Value);
|
||||
until not it.next;
|
||||
for i:=0 to 1000 do begin
|
||||
AssertEquals('som not 1', 1, x[i]);
|
||||
|
@ -80,7 +80,7 @@ begin
|
||||
end;
|
||||
it:=data.Iterator;
|
||||
repeat
|
||||
inc(x[it.GetValue]);
|
||||
inc(x[it.Data]);
|
||||
until not it.next;
|
||||
for i:=0 to 1000 do begin
|
||||
AssertEquals('som not 1', 1, x[i]);
|
||||
|
@ -21,23 +21,23 @@ type TGMapTest = class(TTestCase)
|
||||
implementation
|
||||
|
||||
procedure TGMapTest.MapTest;
|
||||
var it:maplli.TMSet.pnode;
|
||||
var it:maplli.TIterator;
|
||||
begin
|
||||
data[3]:=3;
|
||||
data[5]:=5;
|
||||
data[7]:=7;
|
||||
AssertEquals('Wrong min key', 3, data.min()^.data.key);
|
||||
AssertEquals('Wrong max key', 7, data.max()^.data.key);
|
||||
AssertEquals('Wrong min val', 3, data.min()^.data.value);
|
||||
AssertEquals('Wrong max val', 7, data.max()^.data.value);
|
||||
AssertEquals('Wrong min key', 3, data.min().GetData.key);
|
||||
AssertEquals('Wrong max key', 7, data.max().GetData.key);
|
||||
AssertEquals('Wrong min val', 3, data.min().GetData.value);
|
||||
AssertEquals('Wrong max val', 7, data.max().GetData.value);
|
||||
|
||||
AssertEquals('Wrong val', 5, data[5]);
|
||||
|
||||
data.delete(3);
|
||||
AssertEquals('Wrong min key', 5, data.min()^.data.key);
|
||||
AssertEquals('Wrong max key', 7, data.max()^.data.key);
|
||||
AssertEquals('Wrong min val', 5, data.min()^.data.value);
|
||||
AssertEquals('Wrong max val', 7, data.max()^.data.value);
|
||||
AssertEquals('Wrong min key', 5, data.min().GetData.key);
|
||||
AssertEquals('Wrong max key', 7, data.max().GetData.key);
|
||||
AssertEquals('Wrong min val', 5, data.min().GetData.value);
|
||||
AssertEquals('Wrong max val', 7, data.max().GetData.value);
|
||||
|
||||
|
||||
data[3]:=3;
|
||||
@ -50,28 +50,27 @@ begin
|
||||
data[17]:=42;
|
||||
|
||||
it:=data.min;
|
||||
AssertEquals('Wrong min', 3, it^.Data.key);
|
||||
it:=data.next(it);
|
||||
AssertEquals('Wrong next', 5, it^.Data.key);
|
||||
it:=data.next(it);
|
||||
AssertEquals('Wrong next', 7, it^.Data.key);
|
||||
it:=data.next(it);
|
||||
AssertEquals('Wrong next', 17, it^.Data.key);
|
||||
it:=data.next(it);
|
||||
if(it<>nil) then
|
||||
AssertEquals('Last not nil', 0, 1);
|
||||
AssertEquals('Wrong min', 3, it.Key);
|
||||
AssertEquals('Next not true', true, it.Next);
|
||||
AssertEquals('Wrong next', 5, it.Key);
|
||||
AssertEquals('Wrong next value', 5, it.Value);
|
||||
it.Value := it.Value + 17;
|
||||
AssertEquals('Wrong value update', 22, it.Value);
|
||||
AssertEquals('Next not true', true, it.Next);
|
||||
AssertEquals('Wrong next', 7, it.GetData.key);
|
||||
AssertEquals('Next not true', true, it.Next);
|
||||
AssertEquals('Wrong next', 17, it.GetData.key);
|
||||
AssertEquals('Next not false', false, it.Next);
|
||||
|
||||
it:=data.max;
|
||||
AssertEquals('Wrong max', 17, it^.Data.key);
|
||||
it:=data.prev(it);
|
||||
AssertEquals('Wrong prev', 7, it^.Data.key);
|
||||
it:=data.prev(it);
|
||||
AssertEquals('Wrong prev', 5, it^.Data.key);
|
||||
it:=data.prev(it);
|
||||
AssertEquals('Wrong prev', 3, it^.Data.key);
|
||||
it:=data.prev(it);
|
||||
if(it<>nil) then
|
||||
AssertEquals('First not nil', 0, 1);
|
||||
AssertEquals('Wrong max', 17, it.GetData.key);
|
||||
AssertEquals('Prev not true', true, it.Prev);
|
||||
AssertEquals('Wrong prev', 7, it.GetData.key);
|
||||
AssertEquals('Prev not true', true, it.Prev);
|
||||
AssertEquals('Wrong prev', 5, it.GetData.key);
|
||||
AssertEquals('Prev not true', true, it.Prev);
|
||||
AssertEquals('Wrong prev', 3, it.GetData.key);
|
||||
AssertEquals('Prev not false', false, it.Prev);
|
||||
end;
|
||||
|
||||
procedure TGMapTest.Setup;
|
||||
|
@ -12,6 +12,7 @@ type lesslli=specialize TLess<longint>;
|
||||
type TGSetTest = class(TTestCase)
|
||||
Published
|
||||
procedure SetTest;
|
||||
procedure IteratorTest;
|
||||
public
|
||||
procedure Setup;override;
|
||||
private
|
||||
@ -20,55 +21,73 @@ type TGSetTest = class(TTestCase)
|
||||
|
||||
implementation
|
||||
|
||||
procedure TGSetTest.IteratorTest;
|
||||
var it:setlli.TIterator;
|
||||
begin
|
||||
it:=data.min;
|
||||
if (it <> nil) then
|
||||
AssertEquals('not null min', 0, 1);
|
||||
data.insert(3);
|
||||
data.insert(5);
|
||||
data.insert(7);
|
||||
it:=data.min;
|
||||
AssertEquals('bad value', 3, it.Data);
|
||||
AssertEquals('next not true', true, it.Next);
|
||||
AssertEquals('bad value', 5, it.Data);
|
||||
AssertEquals('next not true', true, it.Next);
|
||||
AssertEquals('bad value', 7, it.Data);
|
||||
AssertEquals('next not false', false, it.Next);
|
||||
end;
|
||||
|
||||
procedure TGSetTest.SetTest;
|
||||
var it:setlli.pnode;
|
||||
var it:setlli.TIterator;
|
||||
begin
|
||||
data.insert(3);
|
||||
data.insert(5);
|
||||
data.insert(7);
|
||||
AssertEquals('Wrong min', 3, data.min()^.data);
|
||||
AssertEquals('Wrong max', 7, data.max()^.data);
|
||||
AssertEquals('Wrong min', 3, data.min().Data);
|
||||
AssertEquals('Wrong max', 7, data.max().Data);
|
||||
data.delete(3);
|
||||
AssertEquals('Wrong size', 2, data.size);
|
||||
AssertEquals('Wrong min', 5, data.min()^.data);
|
||||
AssertEquals('Wrong min', 5, data.min().Data);
|
||||
data.insert(3);
|
||||
data.insert(3);
|
||||
data.insert(3);
|
||||
AssertEquals('Wrong size', 3, data.size);
|
||||
AssertEquals('Wrong min', 3, data.min()^.data);
|
||||
AssertEquals('Wrong min', 3, data.min().Data);
|
||||
if(data.find(4)<>nil) then
|
||||
Fail('Found key which not there');
|
||||
if(data.find(5)=nil) then
|
||||
Fail('Not found key which was there');
|
||||
|
||||
if(data.FindLess(8)^.data<>7) then
|
||||
if(data.FindLess(8).Data<>7) then
|
||||
Fail('Wrong less than 8');
|
||||
if(data.FindLess(7)^.data<>5) then
|
||||
if(data.FindLess(7).Data<>5) then
|
||||
Fail('Wrong less than 7');
|
||||
if(data.FindLess(3)<>nil) then
|
||||
Fail('Wrong less than 3');
|
||||
|
||||
if(data.FindLessEqual(8)^.data<>7) then
|
||||
if(data.FindLessEqual(8).Data<>7) then
|
||||
Fail('Wrong less equal than 8');
|
||||
if(data.FindLessEqual(7)^.data<>7) then
|
||||
if(data.FindLessEqual(7).Data<>7) then
|
||||
Fail('Wrong less equal than 7');
|
||||
if(data.FindLessEqual(6)^.data<>5) then
|
||||
if(data.FindLessEqual(6).Data<>5) then
|
||||
Fail('Wrong less equal than 6');
|
||||
if(data.FindLessEqual(2)<>nil) then
|
||||
Fail('Wrong less equal than 2');
|
||||
|
||||
if(data.FindGreater(2)^.data<>3) then
|
||||
if(data.FindGreater(2).Data<>3) then
|
||||
Fail('Wrong greater than 2');
|
||||
if(data.Findgreater(3)^.data<>5) then
|
||||
if(data.Findgreater(3).Data<>5) then
|
||||
Fail('Wrong greater than 3');
|
||||
if(data.Findgreater(7)<>nil) then
|
||||
Fail('Wrong greater than 7');
|
||||
|
||||
if(data.FindGreaterEqual(2)^.data<>3) then
|
||||
if(data.FindGreaterEqual(2).Data<>3) then
|
||||
Fail('Wrong greater equal than 2');
|
||||
if(data.FindGreaterEqual(3)^.data<>3) then
|
||||
if(data.FindGreaterEqual(3).Data<>3) then
|
||||
Fail('Wrong greater equal than 3');
|
||||
if(data.FindGreaterEqual(4)^.data<>5) then
|
||||
if(data.FindGreaterEqual(4).Data<>5) then
|
||||
Fail('Wrong greater equal than 4');
|
||||
if(data.FindGreaterEqual(8)<>nil) then
|
||||
Fail('Wrong greater equal than 8');
|
||||
@ -76,28 +95,24 @@ begin
|
||||
data.insert(17);
|
||||
|
||||
it:=data.min;
|
||||
AssertEquals('Wrong min', 3, it^.data);
|
||||
it:=data.next(it);
|
||||
AssertEquals('Wrong next', 5, it^.data);
|
||||
it:=data.next(it);
|
||||
AssertEquals('Wrong next', 7, it^.data);
|
||||
it:=data.next(it);
|
||||
AssertEquals('Wrong next', 17, it^.data);
|
||||
it:=data.next(it);
|
||||
if(it<>nil) then
|
||||
AssertEquals('Last not nil', 0, 1);
|
||||
AssertEquals('Wrong min', 3, it.Data);
|
||||
AssertEquals('Next not true', true, it.next);
|
||||
AssertEquals('Wrong next', 5, it.Data);
|
||||
AssertEquals('Next not true', true, it.next);
|
||||
AssertEquals('Wrong next', 7, it.Data);
|
||||
AssertEquals('Next not true', true, it.next);
|
||||
AssertEquals('Wrong next', 17, it.Data);
|
||||
AssertEquals('Last next not fail', false, it.next);
|
||||
|
||||
it:=data.max;
|
||||
AssertEquals('Wrong max', 17, it^.data);
|
||||
it:=data.prev(it);
|
||||
AssertEquals('Wrong prev', 7, it^.data);
|
||||
it:=data.prev(it);
|
||||
AssertEquals('Wrong prev', 5, it^.data);
|
||||
it:=data.prev(it);
|
||||
AssertEquals('Wrong prev', 3, it^.data);
|
||||
it:=data.prev(it);
|
||||
if(it<>nil) then
|
||||
AssertEquals('First not nil', 0, 1);
|
||||
AssertEquals('Wrong max', 17, it.Data);
|
||||
AssertEquals('Prev not true', true, it.prev);
|
||||
AssertEquals('Wrong prev', 7, it.Data);
|
||||
AssertEquals('Prev not true', true, it.prev);
|
||||
AssertEquals('Wrong prev', 5, it.Data);
|
||||
AssertEquals('Prev not true', true, it.prev);
|
||||
AssertEquals('Wrong prev', 3, it.Data);
|
||||
AssertEquals('First prev not fail', false, it.prev);
|
||||
end;
|
||||
|
||||
procedure TGSetTest.Setup;
|
||||
|
Loading…
Reference in New Issue
Block a user