00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef ELST_H
00021 #define ELST_H
00022
00023 #include <stdio.h>
00024 #include "host.h"
00025 #include "serialis.h"
00026 #include "lsterr.h"
00027
00028 class ELIST_ITERATOR;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 class DLLSYM ELIST_LINK
00085 {
00086 friend class ELIST_ITERATOR;
00087 friend class ELIST;
00088
00089 ELIST_LINK *next;
00090
00091 public:
00092 ELIST_LINK() {
00093 next = NULL;
00094 }
00095
00096
00097 ELIST_LINK(
00098 const ELIST_LINK &) {
00099 next = NULL;
00100 }
00101
00102 void operator= (
00103 const ELIST_LINK &) {
00104 next = NULL;
00105 }
00106 };
00107
00108
00109
00110
00111
00112
00113
00114 class DLLSYM ELIST
00115 {
00116 friend class ELIST_ITERATOR;
00117
00118 ELIST_LINK *last;
00119
00120 ELIST_LINK *First() {
00121 return last ? last->next : NULL;
00122 }
00123
00124 public:
00125 ELIST() {
00126 last = NULL;
00127 }
00128
00129 void internal_clear (
00130
00131 void (*zapper) (ELIST_LINK *));
00132
00133 bool empty() const {
00134 return !last;
00135 }
00136
00137 bool singleton() const {
00138 return last ? (last == last->next) : false;
00139 }
00140
00141 void shallow_copy(
00142 ELIST *from_list) {
00143 last = from_list->last;
00144 }
00145
00146
00147 void internal_deep_copy (ELIST_LINK * (*copier) (ELIST_LINK *),
00148 const ELIST * list);
00149
00150 void assign_to_sublist(
00151 ELIST_ITERATOR *start_it,
00152 ELIST_ITERATOR *end_it);
00153
00154 inT32 length() const;
00155
00156 void sort (
00157 int comparator (
00158 const void *, const void *));
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 ELIST_LINK *add_sorted_and_find(int comparator(const void*, const void*),
00171 bool unique, ELIST_LINK* new_link);
00172
00173
00174
00175 bool add_sorted(int comparator(const void*, const void*),
00176 bool unique, ELIST_LINK* new_link) {
00177 return (add_sorted_and_find(comparator, unique, new_link) == new_link);
00178 }
00179
00180 };
00181
00182
00183
00184
00185
00186
00187
00188 class DLLSYM ELIST_ITERATOR
00189 {
00190 friend void ELIST::assign_to_sublist(ELIST_ITERATOR *, ELIST_ITERATOR *);
00191
00192 ELIST *list;
00193 ELIST_LINK *prev;
00194 ELIST_LINK *current;
00195 ELIST_LINK *next;
00196 bool ex_current_was_last;
00197
00198 bool ex_current_was_cycle_pt;
00199
00200 ELIST_LINK *cycle_pt;
00201
00202 bool started_cycling;
00203
00204
00205 ELIST_LINK *extract_sublist(
00206 ELIST_ITERATOR *other_it);
00207
00208 public:
00209 ELIST_ITERATOR() {
00210 list = NULL;
00211 }
00212
00213 ELIST_ITERATOR(
00214 ELIST *list_to_iterate);
00215
00216 void set_to_list(
00217 ELIST *list_to_iterate);
00218
00219 void add_after_then_move(
00220 ELIST_LINK *new_link);
00221
00222 void add_after_stay_put(
00223 ELIST_LINK *new_link);
00224
00225 void add_before_then_move(
00226 ELIST_LINK *new_link);
00227
00228 void add_before_stay_put(
00229 ELIST_LINK *new_link);
00230
00231 void add_list_after(
00232 ELIST *list_to_add);
00233
00234 void add_list_before(
00235 ELIST *list_to_add);
00236
00237 ELIST_LINK *data() {
00238 #ifndef NDEBUG
00239 if (!list)
00240 NO_LIST.error ("ELIST_ITERATOR::data", ABORT, NULL);
00241 if (!current)
00242 NULL_DATA.error ("ELIST_ITERATOR::data", ABORT, NULL);
00243 #endif
00244 return current;
00245 }
00246
00247 ELIST_LINK *data_relative(
00248 inT8 offset);
00249
00250 ELIST_LINK *forward();
00251
00252 ELIST_LINK *extract();
00253
00254 ELIST_LINK *move_to_first();
00255
00256 ELIST_LINK *move_to_last();
00257
00258 void mark_cycle_pt();
00259
00260 bool empty() {
00261 #ifndef NDEBUG
00262 if (!list)
00263 NO_LIST.error ("ELIST_ITERATOR::empty", ABORT, NULL);
00264 #endif
00265 return list->empty ();
00266 }
00267
00268 bool current_extracted() {
00269 return !current;
00270 }
00271
00272 bool at_first();
00273
00274 bool at_last();
00275
00276 bool cycled_list();
00277
00278 void add_to_end(
00279 ELIST_LINK *new_link);
00280
00281 void exchange(
00282 ELIST_ITERATOR *other_it);
00283
00284 inT32 length();
00285
00286 void sort (
00287 int comparator (
00288 const void *, const void *));
00289
00290 };
00291
00292
00293
00294
00295
00296
00297
00298
00299 inline void ELIST_ITERATOR::set_to_list(
00300 ELIST *list_to_iterate) {
00301 #ifndef NDEBUG
00302 if (!this)
00303 NULL_OBJECT.error ("ELIST_ITERATOR::set_to_list", ABORT, NULL);
00304 if (!list_to_iterate)
00305 BAD_PARAMETER.error ("ELIST_ITERATOR::set_to_list", ABORT,
00306 "list_to_iterate is NULL");
00307 #endif
00308
00309 list = list_to_iterate;
00310 prev = list->last;
00311 current = list->First ();
00312 next = current ? current->next : NULL;
00313 cycle_pt = NULL;
00314 started_cycling = FALSE;
00315 ex_current_was_last = FALSE;
00316 ex_current_was_cycle_pt = FALSE;
00317 }
00318
00319
00320
00321
00322
00323
00324
00325
00326 inline ELIST_ITERATOR::ELIST_ITERATOR(ELIST *list_to_iterate) {
00327 set_to_list(list_to_iterate);
00328 }
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338 inline void ELIST_ITERATOR::add_after_then_move(
00339 ELIST_LINK *new_element) {
00340 #ifndef NDEBUG
00341 if (!this)
00342 NULL_OBJECT.error ("ELIST_ITERATOR::add_after_then_move", ABORT, NULL);
00343 if (!list)
00344 NO_LIST.error ("ELIST_ITERATOR::add_after_then_move", ABORT, NULL);
00345 if (!new_element)
00346 BAD_PARAMETER.error ("ELIST_ITERATOR::add_after_then_move", ABORT,
00347 "new_element is NULL");
00348 if (new_element->next)
00349 STILL_LINKED.error ("ELIST_ITERATOR::add_after_then_move", ABORT, NULL);
00350 #endif
00351
00352 if (list->empty ()) {
00353 new_element->next = new_element;
00354 list->last = new_element;
00355 prev = next = new_element;
00356 }
00357 else {
00358 new_element->next = next;
00359
00360 if (current) {
00361 current->next = new_element;
00362 prev = current;
00363 if (current == list->last)
00364 list->last = new_element;
00365 }
00366 else {
00367 prev->next = new_element;
00368 if (ex_current_was_last)
00369 list->last = new_element;
00370 if (ex_current_was_cycle_pt)
00371 cycle_pt = new_element;
00372 }
00373 }
00374 current = new_element;
00375 }
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385 inline void ELIST_ITERATOR::add_after_stay_put(
00386 ELIST_LINK *new_element) {
00387 #ifndef NDEBUG
00388 if (!this)
00389 NULL_OBJECT.error ("ELIST_ITERATOR::add_after_stay_put", ABORT, NULL);
00390 if (!list)
00391 NO_LIST.error ("ELIST_ITERATOR::add_after_stay_put", ABORT, NULL);
00392 if (!new_element)
00393 BAD_PARAMETER.error ("ELIST_ITERATOR::add_after_stay_put", ABORT,
00394 "new_element is NULL");
00395 if (new_element->next)
00396 STILL_LINKED.error ("ELIST_ITERATOR::add_after_stay_put", ABORT, NULL);
00397 #endif
00398
00399 if (list->empty ()) {
00400 new_element->next = new_element;
00401 list->last = new_element;
00402 prev = next = new_element;
00403 ex_current_was_last = FALSE;
00404 current = NULL;
00405 }
00406 else {
00407 new_element->next = next;
00408
00409 if (current) {
00410 current->next = new_element;
00411 if (prev == current)
00412 prev = new_element;
00413 if (current == list->last)
00414 list->last = new_element;
00415 }
00416 else {
00417 prev->next = new_element;
00418 if (ex_current_was_last) {
00419 list->last = new_element;
00420 ex_current_was_last = FALSE;
00421 }
00422 }
00423 next = new_element;
00424 }
00425 }
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435 inline void ELIST_ITERATOR::add_before_then_move(
00436 ELIST_LINK *new_element) {
00437 #ifndef NDEBUG
00438 if (!this)
00439 NULL_OBJECT.error ("ELIST_ITERATOR::add_before_then_move", ABORT, NULL);
00440 if (!list)
00441 NO_LIST.error ("ELIST_ITERATOR::add_before_then_move", ABORT, NULL);
00442 if (!new_element)
00443 BAD_PARAMETER.error ("ELIST_ITERATOR::add_before_then_move", ABORT,
00444 "new_element is NULL");
00445 if (new_element->next)
00446 STILL_LINKED.error ("ELIST_ITERATOR::add_before_then_move", ABORT, NULL);
00447 #endif
00448
00449 if (list->empty ()) {
00450 new_element->next = new_element;
00451 list->last = new_element;
00452 prev = next = new_element;
00453 }
00454 else {
00455 prev->next = new_element;
00456 if (current) {
00457 new_element->next = current;
00458 next = current;
00459 }
00460 else {
00461 new_element->next = next;
00462 if (ex_current_was_last)
00463 list->last = new_element;
00464 if (ex_current_was_cycle_pt)
00465 cycle_pt = new_element;
00466 }
00467 }
00468 current = new_element;
00469 }
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479 inline void ELIST_ITERATOR::add_before_stay_put(
00480 ELIST_LINK *new_element) {
00481 #ifndef NDEBUG
00482 if (!this)
00483 NULL_OBJECT.error ("ELIST_ITERATOR::add_before_stay_put", ABORT, NULL);
00484 if (!list)
00485 NO_LIST.error ("ELIST_ITERATOR::add_before_stay_put", ABORT, NULL);
00486 if (!new_element)
00487 BAD_PARAMETER.error ("ELIST_ITERATOR::add_before_stay_put", ABORT,
00488 "new_element is NULL");
00489 if (new_element->next)
00490 STILL_LINKED.error ("ELIST_ITERATOR::add_before_stay_put", ABORT, NULL);
00491 #endif
00492
00493 if (list->empty ()) {
00494 new_element->next = new_element;
00495 list->last = new_element;
00496 prev = next = new_element;
00497 ex_current_was_last = TRUE;
00498 current = NULL;
00499 }
00500 else {
00501 prev->next = new_element;
00502 if (current) {
00503 new_element->next = current;
00504 if (next == current)
00505 next = new_element;
00506 }
00507 else {
00508 new_element->next = next;
00509 if (ex_current_was_last)
00510 list->last = new_element;
00511 }
00512 prev = new_element;
00513 }
00514 }
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524 inline void ELIST_ITERATOR::add_list_after(ELIST *list_to_add) {
00525 #ifndef NDEBUG
00526 if (!this)
00527 NULL_OBJECT.error ("ELIST_ITERATOR::add_list_after", ABORT, NULL);
00528 if (!list)
00529 NO_LIST.error ("ELIST_ITERATOR::add_list_after", ABORT, NULL);
00530 if (!list_to_add)
00531 BAD_PARAMETER.error ("ELIST_ITERATOR::add_list_after", ABORT,
00532 "list_to_add is NULL");
00533 #endif
00534
00535 if (!list_to_add->empty ()) {
00536 if (list->empty ()) {
00537 list->last = list_to_add->last;
00538 prev = list->last;
00539 next = list->First ();
00540 ex_current_was_last = TRUE;
00541 current = NULL;
00542 }
00543 else {
00544 if (current) {
00545 current->next = list_to_add->First ();
00546 if (current == list->last)
00547 list->last = list_to_add->last;
00548 list_to_add->last->next = next;
00549 next = current->next;
00550 }
00551 else {
00552 prev->next = list_to_add->First ();
00553 if (ex_current_was_last) {
00554 list->last = list_to_add->last;
00555 ex_current_was_last = FALSE;
00556 }
00557 list_to_add->last->next = next;
00558 next = prev->next;
00559 }
00560 }
00561 list_to_add->last = NULL;
00562 }
00563 }
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574 inline void ELIST_ITERATOR::add_list_before(ELIST *list_to_add) {
00575 #ifndef NDEBUG
00576 if (!this)
00577 NULL_OBJECT.error ("ELIST_ITERATOR::add_list_before", ABORT, NULL);
00578 if (!list)
00579 NO_LIST.error ("ELIST_ITERATOR::add_list_before", ABORT, NULL);
00580 if (!list_to_add)
00581 BAD_PARAMETER.error ("ELIST_ITERATOR::add_list_before", ABORT,
00582 "list_to_add is NULL");
00583 #endif
00584
00585 if (!list_to_add->empty ()) {
00586 if (list->empty ()) {
00587 list->last = list_to_add->last;
00588 prev = list->last;
00589 current = list->First ();
00590 next = current->next;
00591 ex_current_was_last = FALSE;
00592 }
00593 else {
00594 prev->next = list_to_add->First ();
00595 if (current) {
00596 list_to_add->last->next = current;
00597 }
00598 else {
00599 list_to_add->last->next = next;
00600 if (ex_current_was_last)
00601 list->last = list_to_add->last;
00602 if (ex_current_was_cycle_pt)
00603 cycle_pt = prev->next;
00604 }
00605 current = prev->next;
00606 next = current->next;
00607 }
00608 list_to_add->last = NULL;
00609 }
00610 }
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622 inline ELIST_LINK *ELIST_ITERATOR::extract() {
00623 ELIST_LINK *extracted_link;
00624
00625 #ifndef NDEBUG
00626 if (!this)
00627 NULL_OBJECT.error ("ELIST_ITERATOR::extract", ABORT, NULL);
00628 if (!list)
00629 NO_LIST.error ("ELIST_ITERATOR::extract", ABORT, NULL);
00630 if (!current)
00631
00632 NULL_CURRENT.error ("ELIST_ITERATOR::extract",
00633 ABORT, NULL);
00634 #endif
00635
00636 if (list->singleton()) {
00637
00638 prev = next = list->last = NULL;
00639 } else {
00640 prev->next = next;
00641
00642 if (current == list->last) {
00643 list->last = prev;
00644 ex_current_was_last = TRUE;
00645 } else {
00646 ex_current_was_last = FALSE;
00647 }
00648 }
00649
00650 ex_current_was_cycle_pt = (current == cycle_pt) ? TRUE : FALSE;
00651 extracted_link = current;
00652 extracted_link->next = NULL;
00653 current = NULL;
00654 return extracted_link;
00655 }
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665 inline ELIST_LINK *ELIST_ITERATOR::move_to_first() {
00666 #ifndef NDEBUG
00667 if (!this)
00668 NULL_OBJECT.error ("ELIST_ITERATOR::move_to_first", ABORT, NULL);
00669 if (!list)
00670 NO_LIST.error ("ELIST_ITERATOR::move_to_first", ABORT, NULL);
00671 #endif
00672
00673 current = list->First ();
00674 prev = list->last;
00675 next = current ? current->next : NULL;
00676 return current;
00677 }
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691 inline void ELIST_ITERATOR::mark_cycle_pt() {
00692 #ifndef NDEBUG
00693 if (!this)
00694 NULL_OBJECT.error ("ELIST_ITERATOR::mark_cycle_pt", ABORT, NULL);
00695 if (!list)
00696 NO_LIST.error ("ELIST_ITERATOR::mark_cycle_pt", ABORT, NULL);
00697 #endif
00698
00699 if (current)
00700 cycle_pt = current;
00701 else
00702 ex_current_was_cycle_pt = TRUE;
00703 started_cycling = FALSE;
00704 }
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714 inline bool ELIST_ITERATOR::at_first() {
00715 #ifndef NDEBUG
00716 if (!this)
00717 NULL_OBJECT.error ("ELIST_ITERATOR::at_first", ABORT, NULL);
00718 if (!list)
00719 NO_LIST.error ("ELIST_ITERATOR::at_first", ABORT, NULL);
00720 #endif
00721
00722
00723 return ((list->empty ()) || (current == list->First ()) || ((current == NULL) &&
00724 (prev == list->last) &&
00725 !ex_current_was_last));
00726 }
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736 inline bool ELIST_ITERATOR::at_last() {
00737 #ifndef NDEBUG
00738 if (!this)
00739 NULL_OBJECT.error ("ELIST_ITERATOR::at_last", ABORT, NULL);
00740 if (!list)
00741 NO_LIST.error ("ELIST_ITERATOR::at_last", ABORT, NULL);
00742 #endif
00743
00744
00745 return ((list->empty ()) || (current == list->last) || ((current == NULL) &&
00746 (prev == list->last) &&
00747 ex_current_was_last));
00748 }
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758 inline bool ELIST_ITERATOR::cycled_list() {
00759 #ifndef NDEBUG
00760 if (!this)
00761 NULL_OBJECT.error ("ELIST_ITERATOR::cycled_list", ABORT, NULL);
00762 if (!list)
00763 NO_LIST.error ("ELIST_ITERATOR::cycled_list", ABORT, NULL);
00764 #endif
00765
00766 return ((list->empty ()) || ((current == cycle_pt) && started_cycling));
00767
00768 }
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778 inline inT32 ELIST_ITERATOR::length() {
00779 #ifndef NDEBUG
00780 if (!this)
00781 NULL_OBJECT.error ("ELIST_ITERATOR::length", ABORT, NULL);
00782 if (!list)
00783 NO_LIST.error ("ELIST_ITERATOR::length", ABORT, NULL);
00784 #endif
00785
00786 return list->length ();
00787 }
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797 inline void
00798 ELIST_ITERATOR::sort (
00799 int comparator (
00800 const void *, const void *)) {
00801 #ifndef NDEBUG
00802 if (!this)
00803 NULL_OBJECT.error ("ELIST_ITERATOR::sort", ABORT, NULL);
00804 if (!list)
00805 NO_LIST.error ("ELIST_ITERATOR::sort", ABORT, NULL);
00806 #endif
00807
00808 list->sort (comparator);
00809 move_to_first();
00810 }
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823 inline void ELIST_ITERATOR::add_to_end(
00824 ELIST_LINK *new_element) {
00825 #ifndef NDEBUG
00826 if (!this)
00827 NULL_OBJECT.error ("ELIST_ITERATOR::add_to_end", ABORT, NULL);
00828 if (!list)
00829 NO_LIST.error ("ELIST_ITERATOR::add_to_end", ABORT, NULL);
00830 if (!new_element)
00831 BAD_PARAMETER.error ("ELIST_ITERATOR::add_to_end", ABORT,
00832 "new_element is NULL");
00833 if (new_element->next)
00834 STILL_LINKED.error ("ELIST_ITERATOR::add_to_end", ABORT, NULL);
00835 #endif
00836
00837 if (this->at_last ()) {
00838 this->add_after_stay_put (new_element);
00839 }
00840 else {
00841 if (this->at_first ()) {
00842 this->add_before_stay_put (new_element);
00843 list->last = new_element;
00844 }
00845 else {
00846 new_element->next = list->last->next;
00847 list->last->next = new_element;
00848 list->last = new_element;
00849 }
00850 }
00851 }
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864 #define QUOTE_IT( parm ) #parm
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896 #define ELISTIZEH_A(CLASSNAME) \
00897 \
00898 extern DLLSYM void CLASSNAME##_zapper(ELIST_LINK* link);
00899
00900 #define ELISTIZEH_B(CLASSNAME) \
00901 \
00902
00903
00904
00905
00906
00907 \
00908 \
00909 class DLLSYM CLASSNAME##_LIST : public ELIST \
00910 { \
00911 public: \
00912 CLASSNAME##_LIST():ELIST() {}\
00913 \
00914 \
00915 CLASSNAME##_LIST( \
00916 const CLASSNAME##_LIST&) \
00917 { DONT_CONSTRUCT_LIST_BY_COPY.error( QUOTE_IT( CLASSNAME##_LIST ), \
00918 ABORT, NULL ); } \
00919 \
00920 void clear() \
00921 { ELIST::internal_clear( &CLASSNAME##_zapper ); } \
00922 \
00923 ~CLASSNAME##_LIST() \
00924 { clear(); } \
00925 \
00926 \
00927 void deep_copy(const CLASSNAME##_LIST* src_list, \
00928 CLASSNAME* (*copier)(const CLASSNAME*)); \
00929 \
00930 void operator=( \
00931 const CLASSNAME##_LIST&) \
00932 { DONT_ASSIGN_LISTS.error( QUOTE_IT( CLASSNAME##_LIST ), \
00933 ABORT, NULL ); }
00934
00935 #define ELISTIZEH_C( CLASSNAME ) \
00936 }; \
00937 \
00938 \
00939 \
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949 \
00950 \
00951 class DLLSYM CLASSNAME##_IT : public ELIST_ITERATOR \
00952 { \
00953 public: \
00954 CLASSNAME##_IT():ELIST_ITERATOR(){} \
00955 \
00956 CLASSNAME##_IT( \
00957 CLASSNAME##_LIST* list):ELIST_ITERATOR(list){} \
00958 \
00959 CLASSNAME* data() \
00960 { return (CLASSNAME*) ELIST_ITERATOR::data(); } \
00961 \
00962 CLASSNAME* data_relative( \
00963 inT8 offset) \
00964 { return (CLASSNAME*) ELIST_ITERATOR::data_relative( offset ); } \
00965 \
00966 CLASSNAME* forward() \
00967 { return (CLASSNAME*) ELIST_ITERATOR::forward(); } \
00968 \
00969 CLASSNAME* extract() \
00970 { return (CLASSNAME*) ELIST_ITERATOR::extract(); } \
00971 \
00972 CLASSNAME* move_to_first() \
00973 { return (CLASSNAME*) ELIST_ITERATOR::move_to_first(); } \
00974 \
00975 CLASSNAME* move_to_last() \
00976 { return (CLASSNAME*) ELIST_ITERATOR::move_to_last(); } \
00977 };
00978
00979 #define ELISTIZEH( CLASSNAME ) \
00980 \
00981 ELISTIZEH_A( CLASSNAME ) \
00982 \
00983 ELISTIZEH_B( CLASSNAME ) \
00984 \
00985 ELISTIZEH_C( CLASSNAME )
00986
00987
00988
00989
00990
00991
00992 #define ELISTIZE(CLASSNAME) \
00993 \
00994
00995
00996
00997
00998
00999
01000
01001 \
01002 \
01003 DLLSYM void CLASSNAME##_zapper(ELIST_LINK* link) { \
01004 delete reinterpret_cast<CLASSNAME*>(link); \
01005 } \
01006 \
01007 \
01008 void CLASSNAME##_LIST::deep_copy(const CLASSNAME##_LIST* src_list, \
01009 CLASSNAME* (*copier)(const CLASSNAME*)) { \
01010 \
01011 CLASSNAME##_IT from_it(const_cast<CLASSNAME##_LIST*>(src_list)); \
01012 CLASSNAME##_IT to_it(this); \
01013 \
01014 for (from_it.mark_cycle_pt(); !from_it.cycled_list(); from_it.forward()) \
01015 to_it.add_after_then_move((*copier)(from_it.data())); \
01016 }
01017
01018 #endif