Changeset 90 for trunk/Packages
- Timestamp:
- Sep 7, 2012, 6:45:53 AM (12 years ago)
- Location:
- trunk/Packages
- Files:
-
- 5 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/ModularSystem
-
Property svn:ignore
set to
lib
-
Property svn:ignore
set to
-
trunk/Packages/TemplateGenerics/Demo
-
Property svn:ignore
set to
heaptrclog.trc
-
Property svn:ignore
set to
-
trunk/Packages/TemplateGenerics/Demo/Demo.lpi
r84 r90 33 33 <Item1> 34 34 <PackageName Value="TemplateGenerics"/> 35 <DefaultFilename Value="../TemplateGenerics.lpk" Prefer="True"/> 35 36 </Item1> 36 37 <Item2> … … 38 39 </Item2> 39 40 </RequiredPackages> 40 <Units Count=" 66">41 <Units Count="75"> 41 42 <Unit0> 42 43 <Filename Value="Demo.lpr"/> … … 57 58 <EditorIndex Value="0"/> 58 59 <WindowIndex Value="0"/> 59 <TopLine Value=" 71"/>60 <CursorPos X="2 2" Y="90"/>60 <TopLine Value="640"/> 61 <CursorPos X="20" Y="653"/> 61 62 <UsageCount Value="233"/> 62 63 <Bookmarks Count="1"> 63 <Item0 X="65" Y="2 33" ID="2"/>64 <Item0 X="65" Y="275" ID="2"/> 64 65 </Bookmarks> 65 66 <Loaded Value="True"/> … … 73 74 <TopLine Value="1"/> 74 75 <CursorPos X="1" Y="11"/> 75 <UsageCount Value=" 4"/>76 <UsageCount Value="3"/> 76 77 </Unit2> 77 78 <Unit3> 78 79 <Filename Value="../Specialized/SpecializedList.pas"/> 79 80 <UnitName Value="SpecializedList"/> 80 <EditorIndex Value=" 1"/>81 <EditorIndex Value="3"/> 81 82 <WindowIndex Value="0"/> 82 83 <TopLine Value="47"/> 83 84 <CursorPos X="20" Y="60"/> 84 <UsageCount Value="1 0"/>85 <UsageCount Value="15"/> 85 86 <Loaded Value="True"/> 86 87 </Unit3> … … 91 92 <TopLine Value="33"/> 92 93 <CursorPos X="12" Y="56"/> 93 <UsageCount Value=" 4"/>94 <UsageCount Value="3"/> 94 95 </Unit4> 95 96 <Unit5> … … 99 100 <TopLine Value="1"/> 100 101 <CursorPos X="23" Y="21"/> 101 <UsageCount Value=" 4"/>102 <UsageCount Value="3"/> 102 103 </Unit5> 103 104 <Unit6> … … 107 108 <TopLine Value="1"/> 108 109 <CursorPos X="23" Y="24"/> 109 <UsageCount Value=" 4"/>110 <UsageCount Value="3"/> 110 111 </Unit6> 111 112 <Unit7> … … 115 116 <TopLine Value="1"/> 116 117 <CursorPos X="23" Y="13"/> 117 <UsageCount Value=" 4"/>118 <UsageCount Value="3"/> 118 119 </Unit7> 119 120 <Unit8> … … 123 124 <TopLine Value="1"/> 124 125 <CursorPos X="23" Y="24"/> 125 <UsageCount Value=" 4"/>126 <UsageCount Value="3"/> 126 127 </Unit8> 127 128 <Unit9> … … 131 132 <TopLine Value="1"/> 132 133 <CursorPos X="31" Y="13"/> 133 <UsageCount Value=" 4"/>134 <UsageCount Value="3"/> 134 135 </Unit9> 135 136 <Unit10> … … 139 140 <TopLine Value="1"/> 140 141 <CursorPos X="29" Y="17"/> 141 <UsageCount Value=" 4"/>142 <UsageCount Value="3"/> 142 143 </Unit10> 143 144 <Unit11> … … 146 147 <TopLine Value="1"/> 147 148 <CursorPos X="1" Y="4"/> 148 <UsageCount Value=" 4"/>149 <UsageCount Value="3"/> 149 150 <DefaultSyntaxHighlighter Value="None"/> 150 151 </Unit11> … … 154 155 <TopLine Value="1"/> 155 156 <CursorPos X="21" Y="6"/> 156 <UsageCount Value=" 4"/>157 <UsageCount Value="3"/> 157 158 <DefaultSyntaxHighlighter Value="None"/> 158 159 </Unit12> … … 162 163 <TopLine Value="1"/> 163 164 <CursorPos X="1" Y="1"/> 164 <UsageCount Value=" 4"/>165 <UsageCount Value="3"/> 165 166 <DefaultSyntaxHighlighter Value="None"/> 166 167 </Unit13> … … 170 171 <TopLine Value="1"/> 171 172 <CursorPos X="25" Y="13"/> 172 <UsageCount Value=" 5"/>173 <UsageCount Value="4"/> 173 174 <DefaultSyntaxHighlighter Value="None"/> 174 175 </Unit14> … … 178 179 <TopLine Value="4"/> 179 180 <CursorPos X="3" Y="6"/> 180 <UsageCount Value=" 4"/>181 <UsageCount Value="3"/> 181 182 <DefaultSyntaxHighlighter Value="None"/> 182 183 </Unit15> … … 186 187 <TopLine Value="1"/> 187 188 <CursorPos X="14" Y="16"/> 188 <UsageCount Value=" 4"/>189 <UsageCount Value="3"/> 189 190 <DefaultSyntaxHighlighter Value="None"/> 190 191 </Unit16> … … 195 196 <TopLine Value="1"/> 196 197 <CursorPos X="32" Y="18"/> 197 <UsageCount Value=" 4"/>198 <UsageCount Value="3"/> 198 199 </Unit17> 199 200 <Unit18> … … 202 203 <TopLine Value="1"/> 203 204 <CursorPos X="20" Y="12"/> 204 <UsageCount Value=" 2"/>205 <UsageCount Value="1"/> 205 206 <DefaultSyntaxHighlighter Value="None"/> 206 207 </Unit18> … … 211 212 <TopLine Value="1"/> 212 213 <CursorPos X="1" Y="22"/> 213 <UsageCount Value=" 2"/>214 <UsageCount Value="1"/> 214 215 </Unit19> 215 216 <Unit20> … … 218 219 <TopLine Value="1"/> 219 220 <CursorPos X="1" Y="1"/> 220 <UsageCount Value=" 2"/>221 <UsageCount Value="1"/> 221 222 <DefaultSyntaxHighlighter Value="None"/> 222 223 </Unit20> … … 226 227 <TopLine Value="1"/> 227 228 <CursorPos X="1" Y="3"/> 228 <UsageCount Value=" 2"/>229 <UsageCount Value="1"/> 229 230 <DefaultSyntaxHighlighter Value="None"/> 230 231 </Unit21> … … 234 235 <TopLine Value="1"/> 235 236 <CursorPos X="1" Y="3"/> 236 <UsageCount Value=" 2"/>237 <UsageCount Value="1"/> 237 238 <DefaultSyntaxHighlighter Value="None"/> 238 239 </Unit22> … … 243 244 <TopLine Value="45"/> 244 245 <CursorPos X="9" Y="79"/> 245 <UsageCount Value="1 "/>246 <UsageCount Value="10"/> 246 247 </Unit23> 247 248 <Unit24> … … 250 251 <TopLine Value="1"/> 251 252 <CursorPos X="21" Y="4"/> 252 <UsageCount Value=" 6"/>253 <UsageCount Value="5"/> 253 254 <DefaultSyntaxHighlighter Value="None"/> 254 255 </Unit24> … … 259 260 <TopLine Value="1"/> 260 261 <CursorPos X="1" Y="25"/> 261 <UsageCount Value=" 6"/>262 <UsageCount Value="5"/> 262 263 </Unit25> 263 264 <Unit26> … … 266 267 <TopLine Value="1"/> 267 268 <CursorPos X="1" Y="3"/> 268 <UsageCount Value=" 6"/>269 <UsageCount Value="5"/> 269 270 <DefaultSyntaxHighlighter Value="None"/> 270 271 </Unit26> … … 274 275 <TopLine Value="1"/> 275 276 <CursorPos X="7" Y="4"/> 276 <UsageCount Value=" 6"/>277 <UsageCount Value="5"/> 277 278 <DefaultSyntaxHighlighter Value="None"/> 278 279 </Unit27> … … 283 284 <TopLine Value="1"/> 284 285 <CursorPos X="14" Y="15"/> 285 <UsageCount Value=" 6"/>286 <UsageCount Value="5"/> 286 287 </Unit28> 287 288 <Unit29> … … 290 291 <TopLine Value="1"/> 291 292 <CursorPos X="14" Y="18"/> 292 <UsageCount Value=" 6"/>293 <UsageCount Value="5"/> 293 294 <DefaultSyntaxHighlighter Value="None"/> 294 295 </Unit29> … … 299 300 <TopLine Value="2"/> 300 301 <CursorPos X="30" Y="8"/> 301 <UsageCount Value=" 6"/>302 <UsageCount Value="5"/> 302 303 </Unit30> 303 304 <Unit31> … … 307 308 <TopLine Value="13"/> 308 309 <CursorPos X="15" Y="12"/> 309 <UsageCount Value=" 8"/>310 <UsageCount Value="7"/> 310 311 <DefaultSyntaxHighlighter Value="Delphi"/> 311 312 </Unit31> 312 313 <Unit32> 313 314 <Filename Value="../Generic/GenericList.inc"/> 314 <IsVisibleTab Value="True"/> 315 <EditorIndex Value="2"/> 316 <WindowIndex Value="0"/> 317 <TopLine Value="359"/> 318 <CursorPos X="62" Y="376"/> 315 <EditorIndex Value="4"/> 316 <WindowIndex Value="0"/> 317 <TopLine Value="42"/> 318 <CursorPos X="15" Y="55"/> 319 319 <UsageCount Value="107"/> 320 320 <Loaded Value="True"/> … … 325 325 <TopLine Value="31"/> 326 326 <CursorPos X="44" Y="47"/> 327 <UsageCount Value="9 4"/>327 <UsageCount Value="93"/> 328 328 </Unit33> 329 329 <Unit34> … … 332 332 <TopLine Value="1"/> 333 333 <CursorPos X="36" Y="48"/> 334 <UsageCount Value="9 4"/>334 <UsageCount Value="93"/> 335 335 </Unit34> 336 336 <Unit35> … … 339 339 <TopLine Value="3"/> 340 340 <CursorPos X="1" Y="3"/> 341 <UsageCount Value="9 4"/>341 <UsageCount Value="93"/> 342 342 </Unit35> 343 343 <Unit36> … … 346 346 <TopLine Value="11"/> 347 347 <CursorPos X="42" Y="11"/> 348 <UsageCount Value="9 4"/>348 <UsageCount Value="93"/> 349 349 </Unit36> 350 350 <Unit37> … … 353 353 <TopLine Value="3"/> 354 354 <CursorPos X="1" Y="3"/> 355 <UsageCount Value="9 4"/>355 <UsageCount Value="93"/> 356 356 </Unit37> 357 357 <Unit38> … … 360 360 <TopLine Value="1"/> 361 361 <CursorPos X="22" Y="30"/> 362 <UsageCount Value="9 4"/>362 <UsageCount Value="93"/> 363 363 </Unit38> 364 364 <Unit39> … … 368 368 <TopLine Value="6"/> 369 369 <CursorPos X="56" Y="36"/> 370 <UsageCount Value="9 3"/>370 <UsageCount Value="92"/> 371 371 </Unit39> 372 372 <Unit40> … … 376 376 <TopLine Value="27"/> 377 377 <CursorPos X="50" Y="59"/> 378 <UsageCount Value="9 2"/>378 <UsageCount Value="91"/> 379 379 </Unit40> 380 380 <Unit41> … … 384 384 <TopLine Value="57"/> 385 385 <CursorPos X="48" Y="85"/> 386 <UsageCount Value="9 2"/>386 <UsageCount Value="91"/> 387 387 </Unit41> 388 388 <Unit42> … … 391 391 <TopLine Value="1"/> 392 392 <CursorPos X="33" Y="14"/> 393 <UsageCount Value="9 2"/>393 <UsageCount Value="91"/> 394 394 </Unit42> 395 395 <Unit43> … … 399 399 <TopLine Value="52"/> 400 400 <CursorPos X="1" Y="81"/> 401 <UsageCount Value="9 2"/>401 <UsageCount Value="91"/> 402 402 </Unit43> 403 403 <Unit44> … … 407 407 <TopLine Value="29"/> 408 408 <CursorPos X="1" Y="62"/> 409 <UsageCount Value="9 2"/>409 <UsageCount Value="91"/> 410 410 </Unit44> 411 411 <Unit45> … … 415 415 <TopLine Value="9"/> 416 416 <CursorPos X="60" Y="36"/> 417 <UsageCount Value="9 1"/>417 <UsageCount Value="90"/> 418 418 </Unit45> 419 419 <Unit46> 420 420 <Filename Value="../Generic/GenericMatrix.inc"/> 421 <EditorIndex Value="3"/>422 421 <WindowIndex Value="0"/> 423 422 <TopLine Value="9"/> 424 423 <CursorPos X="28" Y="23"/> 425 <UsageCount Value="103"/> 426 <Loaded Value="True"/> 424 <UsageCount Value="102"/> 427 425 </Unit46> 428 426 <Unit47> … … 432 430 <TopLine Value="2624"/> 433 431 <CursorPos X="37" Y="2636"/> 434 <UsageCount Value=" 90"/>432 <UsageCount Value="89"/> 435 433 <DefaultSyntaxHighlighter Value="Delphi"/> 436 434 </Unit47> … … 440 438 <TopLine Value="94"/> 441 439 <CursorPos X="1" Y="1"/> 442 <UsageCount Value=" 6"/>440 <UsageCount Value="5"/> 443 441 <DefaultSyntaxHighlighter Value="XML"/> 444 442 </Unit48> … … 448 446 <TopLine Value="199"/> 449 447 <CursorPos X="14" Y="213"/> 450 <UsageCount Value="2 8"/>448 <UsageCount Value="27"/> 451 449 <DefaultSyntaxHighlighter Value="Delphi"/> 452 450 </Unit49> … … 456 454 <TopLine Value="199"/> 457 455 <CursorPos X="3" Y="201"/> 458 <UsageCount Value="2 8"/>456 <UsageCount Value="27"/> 459 457 <DefaultSyntaxHighlighter Value="Delphi"/> 460 458 </Unit50> 461 459 <Unit51> 462 460 <Filename Value="../Generic/GenericListObject.inc"/> 463 <WindowIndex Value="0"/> 464 <TopLine Value="1"/> 465 <CursorPos X="21" Y="20"/> 466 <UsageCount Value="19"/> 461 <EditorIndex Value="5"/> 462 <WindowIndex Value="0"/> 463 <TopLine Value="11"/> 464 <CursorPos X="34" Y="24"/> 465 <UsageCount Value="21"/> 466 <Loaded Value="True"/> 467 467 </Unit51> 468 468 <Unit52> … … 472 472 <TopLine Value="1"/> 473 473 <CursorPos X="27" Y="26"/> 474 <UsageCount Value="2 8"/>474 <UsageCount Value="27"/> 475 475 <DefaultSyntaxHighlighter Value="Delphi"/> 476 476 </Unit52> … … 480 480 <TopLine Value="381"/> 481 481 <CursorPos X="3" Y="398"/> 482 <UsageCount Value="2 8"/>482 <UsageCount Value="27"/> 483 483 <DefaultSyntaxHighlighter Value="Delphi"/> 484 484 </Unit53> … … 488 488 <TopLine Value="475"/> 489 489 <CursorPos X="10" Y="503"/> 490 <UsageCount Value=" 7"/>490 <UsageCount Value="6"/> 491 491 <DefaultSyntaxHighlighter Value="Delphi"/> 492 492 </Unit54> … … 496 496 <TopLine Value="2270"/> 497 497 <CursorPos X="22" Y="2273"/> 498 <UsageCount Value="1 9"/>498 <UsageCount Value="18"/> 499 499 <DefaultSyntaxHighlighter Value="Delphi"/> 500 500 </Unit55> … … 502 502 <Filename Value="../Specialized/SpecializedMatrix.pas"/> 503 503 <UnitName Value="SpecializedMatrix"/> 504 <EditorIndex Value="4"/>505 504 <WindowIndex Value="0"/> 506 505 <TopLine Value="1"/> 507 506 <CursorPos X="25" Y="41"/> 508 507 <UsageCount Value="19"/> 509 <Loaded Value="True"/>510 508 </Unit56> 511 509 <Unit57> … … 514 512 <TopLine Value="1"/> 515 513 <CursorPos X="28" Y="10"/> 516 <UsageCount Value=" 9"/>514 <UsageCount Value="8"/> 517 515 <DefaultSyntaxHighlighter Value="None"/> 518 516 </Unit57> … … 522 520 <TopLine Value="38"/> 523 521 <CursorPos X="3" Y="50"/> 524 <UsageCount Value="1 1"/>522 <UsageCount Value="10"/> 525 523 <DefaultSyntaxHighlighter Value="Delphi"/> 526 524 </Unit58> … … 530 528 <TopLine Value="649"/> 531 529 <CursorPos X="38" Y="671"/> 532 <UsageCount Value=" 10"/>530 <UsageCount Value="9"/> 533 531 <DefaultSyntaxHighlighter Value="Delphi"/> 534 532 </Unit59> … … 538 536 <TopLine Value="1185"/> 539 537 <CursorPos X="22" Y="1196"/> 540 <UsageCount Value=" 10"/>538 <UsageCount Value="9"/> 541 539 <DefaultSyntaxHighlighter Value="Delphi"/> 542 540 </Unit60> … … 547 545 <TopLine Value="112"/> 548 546 <CursorPos X="3" Y="124"/> 549 <UsageCount Value=" 10"/>547 <UsageCount Value="9"/> 550 548 <DefaultSyntaxHighlighter Value="Delphi"/> 551 549 </Unit61> … … 555 553 <TopLine Value="71"/> 556 554 <CursorPos X="10" Y="84"/> 557 <UsageCount Value="10"/> 555 <UsageCount Value="9"/> 556 <DefaultSyntaxHighlighter Value="Delphi"/> 558 557 </Unit62> 559 558 <Unit63> … … 562 561 <TopLine Value="148"/> 563 562 <CursorPos X="11" Y="169"/> 564 <UsageCount Value="10"/> 563 <UsageCount Value="9"/> 564 <DefaultSyntaxHighlighter Value="Delphi"/> 565 565 </Unit63> 566 566 <Unit64> … … 569 569 <TopLine Value="511"/> 570 570 <CursorPos X="11" Y="524"/> 571 <UsageCount Value="10"/> 571 <UsageCount Value="9"/> 572 <DefaultSyntaxHighlighter Value="Delphi"/> 572 573 </Unit64> 573 574 <Unit65> … … 576 577 <TopLine Value="411"/> 577 578 <CursorPos X="10" Y="424"/> 579 <UsageCount Value="9"/> 580 <DefaultSyntaxHighlighter Value="Delphi"/> 581 </Unit65> 582 <Unit66> 583 <Filename Value="../Specialized/SpecializedStream.pas"/> 584 <UnitName Value="SpecializedStream"/> 585 <EditorIndex Value="8"/> 586 <WindowIndex Value="0"/> 587 <TopLine Value="106"/> 588 <CursorPos X="48" Y="107"/> 589 <UsageCount Value="15"/> 590 <Loaded Value="True"/> 591 </Unit66> 592 <Unit67> 593 <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/lcl/lclclasses.pp"/> 594 <UnitName Value="LCLClasses"/> 595 <WindowIndex Value="0"/> 596 <TopLine Value="25"/> 597 <CursorPos X="32" Y="40"/> 598 <UsageCount Value="9"/> 599 </Unit67> 600 <Unit68> 601 <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/lcl/controls.pp"/> 602 <UnitName Value="Controls"/> 603 <WindowIndex Value="0"/> 604 <TopLine Value="1"/> 605 <CursorPos X="39" Y="11"/> 606 <UsageCount Value="9"/> 607 </Unit68> 608 <Unit69> 609 <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/inc/objpash.inc"/> 610 <WindowIndex Value="0"/> 611 <TopLine Value="179"/> 612 <CursorPos X="23" Y="192"/> 578 613 <UsageCount Value="10"/> 579 </Unit65> 614 </Unit69> 615 <Unit70> 616 <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/inc/objpas.inc"/> 617 <WindowIndex Value="0"/> 618 <TopLine Value="265"/> 619 <CursorPos X="9" Y="267"/> 620 <UsageCount Value="10"/> 621 </Unit70> 622 <Unit71> 623 <Filename Value="../Generic/GenericStream.inc"/> 624 <IsVisibleTab Value="True"/> 625 <EditorIndex Value="7"/> 626 <WindowIndex Value="0"/> 627 <TopLine Value="40"/> 628 <CursorPos X="18" Y="20"/> 629 <UsageCount Value="15"/> 630 <Loaded Value="True"/> 631 </Unit71> 632 <Unit72> 633 <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/objpas/classes/classesh.inc"/> 634 <EditorIndex Value="1"/> 635 <WindowIndex Value="0"/> 636 <TopLine Value="891"/> 637 <CursorPos X="18" Y="908"/> 638 <UsageCount Value="13"/> 639 <Loaded Value="True"/> 640 </Unit72> 641 <Unit73> 642 <Filename Value="../../../../../Lazarus/0.9.31_2.6.0/fpc/2.6.0/source/rtl/objpas/classes/streams.inc"/> 643 <EditorIndex Value="2"/> 644 <WindowIndex Value="0"/> 645 <TopLine Value="739"/> 646 <CursorPos X="18" Y="750"/> 647 <UsageCount Value="13"/> 648 <Loaded Value="True"/> 649 </Unit73> 650 <Unit74> 651 <Filename Value="../Generic/GenericListString.inc"/> 652 <EditorIndex Value="6"/> 653 <WindowIndex Value="0"/> 654 <TopLine Value="8"/> 655 <CursorPos X="34" Y="21"/> 656 <UsageCount Value="12"/> 657 <Loaded Value="True"/> 658 </Unit74> 580 659 </Units> 581 <JumpHistory Count="30" HistoryIndex="2 7">660 <JumpHistory Count="30" HistoryIndex="28"> 582 661 <Position1> 583 <Filename Value=" ../Generic/GenericList.inc"/>584 <Caret Line=" 468" Column="70" TopLine="462"/>662 <Filename Value="UMainForm.pas"/> 663 <Caret Line="142" Column="1" TopLine="128"/> 585 664 </Position1> 586 665 <Position2> 587 <Filename Value=" ../Generic/GenericList.inc"/>588 <Caret Line=" 469" Column="1" TopLine="462"/>666 <Filename Value="UMainForm.pas"/> 667 <Caret Line="143" Column="1" TopLine="128"/> 589 668 </Position2> 590 669 <Position3> 591 670 <Filename Value="../Generic/GenericList.inc"/> 592 <Caret Line=" 470" Column="1" TopLine="462"/>671 <Caret Line="161" Column="1" TopLine="148"/> 593 672 </Position3> 594 673 <Position4> 595 <Filename Value="../ Generic/GenericList.inc"/>596 <Caret Line=" 471" Column="1" TopLine="462"/>674 <Filename Value="../Specialized/SpecializedStream.pas"/> 675 <Caret Line="93" Column="21" TopLine="80"/> 597 676 </Position4> 598 677 <Position5> 599 <Filename Value=" ../Generic/GenericList.inc"/>600 <Caret Line=" 470" Column="5" TopLine="462"/>678 <Filename Value="UMainForm.pas"/> 679 <Caret Line="150" Column="22" TopLine="129"/> 601 680 </Position5> 602 681 <Position6> 603 <Filename Value=" UMainForm.pas"/>604 <Caret Line="2 37" Column="19" TopLine="232"/>682 <Filename Value="../Generic/GenericStream.inc"/> 683 <Caret Line="22" Column="12" TopLine="9"/> 605 684 </Position6> 606 685 <Position7> 607 <Filename Value=" UMainForm.pas"/>608 <Caret Line=" 237" Column="19" TopLine="232"/>686 <Filename Value="../Generic/GenericStream.inc"/> 687 <Caret Line="37" Column="18" TopLine="35"/> 609 688 </Position7> 610 689 <Position8> 611 690 <Filename Value="UMainForm.pas"/> 612 <Caret Line=" 495" Column="26" TopLine="482"/>691 <Caret Line="157" Column="79" TopLine="132"/> 613 692 </Position8> 614 693 <Position9> 615 <Filename Value=" UMainForm.pas"/>616 <Caret Line="5 03" Column="9" TopLine="490"/>694 <Filename Value="../Specialized/SpecializedStream.pas"/> 695 <Caret Line="58" Column="45" TopLine="46"/> 617 696 </Position9> 618 697 <Position10> 619 <Filename Value=" UMainForm.pas"/>620 <Caret Line=" 480" Column="3" TopLine="467"/>698 <Filename Value="../Specialized/SpecializedStream.pas"/> 699 <Caret Line="119" Column="12" TopLine="100"/> 621 700 </Position10> 622 701 <Position11> 623 <Filename Value=" UMainForm.pas"/>624 <Caret Line=" 511" Column="32" TopLine="498"/>702 <Filename Value="../Generic/GenericList.inc"/> 703 <Caret Line="197" Column="39" TopLine="182"/> 625 704 </Position11> 626 705 <Position12> 627 <Filename Value=" UMainForm.pas"/>628 <Caret Line=" 519" Column="33" TopLine="506"/>706 <Filename Value="../Specialized/SpecializedStream.pas"/> 707 <Caret Line="119" Column="12" TopLine="100"/> 629 708 </Position12> 630 709 <Position13> 631 <Filename Value=" UMainForm.pas"/>632 <Caret Line=" 526" Column="26" TopLine="513"/>710 <Filename Value="../Specialized/SpecializedStream.pas"/> 711 <Caret Line="61" Column="38" TopLine="48"/> 633 712 </Position13> 634 713 <Position14> 635 <Filename Value=" UMainForm.pas"/>636 <Caret Line=" 538" Column="27" TopLine="525"/>714 <Filename Value="../Specialized/SpecializedStream.pas"/> 715 <Caret Line="130" Column="15" TopLine="117"/> 637 716 </Position14> 638 717 <Position15> 639 <Filename Value=" UMainForm.pas"/>640 <Caret Line=" 549" Column="26" TopLine="536"/>718 <Filename Value="../Specialized/SpecializedStream.pas"/> 719 <Caret Line="64" Column="36" TopLine="51"/> 641 720 </Position15> 642 721 <Position16> 643 <Filename Value=" UMainForm.pas"/>644 <Caret Line="5 61" Column="25" TopLine="548"/>722 <Filename Value="../Specialized/SpecializedStream.pas"/> 723 <Caret Line="58" Column="29" TopLine="45"/> 645 724 </Position16> 646 725 <Position17> 647 <Filename Value=" UMainForm.pas"/>648 <Caret Line=" 572" Column="16" TopLine="559"/>726 <Filename Value="../Specialized/SpecializedStream.pas"/> 727 <Caret Line="78" Column="45" TopLine="78"/> 649 728 </Position17> 650 729 <Position18> 651 <Filename Value=" UMainForm.pas"/>652 <Caret Line=" 584" Column="25" TopLine="571"/>730 <Filename Value="../Specialized/SpecializedStream.pas"/> 731 <Caret Line="64" Column="64" TopLine="48"/> 653 732 </Position18> 654 733 <Position19> 655 <Filename Value=" UMainForm.pas"/>656 <Caret Line=" 595" Column="26" TopLine="582"/>734 <Filename Value="../Specialized/SpecializedStream.pas"/> 735 <Caret Line="82" Column="3" TopLine="68"/> 657 736 </Position19> 658 737 <Position20> 659 <Filename Value="../Generic/GenericList .inc"/>660 <Caret Line="2 14" Column="12" TopLine="201"/>738 <Filename Value="../Generic/GenericListObject.inc"/> 739 <Caret Line="20" Column="21" TopLine="1"/> 661 740 </Position20> 662 741 <Position21> 663 <Filename Value="../Generic/GenericList .inc"/>664 <Caret Line="2 31" Column="16" TopLine="218"/>742 <Filename Value="../Generic/GenericListObject.inc"/> 743 <Caret Line="24" Column="17" TopLine="11"/> 665 744 </Position21> 666 745 <Position22> 667 <Filename Value=" UMainForm.pas"/>668 <Caret Line=" 634" Column="11" TopLine="614"/>746 <Filename Value="../Generic/GenericListString.inc"/> 747 <Caret Line="1" Column="1" TopLine="1"/> 669 748 </Position22> 670 749 <Position23> 671 750 <Filename Value="UMainForm.pas"/> 672 <Caret Line=" 628" Column="39" TopLine="624"/>751 <Caret Line="43" Column="15" TopLine="28"/> 673 752 </Position23> 674 753 <Position24> 675 <Filename Value=" UMainForm.pas"/>676 <Caret Line=" 91" Column="5" TopLine="77"/>754 <Filename Value="../Generic/GenericStream.inc"/> 755 <Caret Line="13" Column="1" TopLine="1"/> 677 756 </Position24> 678 757 <Position25> 679 <Filename Value=" UMainForm.pas"/>680 <Caret Line=" 92" Column="61" TopLine="77"/>758 <Filename Value="../Specialized/SpecializedStream.pas"/> 759 <Caret Line="84" Column="35" TopLine="40"/> 681 760 </Position25> 682 761 <Position26> 683 <Filename Value=" UMainForm.pas"/>684 <Caret Line=" 91" Column="52" TopLine="74"/>762 <Filename Value="../Specialized/SpecializedStream.pas"/> 763 <Caret Line="126" Column="39" TopLine="111"/> 685 764 </Position26> 686 765 <Position27> 687 <Filename Value="../ Generic/GenericList.inc"/>688 <Caret Line=" 3" Column="69" TopLine="1"/>766 <Filename Value="../Specialized/SpecializedStream.pas"/> 767 <Caret Line="128" Column="1" TopLine="111"/> 689 768 </Position27> 690 769 <Position28> 691 <Filename Value="../ Generic/GenericList.inc"/>692 <Caret Line=" 27" Column="24" TopLine="7"/>770 <Filename Value="../Specialized/SpecializedStream.pas"/> 771 <Caret Line="68" Column="32" TopLine="55"/> 693 772 </Position28> 694 773 <Position29> 695 <Filename Value="../ Generic/GenericList.inc"/>696 <Caret Line=" 217" Column="27" TopLine="209"/>774 <Filename Value="../Specialized/SpecializedStream.pas"/> 775 <Caret Line="121" Column="1" TopLine="106"/> 697 776 </Position29> 698 777 <Position30> 699 778 <Filename Value="../Generic/GenericList.inc"/> 700 <Caret Line=" 237" Column="18" TopLine="223"/>779 <Caret Line="55" Column="15" TopLine="42"/> 701 780 </Position30> 702 781 </JumpHistory> 703 782 </ProjectOptions> 704 783 <CompilerOptions> 705 <Version Value="1 0"/>784 <Version Value="11"/> 706 785 <Target> 707 786 <Filename Value="Demo"/> … … 730 809 <Linking> 731 810 <Debugging> 732 < GenerateDebugInfo Value="True"/>811 <DebugInfoType Value="dsStabs"/> 733 812 <UseHeaptrc Value="True"/> 734 813 </Debugging> -
trunk/Packages/TemplateGenerics/Demo/UMainForm.lfm
r84 r90 48 48 end 49 49 object ButtonCharList: TButton 50 Left = 750 Left = 8 51 51 Height = 25 52 52 Top = 134 53 Width = 12 953 Width = 128 54 54 Caption = 'TListChar(TString)' 55 55 OnClick = ButtonCharListClick … … 57 57 end 58 58 object ButtonBenchmarkListString: TButton 59 Left = 1059 Left = 8 60 60 Height = 24 61 61 Top = 456 … … 67 67 end 68 68 object ButtonListObject: TButton 69 Left = 769 Left = 8 70 70 Height = 25 71 71 Top = 163 72 Width = 12 972 Width = 128 73 73 Caption = 'TListObject' 74 74 OnClick = ButtonListObjectClick … … 76 76 end 77 77 object ButtonBenchmarkDictionary: TButton 78 Left = 1078 Left = 8 79 79 Height = 25 80 80 Top = 424 81 Width = 12 681 Width = 128 82 82 Anchors = [akLeft, akBottom] 83 83 Caption = 'TDictionaryStringString' … … 86 86 end 87 87 object ButtonMatrixInteger: TButton 88 Left = 788 Left = 8 89 89 Height = 25 90 90 Top = 192 91 Width = 12 991 Width = 128 92 92 Caption = 'TMatrixInteger' 93 93 OnClick = ButtonMatrixIntegerClick … … 140 140 TabOrder = 10 141 141 end 142 object ButtonStreamByte: TButton 143 Left = 10 144 Height = 25 145 Top = 224 146 Width = 128 147 Caption = 'TMemoryStreamByte' 148 OnClick = ButtonStreamByteClick 149 TabOrder = 11 150 end 142 151 end -
trunk/Packages/TemplateGenerics/Demo/UMainForm.pas
r84 r90 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 9 ComCtrls, SpecializedList, SpecializedDictionary, SpecializedQueue, 10 DateUtils, SpecializedMatrix ;10 DateUtils, SpecializedMatrix, SpecializedStream; 11 11 12 12 type … … 15 15 16 16 TMainForm = class(TForm) 17 ButtonStreamByte: TButton; 17 18 ButtonBenchmarkDictionary: TButton; 18 19 ButtonBenchmarkListPointer: TButton; … … 38 39 procedure ButtonQueueIntegerClick(Sender: TObject); 39 40 procedure ButtonStringListClick(Sender: TObject); 41 procedure ButtonStreamByteClick(Sender: TObject); 40 42 procedure FormCreate(Sender: TObject); 41 43 procedure FormDestroy(Sender: TObject); 42 private43 44 public 44 45 MeasureDuration: TDateTime; … … 94 95 List2.SetArray([2, 0]); 95 96 WriteOutput('EqualTo([7, 11])', BoolToStr(EqualTo(List2))); 97 InsertCount(0, 3); 98 WriteOutput('InsertCount(0, 3)', Implode(',', IntToStr)); 99 Fill(0, 3, 9); 100 WriteOutput('Fill(0, 3, 9)', Implode(',', IntToStr)); 96 101 finally 97 102 Free; … … 119 124 WriteOutput('Clear', '[' + Implode('; ', ', ', IntToStr) + ']'); 120 125 WriteOutput('Count [Y, X]', IntToStr(Count.Y) + ', ' + IntToStr(Count.X)); 126 finally 127 Free; 128 end; 129 end; 130 131 procedure TMainForm.ButtonStreamByteClick(Sender: TObject); 132 var 133 Stream: TMemoryStreamByte; 134 I: Integer; 135 ByteArray: array of Byte; 136 ByteArrayText: string; 137 begin 138 ListViewOutput.Clear; 139 LabelTestName.Caption := 'TStreamByte test'; 140 Stream := TMemoryStreamByte.Create; 141 with Stream do try 142 WriteOutput('Size := ', IntToStr(Stream.Size)); 143 Write(1); 144 WriteOutput('Write(1)', ''); 145 WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position)); 146 WriteArray([2, 3, 4]); 147 WriteOutput('WriteArray([2, 3, 4])', ''); 148 WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position)); 149 Position := 1; 150 WriteOutput('Position := 1', ''); 151 WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position)); 152 WriteOutput('Read', IntToStr(Read)); 153 WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position)); 154 ByteArray := ReadArray(2); 155 ByteArrayText := '['; 156 for I := 0 to Length(ByteArray) - 1 do begin 157 ByteArrayText := ByteArrayText + IntToStr(ByteArray[I]); 158 if I < Length(ByteArray) - 1 then ByteArrayText := ByteArrayText + ', '; 159 end; 160 ByteArrayText := ByteArrayText + ']'; 161 WriteOutput('ReadArray', ByteArrayText); 162 WriteOutput('Size, Position', IntToStr(Stream.Size) + ', ' + IntToStr(Stream.Position)); 121 163 finally 122 164 Free; … … 702 744 MoveItems(2, 3, 3); 703 745 WriteOutput('Implode', Implode(',', StrToStr)); 746 InsertCount(0, 3); 747 WriteOutput('InsertCount(0, 3)', Implode(',', StrToStr)); 748 Fill(0, 3, 'Zero'); 749 WriteOutput('Fill(0, 3, ''Zero'')', Implode(',', StrToStr)); 704 750 finally 705 751 Free; -
trunk/Packages/TemplateGenerics/Generic/GenericList.inc
r84 r90 1 1 {$IFDEF INTERFACE} 2 3 // TGList implemented using templates 4 // - item operations (Add, Insert, ReplaceArray, Get, Set, IndexOf, 5 // Extract, Delete, Exchange) 6 // - item range operations (DeleteItems, InsertItems, ReplaceItems, 7 // Move, Fill) 8 // - other TGList operations (AddList, InsertList, 9 // ReplaceList, GetList, IndexOfList) 10 // - dynamic array operations (AddArray, InsertArray, 11 // ReplaceArray, GetArray, IndexOfArray) 12 // - all items operations (Clear, Reverse, Sort) 2 13 3 14 TGList = class; … … 13 24 FItems: array of TGListItem; 14 25 FCount: TGListIndex; 26 FUpdateCount: Integer; 27 FOnUpdate: TNotifyEvent; 15 28 function Get(Index: TGListIndex): TGListItem; 16 29 function GetCapacity: TGListIndex; … … 21 34 procedure SetLast(AValue: TGListItem); 22 35 procedure SetFirst(AValue: TGListItem); 36 procedure QuickSort(L, R : TGListIndex; Compare: TGListSortCompare); 37 protected 23 38 procedure Put(Index: TGListIndex; const AValue: TGListItem); virtual; 24 39 procedure SetCount(const AValue: TGListIndex); virtual; 25 procedure QuickSort(L, R : TGListIndex; Compare: TGListSortCompare);26 40 public 41 type 42 PItem = ^TGListItem; 27 43 function CompareMem(P1, P2: Pointer; Length: cardinal): Boolean; inline; 28 44 function Add(Item: TGListItem): TGListIndex; … … 41 57 property First: TGListItem read GetFirst write SetFirst; 42 58 procedure Fill(Start, Count: TGListIndex; Value: TGListItem); 43 function GetArray: TGListItemArray; 59 function GetArray(Index, ACount: TGListIndex): TGListItemArray; 60 procedure GetList(List: TGList; Index, ACount: TGListIndex); 61 procedure GetBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); 44 62 function Implode(Separator: string; Converter: TGListToStringConverter): string; 45 63 function IndexOf(Item: TGListItem; Start: TGListIndex = 0): TGListIndex; virtual; 46 64 function IndexOfList(List: TGList; Start: TGListIndex = 0): TGListIndex; 65 function IndexOfArray(Values: array of TGListItem; Start: TGListIndex = 0): TGListIndex; 47 66 procedure Insert(Index: TGListIndex; Item: TGListItem); 48 67 procedure InsertList(Index: TGListIndex; List: TGList); 49 68 procedure InsertArray(Index: TGListIndex; Values: array of TGListItem); 69 procedure InsertCount(Index: TGListIndex; ACount: TGListIndex); 50 70 procedure Move(CurIndex, NewIndex: TGListIndex); 51 71 procedure MoveItems(CurIndex, NewIndex, Count: TGListIndex); 52 72 function Remove(Item: TGListItem): TGListIndex; 53 73 procedure Reverse; 74 procedure ReplaceArray(Index: TGListIndex; Values: array of TGListItem); 54 75 procedure ReplaceList(Index: TGListIndex; Source: TGList); 55 76 procedure ReplaceListPart(Index: TGListIndex; Source: TGList; 56 77 SourceIndex, SourceCount: TGListIndex); 78 procedure ReplaceBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); 57 79 procedure Sort(Compare: TGListSortCompare); 58 80 procedure SetArray(Values: array of TGListItem); 81 procedure BeginUpdate; 82 procedure EndUpdate; 83 procedure Update; 59 84 property Count: TGListIndex read FCount write SetCount; 60 85 property Capacity: TGListIndex read GetCapacity write SetCapacity; 61 86 property Items[Index: TGListIndex]: TGListItem read Get write Put; default; 62 87 property Last: TGListItem read GetLast write SetLast; 88 property OnUpdate: TNotifyEvent read FOnUpdate write FOnUpdate; 63 89 end; 64 90 … … 83 109 end; 84 110 111 procedure TGList.GetBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); 112 var 113 P: PItem; 114 I: TGListIndex; 115 begin 116 if (Index + Count) > FCount then 117 raise EListError.CreateFmt(SListIndexError, [Index + Count]); 118 P := PItem(@Buffer); 119 I := 0; 120 while I < Count do begin 121 P^ := Items[Index + I]; 122 Inc(P, 1); 123 I := I + 1; 124 end; 125 end; 126 127 procedure TGList.ReplaceBuffer(Index: TGListIndex; var Buffer; Count: TGListIndex); 128 var 129 P: PItem; 130 I: TGListIndex; 131 begin 132 if (Index + Count) > FCount then 133 raise EListError.CreateFmt(SListIndexError, [Index + Count]); 134 P := PItem(@Buffer); 135 I := 0; 136 while I < Count do begin 137 Items[Index + I] := P^; 138 Inc(P, 1); 139 I := I + 1; 140 end; 141 end; 142 143 procedure TGList.ReplaceArray(Index: TGListIndex; Values: array of TGListItem); 144 var 145 I: TGListIndex; 146 begin 147 I := 0; 148 while I < Length(Values) do begin 149 Items[Index + I] := Values[I]; 150 I := I + 1; 151 end; 152 Update; 153 end; 154 85 155 procedure TGList.ReplaceList(Index: TGListIndex; Source: TGList); 86 156 var … … 92 162 I := I + 1; 93 163 end; 164 Update; 94 165 end; 95 166 … … 104 175 I := I + 1; 105 176 end; 177 Update; 106 178 end; 107 179 … … 165 237 end; 166 238 167 function TGList.GetArray : TGListItemArray;239 function TGList.GetArray(Index, ACount: TGListIndex): TGListItemArray; 168 240 var 169 241 I: Integer; 170 242 begin 171 SetLength(Result, Count); 172 I := 0; 173 while I < Count do begin 174 Result[I] := FItems[I]; 175 I := I + 1; 176 end; 243 SetLength(Result, ACount); 244 I := 0; 245 while I < Count do begin 246 Result[I] := FItems[Index + I]; 247 I := I + 1; 248 end; 249 end; 250 251 procedure TGList.GetList(List: TGList; Index, ACount: TGListIndex); 252 begin 253 List.Clear; 254 List.AddListPart(Self, Index, ACount); 177 255 end; 178 256 … … 216 294 I := I + 1; 217 295 end; 296 Update; 218 297 end; 219 298 … … 250 329 Result := Start; 251 330 while (Result < FCount) and 252 not CompareMem(@FItems[Result], @Item, SizeOf(TGListItem)) do253 //not (CompareByte(FItems[Result], Item, SizeOf(TGListItem)) = 0) do331 // not CompareMem(@FItems[Result], @Item, SizeOf(TGListItem)) do 332 not (CompareByte(FItems[Result], Item, SizeOf(TGListItem)) = 0) do 254 333 Result := Result + 1; 255 334 if Result = FCount then Result := -1; … … 258 337 procedure TGList.Insert(Index: TGListIndex; Item: TGListItem); 259 338 begin 260 if (Index < 0) or (Index > FCount 339 if (Index < 0) or (Index > FCount) then 261 340 raise EListError.CreateFmt(SListIndexError, [Index]); 262 if FCount = Capacity then SetCapacityOptimized(Capacity + 1); 341 InsertCount(Index, 1); 342 FItems[Index] := Item; 343 Update; 344 end; 345 346 procedure TGList.InsertList(Index: TGListIndex; List: TGList); 347 begin 348 if (Index < 0) or (Index > FCount) then 349 raise EListError.CreateFmt(SListIndexError, [Index]); 350 InsertCount(Index, List.Count); 351 ReplaceList(Index, List); 352 end; 353 354 procedure TGList.InsertArray(Index: TGListIndex; Values: array of TGListItem); 355 begin 356 if (Index < 0) or (Index > FCount) then 357 raise EListError.CreateFmt(SListIndexError, [Index]); 358 InsertCount(Index, Length(Values)); 359 ReplaceArray(Index, Values); 360 end; 361 362 procedure TGList.InsertCount(Index: TGListIndex; ACount: TGListIndex); 363 begin 364 if (Index < 0) or (Index > FCount) then 365 raise EListError.CreateFmt(SListIndexError, [Index]); 366 Count := Count + ACount; 263 367 if Index < FCount then 264 System.Move(FItems[Index], FItems[Index + 1], (FCount - Index) * SizeOf(TGListItem)); 265 FItems[Index] := Item; 266 FCount := FCount + 1; 267 end; 268 269 procedure TGList.InsertList(Index: TGListIndex; List: TGList); 270 var 271 I: TGListIndex; 272 begin 273 I := 0; 274 while (I < List.Count) do begin 275 Insert(Index + I, List[I]); 276 I := I + 1; 277 end; 368 System.Move(FItems[Index], FItems[Index + ACount], (FCount - ACount - Index) * SizeOf(TGListItem)); 369 Update; 278 370 end; 279 371 … … 297 389 end; 298 390 391 function TGList.IndexOfArray(Values: array of TGListItem; Start: TGListIndex): TGListIndex; 392 var 393 I: TGListIndex; 394 begin 395 if Length(Values) > 0 then begin 396 Result := IndexOf(Values[0], Start); 397 if Result <> -1 then begin 398 I := 1; 399 while I < Length(Values) do begin 400 if not CompareMem(Addr(FItems[Result + I]), Addr(Values[I]), SizeOf(TGListItem)) then begin 401 Result := -1; 402 Break; 403 end; 404 I := I + 1; 405 end; 406 end; 407 end else Result := -1; 408 end; 409 299 410 function TGList.GetLast: TGListItem; 300 411 begin … … 347 458 //Delete(CurIndex); 348 459 //Insert(NewIndex, Temp); 460 Update; 349 461 end; 350 462 … … 372 484 end; 373 485 end; 486 Update; 374 487 end; 375 488 … … 378 491 Result := IndexOf(Item); 379 492 if Result <> -1 then 380 Delete(Result); 493 Delete(Result) 494 else raise Exception.CreateFmt(SItemNotFound, [0]); 381 495 end; 382 496 … … 407 521 I := I + 1; 408 522 end; 523 Update; 409 524 end; 410 525 … … 413 528 if FCount > 1 then 414 529 QuickSort(0, FCount - 1, Compare); 530 Update; 415 531 end; 416 532 … … 424 540 I := I + 1; 425 541 end; 542 Update; 426 543 end; 427 544 … … 438 555 end; 439 556 440 procedure TGList.InsertArray(Index: TGListIndex; Values: array of TGListItem); 441 var 442 I: TGListIndex; 443 begin 444 I := 0; 445 while I <= High(Values) do begin 446 Insert(Index + I, Values[I]); 447 I := I + 1; 448 end; 557 procedure TGList.BeginUpdate; 558 begin 559 Inc(FUpdateCount); 560 end; 561 562 procedure TGList.EndUpdate; 563 begin 564 Dec(FUpdateCount); 565 Update; 566 end; 567 568 procedure TGList.Update; 569 begin 570 if Assigned(FOnUpdate) and (FUpdateCount = 0) then FOnUpdate(Self); 449 571 end; 450 572 … … 479 601 Result := FCount - 1; 480 602 FItems[Result] := Item; 603 Update; 481 604 end; 482 605 … … 494 617 J := J + 1; 495 618 end; 619 Update; 496 620 end; 497 621 … … 509 633 J := J + 1; 510 634 end; 635 Update; 511 636 end; 512 637 … … 524 649 System.Move(FItems[Index + 1], FItems[Index], (FCount - Index) * SizeOf(TGListItem)); 525 650 SetCapacityOptimized(Capacity - 1); 651 Update; 526 652 end; 527 653 … … 535 661 I := I + 1; 536 662 end; 663 Update; 537 664 end; 538 665 … … 546 673 I := I + 1; 547 674 end; 675 Update; 548 676 end; 549 677 … … 559 687 FItems[Index1] := FItems[Index2]; 560 688 FItems[Index2] := Temp; 689 Update; 561 690 end; 562 691 -
trunk/Packages/TemplateGenerics/Generic/GenericListObject.inc
r84 r90 13 13 // TGListObject<TListObjectIndex, TListObjectItem> = class(TGList) 14 14 TGListObject = class(TGList) 15 pr ivate15 protected 16 16 procedure Put(Index: TGListIndex; const AValue: TGListItem); override; 17 procedure SetCount(const AValue: TGListIndex); override; 17 18 public 18 19 OwnsObjects: Boolean; … … 20 21 function InsertNew(Index: TGListIndex; NewObject: TGListItem = nil): TGListItem; 21 22 procedure Delete(Index: TGListObjectIndex); override; 22 procedure Clear; override;23 23 procedure Assign(Source: TGList); override; 24 constructor Create; 24 constructor Create; override; 25 25 destructor Destroy; override; 26 26 end; … … 75 75 procedure TGListObject.Put(Index: TGListIndex; const AValue: TGListItem); 76 76 begin 77 if OwnsObjects then FItems[Index].Free;77 if OwnsObjects and (FItems[Index] <> AValue) then FItems[Index].Free; 78 78 inherited Put(Index, AValue); 79 79 end; … … 85 85 end; 86 86 87 procedure TGListObject. Clear;87 procedure TGListObject.SetCount(const AValue: TGListIndex); 88 88 var 89 89 I: TGListObjectIndex; 90 90 begin 91 91 if OwnsObjects then begin 92 I := 0;93 while I < Countdo begin92 I := FCount - 1; 93 while I >= AValue do begin 94 94 FItems[I].Free; 95 I := I +1;95 I := I - 1; 96 96 end; 97 97 end; 98 inherited Clear;98 inherited; 99 99 end; 100 100 -
trunk/Packages/TemplateGenerics/Generic/GenericListString.inc
r84 r90 19 19 procedure Assign(Source: TGList); override; 20 20 function IndexOf(Item: TGListItem; Start: TGListIndex = 0): TGListIndex; override; 21 constructor Create; 21 constructor Create; override; 22 22 destructor Destroy; override; 23 23 end; -
trunk/Packages/TemplateGenerics/Generic/GenericPoint.inc
r84 r90 1 1 {$IFDEF INTERFACE} 2 2 3 // TGPoint<TPoint Coord, TPointType> = class3 // TGPoint<TPointType> = class 4 4 TGPoint = class 5 Coordinate: array[TGPointIndex] of TGPointType; 6 //procedure SetArray(Items: array[TGPointIndex] of TGPointType); 5 X: TGPointType; 6 Y: TGPointType; 7 procedure Add(Point: TGPoint); 7 8 end; 8 9 … … 12 13 {$IFDEF IMPLEMENTATION} 13 14 15 procedure TGPoint.Add(Point: TGPoint); 16 begin 17 X := X + Point.X; 18 Y := Y + Point.Y; 19 end; 14 20 15 21 {$UNDEF IMPLEMENTATION} -
trunk/Packages/TemplateGenerics/Generic/GenericQueue.inc
r84 r90 11 11 {$I 'GenericList.inc'} 12 12 13 // TGQueue<T SetIndex, TSetItem> = class(TGList)13 // TGQueue<TQueueIndex, TQueueItem> = class(TGList) 14 14 TGQueue = class 15 15 private 16 16 FList: TGList; 17 function GetCount: TGQueueIndex; 17 18 public 18 19 procedure Enqueue(Value: TGQueueItem); 20 procedure EnqueueArray(Values: array of TGQueueItem); 21 procedure EnqueueList(List: TGList); 19 22 function Dequeue: TGQueueItem; 20 23 function Peek: TGQueueItem; … … 22 25 destructor Destroy; override; 23 26 property List: TGList read FList; 27 property Count: TGQueueIndex read GetCount; 24 28 end; 25 29 … … 54 58 end; 55 59 60 procedure TGQueue.EnqueueArray(Values: array of TGQueueItem); 61 begin 62 FList.AddArray(Values); 63 end; 64 65 procedure TGQueue.EnqueueList(List: TGList); 66 begin 67 FList.AddList(List); 68 end; 69 56 70 function TGQueue.Peek: TGQueueItem; 57 71 begin … … 75 89 end; 76 90 91 function TGQueue.GetCount: TGQueueIndex; 92 begin 93 Result := FList.Count; 94 end; 95 77 96 {$UNDEF IMPLEMENTATION} 78 97 {$ENDIF} -
trunk/Packages/TemplateGenerics/Generic/GenericStream.inc
r84 r90 1 1 {$IFDEF INTERFACE} 2 2 3 TGStream DataEvent = procedure (Item: TGStreamItem) of object;3 TGStreamItemArray = array of TGStreamItem; 4 4 5 // TGStream<T StreamItem> = class5 // TGStream<TGStreamIndex, TGStreamItem> = class 6 6 TGStream = class 7 FOnData: TGStreamDataEvent; 8 procedure Write(Item: TStreamItem); 9 property OnData: TGStreamDataEvent read FOnData write FOnData; 7 procedure SetSize(AValue: TGStreamIndex); 8 function GetSize: TGStreamIndex; 9 procedure SetPosition(AValue: TGStreamIndex); 10 function GetPosition: TGStreamIndex; 11 public 12 procedure Assign(Source: TGStream); virtual; 13 procedure Write(Item: TGStreamItem); virtual; abstract; 14 procedure WriteArray(Item: array of TGStreamItem); virtual; abstract; 15 procedure WriteStream(Stream: TGStream; Count: TGStreamIndex); virtual; abstract; 16 function Read: TGStreamItem; virtual; abstract; 17 function ReadArray(Count: TGStreamIndex): TGStreamItemArray; virtual; abstract; 18 function ReadStream(Stream: TGStream; Count: TGStreamIndex): TGStreamIndex; virtual; abstract; 19 function Insert(Count: TGStreamIndex): TGStreamIndex; virtual; abstract; 20 function Remove(Count: TGStreamIndex): TGStreamIndex; virtual; abstract; 21 function Seek(Offset: TGStreamIndex; Origin: TSeekOrigin = soCurrent): 22 TGStreamIndex; virtual; abstract; 23 constructor Create; virtual; 24 property Position: TGStreamIndex read GetPosition write SetPosition; 25 property Size: TGStreamIndex read GetSize write SetSize; 10 26 end; 11 27 … … 15 31 {$IFDEF IMPLEMENTATION} 16 32 17 procedure TGStream. Write(Item: TGStreamItem);33 procedure TGStream.Assign(Source: TGStream); 18 34 begin 19 if Assigned(FOnData) then20 FOnData(Item);21 35 end; 22 36 37 procedure TGStream.SetPosition(AValue: TGStreamIndex); 38 begin 39 Seek(AValue, soBegin); 40 end; 41 42 function TGStream.GetPosition: TGStreamIndex; 43 begin 44 Result := Seek(0, soCurrent); 45 end; 46 47 procedure TGStream.SetSize(AValue: TGStreamIndex); 48 var 49 StreamSize: TGStreamIndex; 50 OldPosition: TGStreamIndex; 51 begin 52 OldPosition := Seek(0, soCurrent); 53 StreamSize := Size; 54 if AValue > StreamSize then begin 55 Seek(StreamSize, soBegin); 56 Insert(AValue - StreamSize); 57 end else 58 if AValue < StreamSize then begin 59 Seek(AValue, soBegin); 60 Remove(StreamSize - AValue); 61 end; 62 Position := OldPosition; 63 end; 64 65 function TGStream.GetSize: TGStreamIndex; 66 var 67 OldPosition: Integer; 68 begin 69 OldPosition := Position; 70 Result := Seek(0, soEnd); 71 Position := OldPosition; 72 end; 73 74 constructor TGStream.Create; 75 begin 76 inherited; 77 end; 23 78 24 79 {$UNDEF IMPLEMENTATION} -
trunk/Packages/TemplateGenerics/Specialized/SpecializedList.pas
r84 r90 95 95 procedure AddStream(Stream: TStream); 96 96 procedure AddStreamPart(Stream: TStream; ItemCount: TGListIndex); 97 procedure WriteBuffer(var Buffer; Count: Integer); 98 procedure ReadBuffer(var Buffer; Count: Integer); 97 99 end; 98 100 … … 146 148 TListMethod = class(TListMethodBase) 147 149 procedure CallAll; 148 procedure CallNotifyEvents(Sender: TObject); 149 end; 150 end; 151 152 // TListNotifyEventBase<Integer, TNotifyEvent> 153 {$DEFINE TGListIndex := Integer} 154 {$DEFINE TGListItem := TNotifyEvent} 155 {$DEFINE TGList := TListNotifyEventBase} 156 {$DEFINE TGListSortCompare := TListNotifyEventSortCompare} 157 {$DEFINE TGListToStringConverter := TListNotifyEventToStringConverter} 158 {$DEFINE TGListFromStringConverter := TListNotifyEventFromStringConverter} 159 {$DEFINE TGListItemArray := TListNotifyEventItemArray} 160 {$DEFINE INTERFACE} 161 {$I 'GenericList.inc'} 162 163 // TListNotifyEvent<Integer, TNotifyEvent> 164 TListNotifyEvent = class(TListNotifyEventBase) 165 procedure CallAll(Sender: TObject); 166 end; 167 168 169 TBaseEvent = procedure of object; 170 171 // TListSimpleEventBase<Integer, TBaseEvent> 172 {$DEFINE TGListIndex := Integer} 173 {$DEFINE TGListItem := TBaseEvent} 174 {$DEFINE TGList := TListSimpleEventBase} 175 {$DEFINE TGListSortCompare := TListSimpleEventSortCompare} 176 {$DEFINE TGListToStringConverter := TListSimpleEventToStringConverter} 177 {$DEFINE TGListFromStringConverter := TListSimpleEventFromStringConverter} 178 {$DEFINE TGListItemArray := TListSimpleEventItemArray} 179 {$DEFINE INTERFACE} 180 {$I 'GenericList.inc'} 181 182 // TListSimpleEvent<Integer, TSimpleEvent> 183 TListSimpleEvent = class(TListSimpleEventBase) 184 procedure CallAll; 185 end; 186 150 187 151 188 function StrToStr(Value: string): string; … … 267 304 {$I 'GenericList.inc'} 268 305 306 // TListNotifyEventBase<Integer, TNotifyEvent> 307 {$DEFINE TGListIndex := Integer} 308 {$DEFINE TGListItem := TNotifyEvent} 309 {$DEFINE TGList := TListNotifyEventBase} 310 {$DEFINE TGListSortCompare := TListNotifyEventSortCompare} 311 {$DEFINE TGListToStringConverter := TListNotifyEventToStringConverter} 312 {$DEFINE TGListFromStringConverter := TListNotifyEventFromStringConverter} 313 {$DEFINE TGListItemArray := TListNotifyEventItemArray} 314 {$DEFINE IMPLEMENTATION} 315 {$I 'GenericList.inc'} 316 317 // TListSimpleEventBase<Integer, TBaseEvent> 318 {$DEFINE TGListIndex := Integer} 319 {$DEFINE TGListItem := TBaseEvent} 320 {$DEFINE TGList := TListSimpleEventBase} 321 {$DEFINE TGListSortCompare := TListSimpleEventSortCompare} 322 {$DEFINE TGListToStringConverter := TListSimpleEventToStringConverter} 323 {$DEFINE TGListFromStringConverter := TListSimpleEventFromStringConverter} 324 {$DEFINE TGListItemArray := TListSimpleEventItemArray} 325 {$DEFINE IMPLEMENTATION} 326 {$I 'GenericList.inc'} 327 328 269 329 270 330 function StrToStr(Value: string): string; … … 272 332 Result := Value; 273 333 end; 334 335 { TListSimpleEvent } 336 337 procedure TListSimpleEvent.CallAll; 338 var 339 I: TGListIndex; 340 begin 341 I := 0; 342 while (I < Count) do begin 343 TBaseEvent(Items[I])(); 344 I := I + 1; 345 end; 346 end; 347 274 348 275 349 { TListChar } … … 332 406 end; 333 407 334 procedure TList Method.CallNotifyEvents(Sender: TObject);408 procedure TListNotifyEvent.CallAll(Sender: TObject); 335 409 var 336 410 I: TGListIndex; … … 417 491 end; 418 492 493 procedure TListByte.WriteBuffer(var Buffer; Count: Integer); 494 begin 495 496 end; 497 498 procedure TListByte.ReadBuffer(var Buffer; Count: Integer); 499 begin 500 501 end; 502 419 503 end. -
trunk/Packages/TemplateGenerics/Specialized/SpecializedPoint.pas
r84 r90 11 11 12 12 type 13 TPoint2DIndex = (piX, piY); 14 15 // TPoint2D<TPoint2DIndex, Integer> 16 {$DEFINE TGPointIndex := TPoint2DIndex} 13 // TPoint<Integer> 17 14 {$DEFINE TGPointType := Integer} 18 {$DEFINE TGPoint := TPoint 2D}15 {$DEFINE TGPoint := TPoint} 19 16 {$DEFINE INTERFACE} 20 17 {$I 'GenericPoint.inc'} 18 19 // TSmallPoint<SmallInt> 20 {$DEFINE TGPointType := SmallInt} 21 {$DEFINE TGPoint := TSmallPoint} 22 {$DEFINE INTERFACE} 23 {$I 'GenericPoint.inc'} 24 25 // TPointSingle<Single> 26 {$DEFINE TGPointType := Single} 27 {$DEFINE TGPoint := TPointSingle} 28 {$DEFINE INTERFACE} 29 {$I 'GenericPoint.inc'} 30 31 // TPointDouble<Double> 32 {$DEFINE TGPointType := Double} 33 {$DEFINE TGPoint := TPointDouble} 34 {$DEFINE INTERFACE} 35 {$I 'GenericPoint.inc'} 36 21 37 implementation 22 38 23 // TPoint2D<TPoint2DIndex, Integer> 24 {$DEFINE TGPointIndex := T2DPointIndex} 39 // TPoint<Integer> 25 40 {$DEFINE TGPointType := Integer} 26 {$DEFINE TGPoint := TPoint 2D}41 {$DEFINE TGPoint := TPoint} 27 42 {$DEFINE IMPLEMENTATION} 28 43 {$I 'GenericPoint.inc'} 29 44 45 // TSmallPoint<SmallInt> 46 {$DEFINE TGPointType := SmallInt} 47 {$DEFINE TGPoint := TSmallPoint} 48 {$DEFINE IMPLEMENTATION} 49 {$I 'GenericPoint.inc'} 50 51 // TPointSingle<Single> 52 {$DEFINE TGPointType := Single} 53 {$DEFINE TGPoint := TPointSingle} 54 {$DEFINE IMPLEMENTATION} 55 {$I 'GenericPoint.inc'} 56 57 // TPointDouble<Double> 58 {$DEFINE TGPointType := Double} 59 {$DEFINE TGPoint := TPointDouble} 60 {$DEFINE IMPLEMENTATION} 61 {$I 'GenericPoint.inc'} 30 62 end. 31 63 -
trunk/Packages/TemplateGenerics/TemplateGenerics.lpk
r84 r90 1 1 <?xml version="1.0"?> 2 2 <CONFIG> 3 <Package Version=" 3">3 <Package Version="4"> 4 4 <PathDelim Value="\"/> 5 5 <Name Value="TemplateGenerics"/> 6 <AddToProjectUsesSection Value="True"/> 6 7 <Author Value="Chronos (robie@centrum.cz)"/> 7 8 <CompilerOptions> 8 <Version Value="1 0"/>9 <Version Value="11"/> 9 10 <PathDelim Value="\"/> 10 11 <SearchPaths> 11 12 <IncludeFiles Value="Generic"/> 12 <OtherUnitFiles Value="Specialized;Generic "/>13 <OtherUnitFiles Value="Specialized;Generic;Additional"/> 13 14 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 14 15 </SearchPaths> … … 27 28 </CompilerOptions> 28 29 <Description Value="Generic classes implemented as templates."/> 29 <Version Minor=" 3"/>30 <Files Count="2 3">30 <Version Minor="4"/> 31 <Files Count="27"> 31 32 <Item1> 32 33 <Filename Value="ReadMe.txt"/> … … 86 87 </Item14> 87 88 <Item15> 89 <Filename Value="Generic\GenericRectangle.inc"/> 90 <UnitName Value="GenericRectangle"/> 91 </Item15> 92 <Item16> 88 93 <Filename Value="Specialized\SpecializedList.pas"/> 89 94 <UnitName Value="SpecializedList"/> 90 </Item1 5>91 <Item1 6>95 </Item16> 96 <Item17> 92 97 <Filename Value="Specialized\SpecializedDictionary.pas"/> 93 98 <UnitName Value="SpecializedDictionary"/> 94 </Item1 6>95 <Item1 7>99 </Item17> 100 <Item18> 96 101 <Filename Value="Specialized\SpecializedStack.pas"/> 97 102 <UnitName Value="SpecializedStack"/> 98 </Item1 7>99 <Item1 8>103 </Item18> 104 <Item19> 100 105 <Filename Value="Specialized\SpecializedTree.pas"/> 101 106 <UnitName Value="SpecializedTree"/> 102 </Item1 8>103 <Item 19>107 </Item19> 108 <Item20> 104 109 <Filename Value="Specialized\SpecializedQueue.pas"/> 105 110 <UnitName Value="SpecializedQueue"/> 106 </Item 19>107 <Item2 0>111 </Item20> 112 <Item21> 108 113 <Filename Value="Specialized\SpecializedSet.pas"/> 109 114 <UnitName Value="SpecializedSet"/> 110 </Item2 0>111 <Item2 1>115 </Item21> 116 <Item22> 112 117 <Filename Value="Specialized\SpecializedPoint.pas"/> 113 118 <UnitName Value="SpecializedPoint"/> 114 </Item2 1>115 <Item2 2>119 </Item22> 120 <Item23> 116 121 <Filename Value="Specialized\SpecializedMatrix.pas"/> 117 122 <UnitName Value="SpecializedMatrix"/> 118 </Item2 2>119 <Item2 3>123 </Item23> 124 <Item24> 120 125 <Filename Value="Specialized\SpecializedBitmap.pas"/> 121 126 <UnitName Value="SpecializedBitmap"/> 122 </Item23> 127 </Item24> 128 <Item25> 129 <Filename Value="Specialized\SpecializedStream.pas"/> 130 <UnitName Value="SpecializedStream"/> 131 </Item25> 132 <Item26> 133 <Filename Value="Specialized\SpecializedRectangle.pas"/> 134 <UnitName Value="SpecializedRectangle"/> 135 </Item26> 136 <Item27> 137 <Filename Value="Additional\UBinarySerializer.pas"/> 138 <UnitName Value="UBinarySerializer"/> 139 </Item27> 123 140 </Files> 124 141 <Type Value="RunAndDesignTime"/> 125 142 <RequiredPkgs Count="2"> 126 143 <Item1> 127 <PackageName Value="LCL "/>144 <PackageName Value="LCLBase"/> 128 145 </Item1> 129 146 <Item2> … … 138 155 <Version Value="2"/> 139 156 </PublishOptions> 157 <CustomOptions Items="ExternHelp" Version="2"> 158 <_ExternHelp Items="Count"/> 159 </CustomOptions> 140 160 </Package> 141 161 </CONFIG> -
trunk/Packages/TemplateGenerics/TemplateGenerics.pas
r84 r90 3 3 } 4 4 5 unit TemplateGenerics; 5 unit TemplateGenerics; 6 6 7 7 interface … … 10 10 SpecializedList, SpecializedDictionary, SpecializedStack, SpecializedTree, 11 11 SpecializedQueue, SpecializedSet, SpecializedPoint, SpecializedMatrix, 12 SpecializedBitmap, LazarusPackageIntf; 12 SpecializedBitmap, SpecializedStream, SpecializedRectangle, 13 UBinarySerializer, LazarusPackageIntf; 13 14 14 15 implementation 15 16 16 procedure Register; 17 procedure Register; 17 18 begin 18 end; 19 end; 19 20 20 21 initialization 21 RegisterPackage('TemplateGenerics', @Register); 22 RegisterPackage('TemplateGenerics', @Register); 22 23 end.
Note:
See TracChangeset
for help on using the changeset viewer.