- Timestamp:
- Oct 30, 2010, 6:39:12 PM (14 years ago)
- Location:
- Generics/TemplateGenerics
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/TemplateGenerics/Demo
- Property svn:ignore
-
old new 1 1 lib 2 2 Demo.exe 3 heaptrclog.trc 4 Demo
-
- Property svn:ignore
-
Generics/TemplateGenerics/Demo/Demo.lpi
r77 r78 38 38 </Item2> 39 39 </RequiredPackages> 40 <Units Count="6 6">40 <Units Count="69"> 41 41 <Unit0> 42 42 <Filename Value="Demo.lpr"/> 43 43 <IsPartOfProject Value="True"/> 44 44 <UnitName Value="Demo"/> 45 <EditorIndex Value=" 8"/>46 <WindowIndex Value="0"/> 47 <TopLine Value="1"/> 48 <CursorPos X=" 34" Y="7"/>49 <UsageCount Value="5 0"/>45 <EditorIndex Value="11"/> 46 <WindowIndex Value="0"/> 47 <TopLine Value="1"/> 48 <CursorPos X="26" Y="8"/> 49 <UsageCount Value="53"/> 50 50 <Loaded Value="True"/> 51 51 <DefaultSyntaxHighlighter Value="Delphi"/> … … 57 57 <ResourceBaseClass Value="Form"/> 58 58 <UnitName Value="UMainForm"/> 59 <IsVisibleTab Value="True"/> 59 60 <EditorIndex Value="0"/> 60 61 <WindowIndex Value="0"/> 61 <TopLine Value=" 268"/>62 <CursorPos X=" 38" Y="171"/>63 <UsageCount Value="5 0"/>62 <TopLine Value="302"/> 63 <CursorPos X="47" Y="319"/> 64 <UsageCount Value="53"/> 64 65 <Loaded Value="True"/> 65 66 <LoadedDesigner Value="True"/> … … 181 182 <Unit16> 182 183 <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/classesh.inc"/> 183 <WindowIndex Value="0"/> 184 <TopLine Value="254"/> 185 <CursorPos X="27" Y="265"/> 186 <UsageCount Value="9"/> 184 <EditorIndex Value="2"/> 185 <WindowIndex Value="0"/> 186 <TopLine Value="246"/> 187 <CursorPos X="21" Y="273"/> 188 <UsageCount Value="12"/> 189 <Loaded Value="True"/> 187 190 <DefaultSyntaxHighlighter Value="Delphi"/> 188 191 </Unit16> 189 192 <Unit17> 190 193 <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/lists.inc"/> 191 <WindowIndex Value="0"/> 192 <TopLine Value="526"/> 193 <CursorPos X="1" Y="528"/> 194 <UsageCount Value="9"/> 194 <EditorIndex Value="3"/> 195 <WindowIndex Value="0"/> 196 <TopLine Value="588"/> 197 <CursorPos X="3" Y="593"/> 198 <UsageCount Value="12"/> 199 <Loaded Value="True"/> 195 200 <DefaultSyntaxHighlighter Value="Delphi"/> 196 201 </Unit17> … … 206 211 <Filename Value="../Specialized/ListDouble.pas"/> 207 212 <UnitName Value="ListDouble"/> 208 <EditorIndex Value="1 3"/>213 <EditorIndex Value="12"/> 209 214 <WindowIndex Value="0"/> 210 215 <TopLine Value="1"/> 211 216 <CursorPos X="12" Y="21"/> 212 <UsageCount Value="2 3"/>217 <UsageCount Value="25"/> 213 218 <Loaded Value="True"/> 214 219 </Unit19> … … 216 221 <Filename Value="../Specialized/ListInteger.pas"/> 217 222 <UnitName Value="ListInteger"/> 218 <EditorIndex Value="1 4"/>223 <EditorIndex Value="13"/> 219 224 <WindowIndex Value="0"/> 220 225 <TopLine Value="1"/> 221 226 <CursorPos X="25" Y="17"/> 222 <UsageCount Value="2 3"/>227 <UsageCount Value="25"/> 223 228 <Loaded Value="True"/> 224 229 </Unit20> … … 226 231 <Filename Value="../Specialized/ListObject.pas"/> 227 232 <UnitName Value="ListObject"/> 228 <EditorIndex Value="1 6"/>229 <WindowIndex Value="0"/> 230 <TopLine Value=" 2"/>231 <CursorPos X="1 " Y="33"/>232 <UsageCount Value="2 3"/>233 <EditorIndex Value="15"/> 234 <WindowIndex Value="0"/> 235 <TopLine Value="33"/> 236 <CursorPos X="12" Y="56"/> 237 <UsageCount Value="25"/> 233 238 <Loaded Value="True"/> 234 239 </Unit21> … … 240 245 <TopLine Value="1"/> 241 246 <CursorPos X="23" Y="21"/> 242 <UsageCount Value="2 3"/>247 <UsageCount Value="25"/> 243 248 <Loaded Value="True"/> 244 249 </Unit22> … … 250 255 <TopLine Value="1"/> 251 256 <CursorPos X="23" Y="24"/> 252 <UsageCount Value="2 3"/>257 <UsageCount Value="25"/> 253 258 <Loaded Value="True"/> 254 259 </Unit23> … … 260 265 <TopLine Value="1"/> 261 266 <CursorPos X="23" Y="13"/> 262 <UsageCount Value="2 3"/>267 <UsageCount Value="25"/> 263 268 <Loaded Value="True"/> 264 269 </Unit24> … … 270 275 <TopLine Value="1"/> 271 276 <CursorPos X="23" Y="24"/> 272 <UsageCount Value="2 3"/>277 <UsageCount Value="25"/> 273 278 <Loaded Value="True"/> 274 279 </Unit25> … … 280 285 <TopLine Value="1"/> 281 286 <CursorPos X="1" Y="27"/> 282 <UsageCount Value="2 3"/>287 <UsageCount Value="25"/> 283 288 <Loaded Value="True"/> 284 289 </Unit26> … … 290 295 <TopLine Value="1"/> 291 296 <CursorPos X="29" Y="17"/> 292 <UsageCount Value="2 3"/>297 <UsageCount Value="25"/> 293 298 <Loaded Value="True"/> 294 299 </Unit27> … … 299 304 <TopLine Value="1"/> 300 305 <CursorPos X="1" Y="2"/> 301 <UsageCount Value="2 3"/>306 <UsageCount Value="25"/> 302 307 <Loaded Value="True"/> 303 308 <DefaultSyntaxHighlighter Value="None"/> … … 309 314 <TopLine Value="1"/> 310 315 <CursorPos X="20" Y="12"/> 311 <UsageCount Value="2 3"/>316 <UsageCount Value="25"/> 312 317 <Loaded Value="True"/> 313 318 <DefaultSyntaxHighlighter Value="None"/> … … 317 322 <EditorIndex Value="31"/> 318 323 <WindowIndex Value="0"/> 319 <TopLine Value=" 1"/>320 <CursorPos X=" 38" Y="19"/>321 <UsageCount Value="2 3"/>324 <TopLine Value="23"/> 325 <CursorPos X="14" Y="40"/> 326 <UsageCount Value="25"/> 322 327 <Loaded Value="True"/> 323 328 <DefaultSyntaxHighlighter Value="None"/> … … 325 330 <Unit31> 326 331 <Filename Value="../Generic/ListImplementation.tpl"/> 327 <IsVisibleTab Value="True"/>328 332 <EditorIndex Value="33"/> 329 333 <WindowIndex Value="0"/> 330 <TopLine Value="1 28"/>331 <CursorPos X=" 69" Y="151"/>332 <UsageCount Value="2 3"/>334 <TopLine Value="114"/> 335 <CursorPos X="3" Y="116"/> 336 <UsageCount Value="25"/> 333 337 <Loaded Value="True"/> 334 338 <DefaultSyntaxHighlighter Value="None"/> … … 340 344 <TopLine Value="23"/> 341 345 <CursorPos X="1" Y="2"/> 342 <UsageCount Value="2 3"/>346 <UsageCount Value="25"/> 343 347 <Loaded Value="True"/> 344 348 <DefaultSyntaxHighlighter Value="None"/> … … 350 354 <TopLine Value="1"/> 351 355 <CursorPos X="1" Y="9"/> 352 <UsageCount Value="2 3"/>356 <UsageCount Value="25"/> 353 357 <Loaded Value="True"/> 354 358 <DefaultSyntaxHighlighter Value="None"/> … … 361 365 <TopLine Value="1"/> 362 366 <CursorPos X="32" Y="18"/> 363 <UsageCount Value="2 3"/>367 <UsageCount Value="25"/> 364 368 <Loaded Value="True"/> 365 369 </Unit34> … … 370 374 <TopLine Value="1"/> 371 375 <CursorPos X="42" Y="15"/> 372 <UsageCount Value="2 1"/>376 <UsageCount Value="23"/> 373 377 <Loaded Value="True"/> 374 378 <DefaultSyntaxHighlighter Value="None"/> … … 381 385 <TopLine Value="1"/> 382 386 <CursorPos X="1" Y="22"/> 383 <UsageCount Value="2 1"/>387 <UsageCount Value="23"/> 384 388 <Loaded Value="True"/> 385 389 </Unit36> … … 390 394 <TopLine Value="1"/> 391 395 <CursorPos X="32" Y="12"/> 392 <UsageCount Value="2 1"/>396 <UsageCount Value="23"/> 393 397 <Loaded Value="True"/> 394 398 <DefaultSyntaxHighlighter Value="None"/> … … 396 400 <Unit38> 397 401 <Filename Value="../Generic/QueueImplementation.tpl"/> 398 <EditorIndex Value="3 7"/>402 <EditorIndex Value="35"/> 399 403 <WindowIndex Value="0"/> 400 404 <TopLine Value="1"/> 401 405 <CursorPos X="33" Y="28"/> 402 <UsageCount Value="2 1"/>406 <UsageCount Value="23"/> 403 407 <Loaded Value="True"/> 404 408 <DefaultSyntaxHighlighter Value="None"/> … … 406 410 <Unit39> 407 411 <Filename Value="../Generic/QueueInterface.tpl"/> 408 <EditorIndex Value="3 8"/>412 <EditorIndex Value="36"/> 409 413 <WindowIndex Value="0"/> 410 414 <TopLine Value="1"/> 411 415 <CursorPos X="18" Y="14"/> 412 <UsageCount Value="2 1"/>416 <UsageCount Value="23"/> 413 417 <Loaded Value="True"/> 414 418 <DefaultSyntaxHighlighter Value="None"/> … … 435 439 <EditorIndex Value="32"/> 436 440 <WindowIndex Value="0"/> 437 <TopLine Value=" 49"/>438 <CursorPos X=" 24" Y="60"/>439 <UsageCount Value="2 0"/>441 <TopLine Value="50"/> 442 <CursorPos X="9" Y="79"/> 443 <UsageCount Value="22"/> 440 444 <Loaded Value="True"/> 441 445 </Unit42> … … 484 488 <Unit48> 485 489 <Filename Value="../../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/classes/classesh.inc"/> 486 <EditorIndex Value="10"/>487 490 <WindowIndex Value="0"/> 488 491 <TopLine Value="871"/> 489 492 <CursorPos X="35" Y="884"/> 490 493 <UsageCount Value="16"/> 491 < Loaded Value="True"/>494 <DefaultSyntaxHighlighter Value="Delphi"/> 492 495 </Unit48> 493 496 <Unit49> 494 497 <Filename Value="../../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/classes/lists.inc"/> 495 <EditorIndex Value="12"/>496 498 <WindowIndex Value="0"/> 497 499 <TopLine Value="694"/> 498 500 <CursorPos X="12" Y="696"/> 499 501 <UsageCount Value="16"/> 500 < Loaded Value="True"/>502 <DefaultSyntaxHighlighter Value="Delphi"/> 501 503 </Unit49> 502 504 <Unit50> 503 505 <Filename Value="../Generic/SetInterface.tpl"/> 504 <EditorIndex Value=" 2"/>506 <EditorIndex Value="5"/> 505 507 <WindowIndex Value="0"/> 506 508 <TopLine Value="1"/> 507 509 <CursorPos X="1" Y="14"/> 508 <UsageCount Value="1 5"/>510 <UsageCount Value="17"/> 509 511 <Loaded Value="True"/> 510 512 <DefaultSyntaxHighlighter Value="None"/> … … 513 515 <Filename Value="../Specialized/SetChar.pas"/> 514 516 <UnitName Value="SetChar"/> 515 <EditorIndex Value=" 3"/>517 <EditorIndex Value="6"/> 516 518 <WindowIndex Value="0"/> 517 519 <TopLine Value="1"/> 518 520 <CursorPos X="1" Y="25"/> 519 <UsageCount Value="1 5"/>521 <UsageCount Value="17"/> 520 522 <Loaded Value="True"/> 521 523 </Unit51> 522 524 <Unit52> 523 525 <Filename Value="../Generic/SetImplementation.tpl"/> 524 <EditorIndex Value=" 1"/>526 <EditorIndex Value="4"/> 525 527 <WindowIndex Value="0"/> 526 528 <TopLine Value="1"/> 527 529 <CursorPos X="27" Y="15"/> 528 <UsageCount Value="1 5"/>530 <UsageCount Value="17"/> 529 531 <Loaded Value="True"/> 530 532 <DefaultSyntaxHighlighter Value="None"/> … … 532 534 <Unit53> 533 535 <Filename Value="../Generic/RangeInterface.tpl"/> 534 <EditorIndex Value=" 5"/>536 <EditorIndex Value="8"/> 535 537 <WindowIndex Value="0"/> 536 538 <TopLine Value="1"/> 537 539 <CursorPos X="23" Y="10"/> 538 <UsageCount Value="1 5"/>540 <UsageCount Value="17"/> 539 541 <Loaded Value="True"/> 540 542 <DefaultSyntaxHighlighter Value="None"/> … … 543 545 <Filename Value="../Specialized/RangeDateTime.pas"/> 544 546 <UnitName Value="RangeDateTime"/> 545 <EditorIndex Value=" 6"/>547 <EditorIndex Value="9"/> 546 548 <WindowIndex Value="0"/> 547 549 <TopLine Value="1"/> 548 550 <CursorPos X="14" Y="15"/> 549 <UsageCount Value="1 5"/>551 <UsageCount Value="17"/> 550 552 <Loaded Value="True"/> 551 553 </Unit54> 552 554 <Unit55> 553 555 <Filename Value="../../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/inc/systemh.inc"/> 554 <EditorIndex Value="9"/>555 556 <WindowIndex Value="0"/> 556 557 <TopLine Value="520"/> 557 558 <CursorPos X="11" Y="533"/> 558 559 <UsageCount Value="15"/> 559 < Loaded Value="True"/>560 <DefaultSyntaxHighlighter Value="Delphi"/> 560 561 </Unit55> 561 562 <Unit56> 562 563 <Filename Value="../Generic/RangeImplementation.tpl"/> 563 <EditorIndex Value=" 7"/>564 <EditorIndex Value="10"/> 564 565 <WindowIndex Value="0"/> 565 566 <TopLine Value="1"/> 566 567 <CursorPos X="14" Y="18"/> 567 <UsageCount Value="1 5"/>568 <UsageCount Value="17"/> 568 569 <Loaded Value="True"/> 569 570 <DefaultSyntaxHighlighter Value="None"/> … … 572 573 <Filename Value="../Specialized/ListVariant.pas"/> 573 574 <UnitName Value="ListVariant"/> 574 <EditorIndex Value=" 4"/>575 <EditorIndex Value="7"/> 575 576 <WindowIndex Value="0"/> 576 577 <TopLine Value="2"/> 577 578 <CursorPos X="30" Y="8"/> 578 <UsageCount Value="1 5"/>579 <UsageCount Value="17"/> 579 580 <Loaded Value="True"/> 580 581 </Unit57> 581 582 <Unit58> 582 583 <Filename Value="../ReadMe.txt"/> 583 <EditorIndex Value="3 6"/>584 <EditorIndex Value="34"/> 584 585 <WindowIndex Value="0"/> 585 586 <TopLine Value="1"/> 586 587 <CursorPos X="24" Y="7"/> 587 <UsageCount Value="1 4"/>588 <UsageCount Value="16"/> 588 589 <Loaded Value="True"/> 589 590 <DefaultSyntaxHighlighter Value="None"/> … … 592 593 <Filename Value="../Specialized/ListByte.pas"/> 593 594 <UnitName Value="ListByte"/> 594 <EditorIndex Value="1 5"/>595 <EditorIndex Value="14"/> 595 596 <WindowIndex Value="0"/> 596 597 <TopLine Value="1"/> 597 598 <CursorPos X="19" Y="15"/> 598 <UsageCount Value="1 4"/>599 <UsageCount Value="16"/> 599 600 <Loaded Value="True"/> 600 601 </Unit59> 601 602 <Unit60> 602 603 <Filename Value="../../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/sysutils/sysstrh.inc"/> 603 <EditorIndex Value="34"/>604 604 <WindowIndex Value="0"/> 605 605 <TopLine Value="70"/> 606 606 <CursorPos X="10" Y="84"/> 607 607 <UsageCount Value="10"/> 608 < Loaded Value="True"/>608 <DefaultSyntaxHighlighter Value="Delphi"/> 609 609 </Unit60> 610 610 <Unit61> 611 611 <Filename Value="../../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/sysutils/sysstr.inc"/> 612 <EditorIndex Value="35"/>613 612 <WindowIndex Value="0"/> 614 613 <TopLine Value="162"/> 615 614 <CursorPos X="3" Y="168"/> 616 615 <UsageCount Value="10"/> 617 < Loaded Value="True"/>616 <DefaultSyntaxHighlighter Value="Delphi"/> 618 617 </Unit61> 619 618 <Unit62> 620 619 <Filename Value="../../../../../Programy/Lazarus/fpc/2.4.3/source/rtl/objpas/classes/streams.inc"/> 621 <EditorIndex Value="11"/>622 620 <WindowIndex Value="0"/> 623 621 <TopLine Value="518"/> 624 622 <CursorPos X="3" Y="521"/> 625 623 <UsageCount Value="10"/> 626 < Loaded Value="True"/>624 <DefaultSyntaxHighlighter Value="Delphi"/> 627 625 </Unit62> 628 626 <Unit63> … … 632 630 <CursorPos X="25" Y="341"/> 633 631 <UsageCount Value="10"/> 632 <DefaultSyntaxHighlighter Value="Delphi"/> 634 633 </Unit63> 635 634 <Unit64> … … 639 638 <CursorPos X="11" Y="1549"/> 640 639 <UsageCount Value="10"/> 640 <DefaultSyntaxHighlighter Value="Delphi"/> 641 641 </Unit64> 642 642 <Unit65> … … 646 646 <CursorPos X="3" Y="295"/> 647 647 <UsageCount Value="10"/> 648 <DefaultSyntaxHighlighter Value="Delphi"/> 648 649 </Unit65> 650 <Unit66> 651 <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/cregist.inc"/> 652 <WindowIndex Value="0"/> 653 <TopLine Value="168"/> 654 <CursorPos X="3" Y="174"/> 655 <UsageCount Value="10"/> 656 <DefaultSyntaxHighlighter Value="Delphi"/> 657 </Unit66> 658 <Unit67> 659 <Filename Value="/usr/share/fpcsrc/packages/fcl-base/src/contnrs.pp"/> 660 <UnitName Value="contnrs"/> 661 <EditorIndex Value="1"/> 662 <WindowIndex Value="0"/> 663 <TopLine Value="60"/> 664 <CursorPos X="26" Y="72"/> 665 <UsageCount Value="12"/> 666 <Loaded Value="True"/> 667 <DefaultSyntaxHighlighter Value="Delphi"/> 668 </Unit67> 669 <Unit68> 670 <Filename Value="/usr/share/fpcsrc/rtl/inc/objpash.inc"/> 671 <EditorIndex Value="16"/> 672 <WindowIndex Value="0"/> 673 <TopLine Value="160"/> 674 <CursorPos X="22" Y="177"/> 675 <UsageCount Value="10"/> 676 <Loaded Value="True"/> 677 <DefaultSyntaxHighlighter Value="Delphi"/> 678 </Unit68> 649 679 </Units> 650 <JumpHistory Count="30" HistoryIndex="2 8">680 <JumpHistory Count="30" HistoryIndex="29"> 651 681 <Position1> 652 <Filename Value="../ Generic/RangeInterface.tpl"/>653 <Caret Line=" 7" Column="45" TopLine="1"/>682 <Filename Value="../Specialized/ListObject.pas"/> 683 <Caret Line="25" Column="24" TopLine="18"/> 654 684 </Position1> 655 685 <Position2> 656 <Filename Value=" ../Generic/RangeInterface.tpl"/>657 <Caret Line=" 10" Column="43" TopLine="1"/>686 <Filename Value="/usr/share/fpcsrc/packages/fcl-base/src/contnrs.pp"/> 687 <Caret Line="72" Column="26" TopLine="60"/> 658 688 </Position2> 659 689 <Position3> 660 <Filename Value=" ../Generic/RangeImplementation.tpl"/>661 <Caret Line="5 " Column="21" TopLine="1"/>690 <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/lists.inc"/> 691 <Caret Line="585" Column="9" TopLine="580"/> 662 692 </Position3> 663 693 <Position4> 664 694 <Filename Value="../Generic/ListImplementation.tpl"/> 665 <Caret Line=" 113" Column="3" TopLine="111"/>695 <Caret Line="345" Column="5" TopLine="342"/> 666 696 </Position4> 667 697 <Position5> 668 698 <Filename Value="../Generic/ListInterface.tpl"/> 669 <Caret Line=" 29" Column="30" TopLine="4"/>699 <Caret Line="55" Column="60" TopLine="27"/> 670 700 </Position5> 671 701 <Position6> 672 <Filename Value="../ Generic/ListInterface.tpl"/>673 <Caret Line=" 30" Column="23" TopLine="3"/>702 <Filename Value="../Specialized/ListObject.pas"/> 703 <Caret Line="54" Column="28" TopLine="26"/> 674 704 </Position6> 675 705 <Position7> 676 <Filename Value="../ Generic/ListImplementation.tpl"/>677 <Caret Line="2 72" Column="11" TopLine="266"/>706 <Filename Value="../Specialized/ListObject.pas"/> 707 <Caret Line="26" Column="20" TopLine="9"/> 678 708 </Position7> 679 709 <Position8> 680 <Filename Value="../ Generic/ListImplementation.tpl"/>681 <Caret Line=" 280" Column="13" TopLine="277"/>710 <Filename Value="../Specialized/ListObject.pas"/> 711 <Caret Line="19" Column="27" TopLine="9"/> 682 712 </Position8> 683 713 <Position9> 684 <Filename Value=" ../Generic/ListImplementation.tpl"/>685 <Caret Line=" 87" Column="10" TopLine="78"/>714 <Filename Value="Demo.lpr"/> 715 <Caret Line="11" Column="10" TopLine="1"/> 686 716 </Position9> 687 717 <Position10> 688 <Filename Value=" ../Generic/ListInterface.tpl"/>689 <Caret Line=" 22" Column="59" TopLine="8"/>718 <Filename Value="Demo.lpr"/> 719 <Caret Line="10" Column="38" TopLine="1"/> 690 720 </Position10> 691 721 <Position11> 692 <Filename Value=" ../Specialized/ListByte.pas"/>693 <Caret Line="1 1" Column="23" TopLine="1"/>722 <Filename Value="Demo.lpr"/> 723 <Caret Line="15" Column="1" TopLine="1"/> 694 724 </Position11> 695 725 <Position12> 696 <Filename Value=" ../Specialized/ListByte.pas"/>697 <Caret Line="1 3" Column="35" TopLine="1"/>726 <Filename Value="Demo.lpr"/> 727 <Caret Line="10" Column="20" TopLine="1"/> 698 728 </Position12> 699 729 <Position13> 700 <Filename Value=" ../Generic/ListImplementation.tpl"/>701 <Caret Line=" 251" Column="9" TopLine="247"/>730 <Filename Value="Demo.lpr"/> 731 <Caret Line="16" Column="3" TopLine="1"/> 702 732 </Position13> 703 733 <Position14> 704 <Filename Value=" ../Generic/ListImplementation.tpl"/>705 <Caret Line=" 259" Column="30" TopLine="259"/>734 <Filename Value="UMainForm.pas"/> 735 <Caret Line="87" Column="15" TopLine="77"/> 706 736 </Position14> 707 737 <Position15> 708 <Filename Value="../ Generic/ListImplementation.tpl"/>709 <Caret Line=" 265" Column="21" TopLine="259"/>738 <Filename Value="../Specialized/ListObject.pas"/> 739 <Caret Line="56" Column="3" TopLine="28"/> 710 740 </Position15> 711 741 <Position16> 712 <Filename Value="../ Generic/ListInterface.tpl"/>713 <Caret Line=" 33" Column="34" TopLine="28"/>742 <Filename Value="../Specialized/ListObject.pas"/> 743 <Caret Line="49" Column="14" TopLine="28"/> 714 744 </Position16> 715 745 <Position17> 716 <Filename Value="../ Generic/ListImplementation.tpl"/>717 <Caret Line=" 4" Column="34" TopLine="1"/>746 <Filename Value="../Specialized/ListObject.pas"/> 747 <Caret Line="56" Column="12" TopLine="28"/> 718 748 </Position17> 719 749 <Position18> 720 <Filename Value="../Generic/ListI mplementation.tpl"/>721 <Caret Line=" 202" Column="28" TopLine="194"/>750 <Filename Value="../Generic/ListInterface.tpl"/> 751 <Caret Line="54" Column="46" TopLine="26"/> 722 752 </Position18> 723 753 <Position19> 724 <Filename Value=" ../Generic/ListImplementation.tpl"/>725 <Caret Line=" 4" Column="73" TopLine="1"/>754 <Filename Value="Demo.lpr"/> 755 <Caret Line="8" Column="26" TopLine="1"/> 726 756 </Position19> 727 757 <Position20> 728 <Filename Value="../ Generic/ListImplementation.tpl"/>729 <Caret Line=" 1" Column="23" TopLine="1"/>758 <Filename Value="../Specialized/ListObject.pas"/> 759 <Caret Line="51" Column="11" TopLine="28"/> 730 760 </Position20> 731 761 <Position21> 732 <Filename Value="../ Generic/ListImplementation.tpl"/>733 <Caret Line=" 115" Column="17" TopLine="101"/>762 <Filename Value="../Specialized/ListObject.pas"/> 763 <Caret Line="56" Column="1" TopLine="28"/> 734 764 </Position21> 735 765 <Position22> 736 <Filename Value=" ../Generic/ListImplementation.tpl"/>737 <Caret Line=" 210" Column="20" TopLine="196"/>766 <Filename Value="UMainForm.pas"/> 767 <Caret Line="94" Column="9" TopLine="77"/> 738 768 </Position22> 739 769 <Position23> 740 <Filename Value=" ../Generic/ListImplementation.tpl"/>741 <Caret Line=" 5" Column="59" TopLine="1"/>770 <Filename Value="UMainForm.pas"/> 771 <Caret Line="96" Column="7" TopLine="77"/> 742 772 </Position23> 743 773 <Position24> 744 <Filename Value="../Specialized/List Byte.pas"/>745 <Caret Line="2 0" Column="16" TopLine="1"/>774 <Filename Value="../Specialized/ListObject.pas"/> 775 <Caret Line="25" Column="30" TopLine="11"/> 746 776 </Position24> 747 777 <Position25> 748 <Filename Value="../ Generic/ListImplementation.tpl"/>749 <Caret Line=" 11" Column="18" TopLine="1"/>778 <Filename Value="../Specialized/ListObject.pas"/> 779 <Caret Line="49" Column="45" TopLine="33"/> 750 780 </Position25> 751 781 <Position26> 752 <Filename Value=" ../Generic/ListInterface.tpl"/>753 <Caret Line=" 40" Column="37" TopLine="32"/>782 <Filename Value="UMainForm.pas"/> 783 <Caret Line="299" Column="17" TopLine="272"/> 754 784 </Position26> 755 785 <Position27> 756 <Filename Value=" ../Generic/ListInterface.tpl"/>757 <Caret Line=" 51" Column="61" TopLine="26"/>786 <Filename Value="UMainForm.pas"/> 787 <Caret Line="247" Column="19" TopLine="238"/> 758 788 </Position27> 759 789 <Position28> 760 <Filename Value=" ../Generic/ListImplementation.tpl"/>761 <Caret Line=" 151" Column="60" TopLine="139"/>790 <Filename Value="UMainForm.pas"/> 791 <Caret Line="273" Column="62" TopLine="257"/> 762 792 </Position28> 763 793 <Position29> 764 <Filename Value=" ../Generic/ListImplementation.tpl"/>765 <Caret Line=" 142" Column="39" TopLine="128"/>794 <Filename Value="UMainForm.pas"/> 795 <Caret Line="319" Column="32" TopLine="292"/> 766 796 </Position29> 767 797 <Position30> 768 <Filename Value=" ../Generic/ListInterface.tpl"/>769 <Caret Line=" 19" Column="38" TopLine="1"/>798 <Filename Value="UMainForm.pas"/> 799 <Caret Line="258" Column="45" TopLine="241"/> 770 800 </Position30> 771 801 </JumpHistory> … … 797 827 </CodeGeneration> 798 828 <Linking> 829 <Debugging> 830 <GenerateDebugInfo Value="True"/> 831 <UseHeaptrc Value="True"/> 832 </Debugging> 799 833 <Options> 800 834 <Win32> … … 804 838 </Linking> 805 839 <Other> 840 <CompilerMessages> 841 <UseMsgFile Value="True"/> 842 </CompilerMessages> 806 843 <CompilerPath Value="$(CompPath)"/> 807 844 </Other> 808 845 </CompilerOptions> 809 846 <Debugging> 810 <BreakPoints Count="1">811 <Item1>812 <Source Value="../Specialized/ListChar.pas"/>813 <Line Value="78"/>814 </Item1>815 </BreakPoints>816 847 <Exceptions Count="3"> 817 848 <Item1> -
Generics/TemplateGenerics/Demo/Demo.lpr
r70 r78 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UMainForm, TemplateGenerics 11 { you can add units after this }; 10 Forms, SysUtils, UMainForm, TemplateGenerics; 12 11 13 12 {$R *.res} 14 13 14 const 15 HeapTraceLogFileName = 'heaptrclog.trc'; 15 16 begin 17 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLogFileName); 18 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLogFileName); 16 19 Application.Initialize; 17 20 Application.CreateForm(TMainForm, MainForm); -
Generics/TemplateGenerics/Demo/UMainForm.lfm
r76 r78 4 4 Top = 129 5 5 Width = 478 6 ActiveControl = ButtonIntegerList 6 7 Caption = 'Template generics demo' 7 8 ClientHeight = 397 … … 74 75 TabOrder = 6 75 76 end 77 object ButtonListObject: TButton 78 Left = 7 79 Height = 25 80 Top = 163 81 Width = 113 82 Caption = 'TListObject' 83 OnClick = ButtonListObjectClick 84 TabOrder = 7 85 end 76 86 end -
Generics/TemplateGenerics/Demo/UMainForm.pas
r76 r78 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 9 ComCtrls, ListInteger, ListString, DictionaryString, QueueInteger, ListChar, 10 ListPointer, DateUtils, ListVariant ;10 ListPointer, DateUtils, ListVariant, Contnrs, ListObject; 11 11 12 12 type … … 15 15 16 16 TMainForm = class(TForm) 17 ButtonListObject: TButton; 17 18 ButtonBenchmark: TButton; 18 19 ButtonCharList: TButton; … … 26 27 procedure ButtonDictionaryStringClick(Sender: TObject); 27 28 procedure ButtonIntegerListClick(Sender: TObject); 29 procedure ButtonListObjectClick(Sender: TObject); 28 30 procedure ButtonQueueIntegerClick(Sender: TObject); 29 31 procedure ButtonStringListClick(Sender: TObject); … … 71 73 MoveItems(3, 2, 3); 72 74 WriteLn('Implode: ' + Implode(',', IntToStr)); 75 finally 76 Free; 77 end; 78 end; 79 80 function ObjectToStr(Obj: TObject): string; 81 begin 82 Result := Obj.ClassName; 83 end; 84 85 procedure TMainForm.ButtonListObjectClick(Sender: TObject); 86 var 87 List: TListObject; 88 I: Integer; 89 begin 90 MemoOutput.Clear; 91 WriteLn('TListObject test'); 92 List := TListObject.Create; 93 with List do try 94 AddArray([TObject.Create, TObject.Create, TObject.Create, TObject.Create]); 95 WriteLn('Implode: ' + Implode(',', ObjectToStr)); 96 Clear; 97 for I := 0 to 10 do Add(TObject.Create); 98 WriteLn('Implode: ' + Implode(',', ObjectToStr)); 99 WriteLn('Count: ' + IntToStr(Count)); 100 WriteLn('Implode: ' + Implode(',', ObjectToStr)); 101 WriteLn('Reverse'); 102 Reverse; 103 WriteLn('Implode: ' + Implode(',', ObjectToStr)); 104 MoveItems(3, 2, 3); 105 WriteLn('Implode: ' + Implode(',', ObjectToStr)); 73 106 finally 74 107 Free; … … 207 240 List.Clear; 208 241 242 for I := 0 to 1000000 do 243 List.Add(1); 244 StartTime := Now; 245 I := 0; 246 repeat 247 List.Exchange(300000, 700000); 248 Inc(I); 249 until (Now - StartTime) > OneSecond; 250 WriteLn('Exchange: ' + IntToStr(I) + ' ops/sec'); 251 List.Clear; 252 253 for I := 0 to 1000000 do 254 List.Add(1); 255 StartTime := Now; 256 I := 0; 257 repeat 258 List.IndexOf(Pointer(I mod List.Count)); 259 Inc(I); 260 until (Now - StartTime) > OneSecond; 261 WriteLn('IndexOf: ' + IntToStr(I) + ' ops/sec'); 262 List.Clear; 209 263 finally 210 264 List.Free; … … 238 292 WriteLn('Delete: ' + IntToStr(I) + ' ops/sec'); 239 293 240 241 294 for I := 0 to 1000000 do 295 List2.Add(1); 242 296 StartTime := Now; 243 297 I := 0; … … 247 301 until (Now - StartTime) > OneSecond; 248 302 WriteLn('Move: ' + IntToStr(I) + ' ops/sec'); 303 304 for I := 0 to 1000000 do 305 List2.Add(1); 306 StartTime := Now; 307 I := 0; 308 repeat 309 List2.Exchange(300000, 700000); 310 Inc(I); 311 until (Now - StartTime) > OneSecond; 312 WriteLn('Exchange: ' + IntToStr(I) + ' ops/sec'); 313 314 for I := 0 to 1000000 do 315 List2.Add(1); 316 StartTime := Now; 317 I := 0; 318 repeat 319 List2.IndexOf(Pointer(I mod List.Count)); 320 Inc(I); 321 until (Now - StartTime) > OneSecond; 322 WriteLn('IndexOf: ' + IntToStr(I) + ' ops/sec'); 249 323 250 324 finally -
Generics/TemplateGenerics/Generic/ListImplementation.tpl
r77 r78 17 17 begin 18 18 Result := FItems[Index]; 19 end;20 21 function TGList.GetCount: TListIndex;22 begin23 Result := FCount;24 19 end; 25 20 … … 89 84 end; 90 85 86 procedure TGList.Contract; 87 begin 88 if (Capacity > 256) and (FCount < Capacity shr 2) then 89 begin 90 Capacity := Capacity shr 1; 91 end; 92 end; 93 91 94 function TGList.Extract(Item: TListItem): TListItem; 92 95 var … … 344 347 FCount := FCount - 1; 345 348 System.Move(FItems[Index + 1], FItems[Index], (FCount - Index) * SizeOf(TListItem)); 346 // Shrink the list if appropriate 347 if (Capacity > 256) and (FCount < Capacity shr 2) then 348 begin 349 Capacity := Capacity shr 1; 350 end; 349 Contract; 351 350 end; 352 351 -
Generics/TemplateGenerics/Generic/ListInterface.tpl
r77 r78 14 14 FCount: TListIndex; 15 15 function Get(Index: TListIndex): TListItem; 16 function GetCount: TListIndex;17 16 function GetCapacity: TListIndex; 18 17 procedure SetCapacity(const AValue: TListIndex); 19 procedure Put(Index: TListIndex; const AValue: TListItem); 18 procedure Put(Index: TListIndex; const AValue: TListItem); virtual; 20 19 procedure SetCount(const AValue: TListIndex); 21 20 procedure QuickSort(L, R : TListIndex; Compare: TGListSortCompare); … … 23 22 // All items 24 23 procedure Reverse; 25 procedure Clear; 24 procedure Clear; virtual; 26 25 procedure Expand; 26 procedure Contract; 27 27 procedure Sort(Compare: TGListSortCompare); 28 28 function Implode(Separator: string; Converter: TGListStringConverter): string; … … 34 34 // One item 35 35 function Add(Item: TListItem): TListIndex; 36 procedure Delete(Index: TListIndex); 36 procedure Delete(Index: TListIndex); virtual; 37 37 function Extract(Item: TListItem): TListItem; 38 38 procedure Exchange(Index1, Index2: TListIndex); … … 51 51 function IndexOfList(List: TGList; Start: TListIndex = 0): TListIndex; 52 52 // Other 53 property Count: TListIndex read GetCount write SetCount;53 property Count: TListIndex read FCount write SetCount; 54 54 property Capacity: TListIndex read GetCapacity write SetCapacity; 55 55 // Array -
Generics/TemplateGenerics/Specialized/ListObject.pas
r71 r78 15 15 type 16 16 17 { T ObjectList }17 { TListObject } 18 18 19 TObjectList = class(TGList) 20 //OwnObjects: Boolean; 19 TListObject = class(TGList) 20 private 21 procedure Put(Index: TListIndex; const AValue: TListItem); override; 22 public 23 OwnObjects: Boolean; 24 procedure Delete(Index: TListIndex); override; 25 procedure Clear; override; 26 constructor Create; 21 27 destructor Destroy; override; 22 28 end; … … 29 35 { TObjectList } 30 36 31 destructor TObjectList.Destroy;37 procedure TListObject.Put(Index: TListIndex; const AValue: TListItem); 32 38 begin 39 if OwnObjects then FItems[Index].Free; 40 inherited Put(Index, AValue); 41 end; 42 43 procedure TListObject.Delete(Index: TListIndex); 44 begin 45 if OwnObjects then FItems[Index].Free; 46 inherited Delete(Index); 47 end; 48 49 procedure TListObject.Clear; 50 var 51 I: TListIndex; 52 begin 53 if OwnObjects then begin 54 I := 0; 55 while I < Count do begin 56 FItems[I].Free; 57 I := I + 1; 58 end; 59 end; 60 inherited Clear; 61 end; 62 63 constructor TListObject.Create; 64 begin 65 inherited; 66 OwnObjects := True; 67 end; 68 69 destructor TListObject.Destroy; 70 begin 71 Clear; 33 72 inherited Destroy; 34 73 end;
Note:
See TracChangeset
for help on using the changeset viewer.