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