Bump S-nail v14.9.25.ar ("Lubimy Gorod"), 2024-06-27
[s-mailx.git] / include / su / view.h
blob78d78c8a862cc0c6a74d7172af417ea221df082e
1 /*@ Generic C++ View (-of-a-collection, for iterating plus purposes) templates.
2 *@ (Merely of interest when creating a new C++ collection type.)
4 * Copyright (c) 2001 - 2020 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
5 * SPDX-License-Identifier: ISC
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 #ifndef su_VIEW_H
20 # define su_VIEW_H
21 #define su_CXX_HEADER
22 #include <su/code-in.h>
23 NSPC_BEGIN(su)
24 template<class BASECOLLT, class KEYT, class T> class view_traits;
25 template<class VIEWTRAITS, class GBASEVIEWT> class view__base;
26 template<class VIEWTRAITS, class GBASEVIEWT> class view_unidir;
27 template<class VIEWTRAITS, class GBASEVIEWT> class view_unidir_const;
28 template<class VIEWTRAITS, class GBASEVIEWT> class view_bidir;
29 template<class VIEWTRAITS, class GBASEVIEWT> class view_bidir_const;
30 template<class VIEWTRAITS, class GBASEVIEWT> class view_random;
31 template<class VIEWTRAITS, class GBASEVIEWT> class view_random_const;
32 template<class VIEWTRAITS, class GBASEVIEWT> class view_assoc_unidir;
33 template<class VIEWTRAITS, class GBASEVIEWT> class view_assoc_unidir_const;
34 template<class VIEWTRAITS, class GBASEVIEWT> class view_assoc_bidir;
35 template<class VIEWTRAITS, class GBASEVIEWT> class view_assoc_bidir_const;
36 enum view_category{
37 view_category_non_assoc,
38 view_category_assoc
40 enum view_type{
41 view_type_unidir,
42 view_type_bidir,
43 view_type_random,
44 view_type_assoc_unidir,
45 view_type_assoc_bidir
47 template<class BASECOLLT, class KEYT, class T>
48 class view_traits{
49 public:
50 typedef BASECOLLT base_coll_type;
51 // Identical to normal traits except for view_category_assoc views
52 typedef NSPC(su)type_traits<KEYT> key_type_traits;
53 typedef NSPC(su)type_traits<T> type_traits;
55 /* @} */
56 // class view__base{{{
57 template<class VIEWTRAITS, class GBASEVIEWT>
58 class view__base{
59 protected:
60 GBASEVIEWT m_view;
61 view__base(void) : m_view() {}
62 view__base(view__base const &t) : m_view(t.m_view) {}
63 public:
64 ~view__base(void) {}
65 protected:
66 view__base &assign(view__base const &t){
67 m_view = t.m_view;
68 return *this;
70 view__base &operator=(view__base const &t) {return assign(t);}
71 public:
72 boole is_setup(void) const {return m_view.is_setup();}
73 boole is_same_parent(view__base const &t) const{
74 return m_view.is_same_parent(t.m_view);
76 boole is_valid(void) const {return m_view.is_valid();}
77 operator boole(void) const {return is_valid();}
78 protected:
79 view__base &reset(void){
80 (void)m_view.reset();
81 return *this;
83 sz cmp(view__base const &t) const {return m_view.cmp(t.m_view);}
84 public:
85 boole is_equal(view__base const &t) const {return (cmp(t) == 0);}
86 boole operator==(view__base const &t) const {return (cmp(t) == 0);}
87 boole operator!=(view__base const &t) const {return (cmp(t) != 0);}
89 // }}}
90 // Because of the various sorts of views we define helper macros.
91 // Unfortunately GCC (up to and including 3.4.2) cannot access
92 // base& _x ... _x.m_view
93 // ("is protected within this context"), but can only access
94 // base& _x ... MYSELF& y = _x ... y.m_view
95 // (and only so if we put a "using" directive, see su__VIEW_IMPL_START__BASE).
96 // To be (hopefully..) absolutely safe use a C-style cast
97 #define su__VIEW_DOWNCAST(X) ((su__VIEW_NAME&)X)
98 #define su__VIEW_IMPL_START /*{{{*/\
99 template<class VIEWTRAITS, class GBASEVIEWT>\
100 class su__VIEW_NAME : public view__base<VIEWTRAITS,GBASEVIEWT>{\
101 typedef su__VIEW_NAME<VIEWTRAITS,GBASEVIEWT> myself;\
102 typedef view__base<VIEWTRAITS,GBASEVIEWT> base;\
104 /* XXX All these typedefs could be moved to class view__base!? */\
105 typedef typename VIEWTRAITS::base_coll_type base_coll_type;\
106 typedef typename VIEWTRAITS::key_type_traits key_type_traits;\
107 typedef typename VIEWTRAITS::type_traits type_traits;\
109 /* (Simply add _key_ - for non-associative this is eq tp_const) */\
110 typedef typename key_type_traits::tp_const key_tp_const;\
111 typedef typename type_traits::type type;\
112 typedef typename type_traits::tp tp;\
113 typedef typename type_traits::tp_const tp_const;\
115 protected:\
116 /* (GCC (up to and incl. 3.4.2) does not find it otherwise) */\
117 using base::m_view;\
119 public:\
120 static NSPC(su)view_category const view_category = su__VIEW_CATEGORY;\
121 static NSPC(su)view_type const view_type = su__VIEW_TYPE;\
123 su__VIEW_NAME(void) : base() {}\
124 template<class TCOLL> explicit su__VIEW_NAME(TCOLL &tc) : base(){\
125 (void)m_view.setup(S(base_coll_type&,tc)).begin();\
127 /* (Need to offer all forms to allow additional TCOLL template(s)..) */\
128 su__VIEW_NAME(su__VIEW_NAME &t) : base(t) {}\
129 su__VIEW_NAME(su__VIEW_NAME const &t) : base(t) {}\
130 ~su__VIEW_NAME(void) {}\
132 su__VIEW_NAME &assign(su__VIEW_NAME const &t){\
133 return S(myself&,base::assign(t));\
135 su__VIEW_NAME &operator=(su__VIEW_NAME const &t) {return assign(t);}\
137 using base::is_setup;\
138 template<class TCOLL> su__VIEW_NAME &setup(TCOLL &tc){\
139 (void)m_view.setup(S(base_coll_type&,tc));\
140 return *this;\
143 using base::is_same_parent;\
145 using base::is_valid;\
146 using base::operator boole;\
148 su__VIEW_NAME &reset(void) {return S(myself&,base::reset());}\
150 tp_const data(void) const{\
151 ASSERT_RET(is_valid(), NIL);\
152 return type_traits::to_const_tp(m_view.data());\
154 tp_const operator*(void) const {return data();}\
155 tp_const operator->(void) const {return data();}\
157 su__VIEW_NAME &begin(void){\
158 ASSERT_RET(is_setup(), *this);\
159 (void)m_view.begin();\
160 return *this;\
162 template<class TCOLL> su__VIEW_NAME &begin(TCOLL &tc){\
163 (void)m_view.setup(S(base_coll_type&,tc)).begin();\
164 return *this;\
167 boole has_next(void) const{\
168 ASSERT_RET(is_valid(), FAL0);\
169 return m_view.has_next();\
171 su__VIEW_NAME &next(void){\
172 ASSERT_RET(is_valid(), *this);\
173 (void)m_view.next();\
174 return *this;\
176 su__VIEW_NAME &operator++(void) {return next();}\
178 using base::is_equal;\
179 using base::operator==;\
180 using base::operator!=;\
181 /*}}} }*/
182 #define su__VIEW_IMPL_NONCONST /*{{{*/\
183 tp data(void){\
184 ASSERT_RET(is_valid(), NIL);\
185 return type_traits::to_tp(m_view.data());\
187 s32 set_data(tp dat){\
188 ASSERT_RET(is_valid(), err::einval);\
189 return m_view.set_data(type_traits::to_vp(dat));\
191 tp operator*(void) {return data();}\
192 tp operator->(void) {return data();}\
194 su__VIEW_NAME &remove(void){\
195 ASSERT_RET(is_valid(), *this);\
196 (void)m_view.remove();\
197 return *this;\
199 /*}}}*/
200 #define su__VIEW_IMPL_CONST /*{{{*/\
201 /* (We need to cast away the 'const', but it is preserved logically..) */\
202 template<class TCOLL> explicit su__VIEW_NAME(TCOLL const &tc){\
203 (void)m_view.setup(S(base_coll_type&,C(TCOLL&,tc))).begin();\
205 /* (Need to offer all copy-forms to allow TCOLL template..) */\
206 explicit su__VIEW_NAME(su__VIEW_NAME_NONCONST<VIEWTRAITS,GBASEVIEWT> &t)\
207 : base(t){\
209 explicit su__VIEW_NAME(\
210 su__VIEW_NAME_NONCONST<VIEWTRAITS,GBASEVIEWT> const &t) : base(t) {}\
212 su__VIEW_NAME &assign(\
213 su__VIEW_NAME_NONCONST<VIEWTRAITS,GBASEVIEWT> const &t){\
214 return S(myself&,base::assign(t));\
216 su__VIEW_NAME &operator=(\
217 su__VIEW_NAME_NONCONST<VIEWTRAITS,GBASEVIEWT> const &t){\
218 return assign(t);\
221 /* (We need to cast away the 'const', but it is preserved logically..) */\
222 template<class TCOLL> su__VIEW_NAME &setup(TCOLL const &tc){\
223 (void)m_view.setup(S(base_coll_type&,C(TCOLL&,tc)));\
224 return *this;\
226 /*}}}*/
227 #define su__VIEW_IMPL_NONASSOC
228 #define su__VIEW_IMPL_NONASSOC_NONCONST /*{{{*/\
229 /* err::enone or error */\
230 s32 insert(tp dat){\
231 ASSERT_RET(is_setup(), err::einval);\
232 return m_view.insert(type_traits::to_vp(dat));\
234 s32 insert(base &startpos, base const &endpos){\
235 ASSERT_RET(is_setup(), err::einval);\
236 ASSERT_RET(startpos.is_valid(), err::einval);\
237 ASSERT_RET(!endpos.is_valid() || startpos.is_same_parent(endpos),\
238 err::einval);\
239 if(DBGOR(1, 0)){\
240 if(is_same_parent(startpos)){\
241 myself v(startpos);\
242 if(endpos.is_valid()){\
243 for(;; ++v)\
244 if(v == endpos)\
245 break;\
246 else if(!v || v == *this)\
247 return err::einval;\
248 }else{\
249 for(; v; ++v)\
250 if(v == *this)\
251 return err::einval;\
255 return m_view.insert_range(su__VIEW_DOWNCAST(startpos).m_view,\
256 su__VIEW_DOWNCAST(endpos).m_view);\
259 su__VIEW_NAME &remove(base &endpos){\
260 ASSERT_RET(is_valid(), *this);\
261 ASSERT_RET(!endpos.is_valid() || is_same_parent(endpos), *this);\
262 (void)m_view.remove_range(su__VIEW_DOWNCAST(endpos).m_view);\
263 return *this;\
265 /*}}}*/
266 #define su__VIEW_IMPL_NONASSOC_CONST
267 #define su__VIEW_IMPL_ASSOC /*{{{*/\
268 key_tp_const key(void) const{\
269 ASSERT_RET(is_valid(), NIL);\
270 return key_type_traits::to_const_tp(m_view.key());\
272 /*}}}*/
273 #define su__VIEW_IMPL_ASSOC_NONCONST /*{{{*/\
274 /* err::enone or error */\
275 s32 reset_insert(key_tp_const key, tp dat){\
276 ASSERT_RET(is_setup(), err::einval);\
277 return m_view.reset_insert(key_type_traits::to_const_vp(key),\
278 type_traits::to_vp(dat));\
280 /* err::enone or error */\
281 s32 reset_replace(key_tp_const key, tp dat){\
282 ASSERT_RET(is_setup(), err::einval);\
283 return m_view.reset_replace(key_type_traits::to_const_vp(key),\
284 type_traits::to_vp(dat));\
286 /*}}}*/
287 #define su__VIEW_IMPL_ASSOC_CONST
288 #define su__VIEW_IMPL_UNIDIR
289 #define su__VIEW_IMPL_UNIDIR_NONCONST
290 #define su__VIEW_IMPL_UNIDIR_CONST /*{{{*/\
291 /* (We need to cast away the 'const', but it is preserved logically..) */\
292 template<class TCOLL> su__VIEW_NAME &begin(TCOLL const &tc){\
293 (void)m_view.setup(S(base_coll_type&,C(TCOLL&,tc))).begin();\
294 return *this;\
296 /*}}}*/
297 #define su__VIEW_IMPL_UNIDIR_NONASSOC /*{{{*/\
298 /* is_valid() must be tested thereafter */\
299 su__VIEW_NAME &go_to(uz off){\
300 ASSERT_RET(is_setup(), *this);\
301 (void)m_view.go_to(off);\
302 return *this;\
305 boole find(tp_const dat, boole byptr=FAL0){\
306 ASSERT_RET(is_setup(), (reset(), FAL0));\
307 /* FIXME toolbox assert if !byptr */\
308 return m_view.find(type_traits::to_const_vp(dat), byptr);\
310 /*}}}*/
311 #define su__VIEW_IMPL_UNIDIR_ASSOC /*{{{*/\
312 boole find(key_tp_const key){\
313 ASSERT_RET(is_setup(), (reset(), FAL0));\
314 return m_view.find(key_type_traits::to_const_vp(key));\
316 /*}}}*/
317 #define su__VIEW_IMPL_BIDIR /*{{{*/\
318 su__VIEW_NAME &end(void){\
319 ASSERT_RET(is_setup(), *this);\
320 (void)m_view.end();\
321 return *this;\
324 boole has_last(void) const{\
325 ASSERT_RET(is_valid(), FAL0);\
326 return m_view.has_last();\
328 su__VIEW_NAME &last(void){\
329 ASSERT_RET(is_valid(), *this);\
330 (void)m_view.last();\
331 return *this;\
333 su__VIEW_NAME &operator--(void) {return last();}\
334 /*}}}*/
335 #define su__VIEW_IMPL_BIDIR_NONCONST /*{{{*/\
336 template<class TCOLL> su__VIEW_NAME &end(TCOLL &tc){\
337 (void)m_view.setup(S(base_coll_type&,tc)).end();\
338 return *this;\
340 /*}}}*/
341 #define su__VIEW_IMPL_BIDIR_CONST /*{{{*/\
342 /* (We need to cast away the 'const', but it is preserved logically..) */\
343 template<class TCOLL> su__VIEW_NAME &end(TCOLL const &tc){\
344 (void)m_view.setup(S(base_coll_type&,C(TCOLL&,tc))).end();\
345 return *this;\
347 /*}}}*/
348 #define su__VIEW_IMPL_BIDIR_NONASSOC /*{{{*/\
349 boole rfind(tp_const dat, boole byptr=FAL0){\
350 ASSERT_RET(is_setup(), (reset(), FAL0));\
351 /* FIXME toolbox assert if !byptr */\
352 return m_view.rfind(type_traits::to_const_vp(dat), byptr);\
354 /*}}}*/
355 #define su__VIEW_IMPL_BIDIR_ASSOC
356 #define su__VIEW_IMPL_RANDOM
357 #define su__VIEW_IMPL_RANDOM_NONCONST
358 #define su__VIEW_IMPL_RANDOM_CONST
359 #define su__VIEW_IMPL_RANDOM_NONASSOC /*{{{*/\
360 /* is_valid() must be tested thereafter */\
361 su__VIEW_NAME &go_around(sz reloff){\
362 ASSERT_RET(is_valid(), *this);\
363 return m_view.go_around(reloff);\
365 su__VIEW_NAME &operator+=(sz reloff) {return go_around(reloff);}\
366 su__VIEW_NAME &operator-=(sz reloff) {return go_around(-reloff);}\
367 su__VIEW_NAME operator+(sz reloff) const{\
368 su__VIEW_NAME rv(*this);\
369 ASSERT_RET(is_valid(), rv);\
370 return (rv += reloff);\
372 su__VIEW_NAME operator-(sz reloff) const{\
373 su__VIEW_NAME rv(*this);\
374 ASSERT_RET(is_valid(), rv);\
375 return (rv -= reloff);\
378 boole operator<(base const &t) const {return (base::cmp(t) < 0);}\
379 boole operator>(base const &t) const {return (base::cmp(t) > 0);}\
380 boole operator<=(base const &t) const {return (base::cmp(t) <= 0);}\
381 boole operator>=(base const &t) const {return (base::cmp(t) >= 0);}\
382 /*}}}*/
383 #define su__VIEW_IMPL_RANDOM_ASSOC
384 #define su__VIEW_IMPL_END };
385 // Puuuh. Let us go! {{{
386 #undef su__VIEW_CATEGORY
387 #define su__VIEW_CATEGORY view_category_non_assoc
388 #undef su__VIEW_TYPE
389 #define su__VIEW_TYPE view_type_unidir
390 #undef su__VIEW_NAME
391 #undef su__VIEW_NAME_NONCONST
392 #define su__VIEW_NAME view_unidir
393 #define su__VIEW_NAME_NONCONST view_unidir
394 su__VIEW_IMPL_START
395 su__VIEW_IMPL_NONCONST
396 su__VIEW_IMPL_NONASSOC
397 su__VIEW_IMPL_NONASSOC_NONCONST
398 su__VIEW_IMPL_UNIDIR
399 su__VIEW_IMPL_UNIDIR_NONCONST
400 su__VIEW_IMPL_UNIDIR_NONASSOC
401 su__VIEW_IMPL_END
402 #undef su__VIEW_NAME
403 #define su__VIEW_NAME view_unidir_const
404 su__VIEW_IMPL_START
405 su__VIEW_IMPL_CONST
406 su__VIEW_IMPL_NONASSOC
407 su__VIEW_IMPL_NONASSOC_CONST
408 su__VIEW_IMPL_UNIDIR
409 su__VIEW_IMPL_UNIDIR_CONST
410 su__VIEW_IMPL_UNIDIR_NONASSOC
411 su__VIEW_IMPL_END
412 #undef su__VIEW_TYPE
413 #define su__VIEW_TYPE view_type_bidir
414 #undef su__VIEW_NAME
415 #undef su__VIEW_NAME_NONCONST
416 #define su__VIEW_NAME view_bidir
417 #define su__VIEW_NAME_NONCONST view_bidir
418 su__VIEW_IMPL_START
419 su__VIEW_IMPL_NONCONST
420 su__VIEW_IMPL_NONASSOC
421 su__VIEW_IMPL_NONASSOC_NONCONST
422 su__VIEW_IMPL_UNIDIR
423 su__VIEW_IMPL_UNIDIR_NONCONST
424 su__VIEW_IMPL_UNIDIR_NONASSOC
425 su__VIEW_IMPL_BIDIR
426 su__VIEW_IMPL_BIDIR_NONCONST
427 su__VIEW_IMPL_BIDIR_NONASSOC
428 su__VIEW_IMPL_END
429 #undef su__VIEW_NAME
430 #define su__VIEW_NAME view_bidir_const
431 su__VIEW_IMPL_START
432 su__VIEW_IMPL_CONST
433 su__VIEW_IMPL_NONASSOC
434 su__VIEW_IMPL_NONASSOC_CONST
435 su__VIEW_IMPL_UNIDIR
436 su__VIEW_IMPL_UNIDIR_CONST
437 su__VIEW_IMPL_UNIDIR_NONASSOC
438 su__VIEW_IMPL_BIDIR
439 su__VIEW_IMPL_BIDIR_CONST
440 su__VIEW_IMPL_BIDIR_NONASSOC
441 su__VIEW_IMPL_END
442 #undef su__VIEW_TYPE
443 #define su__VIEW_TYPE view_type_random
444 #undef su__VIEW_NAME
445 #undef su__VIEW_NAME_NONCONST
446 #define su__VIEW_NAME view_random
447 #define su__VIEW_NAME_NONCONST view_random
448 su__VIEW_IMPL_START
449 su__VIEW_IMPL_NONCONST
450 su__VIEW_IMPL_NONASSOC
451 su__VIEW_IMPL_NONASSOC_NONCONST
452 su__VIEW_IMPL_UNIDIR
453 su__VIEW_IMPL_UNIDIR_NONCONST
454 su__VIEW_IMPL_UNIDIR_NONASSOC
455 su__VIEW_IMPL_BIDIR
456 su__VIEW_IMPL_BIDIR_NONCONST
457 su__VIEW_IMPL_BIDIR_NONASSOC
458 su__VIEW_IMPL_RANDOM
459 su__VIEW_IMPL_RANDOM_NONCONST
460 su__VIEW_IMPL_RANDOM_NONASSOC
461 su__VIEW_IMPL_END
462 #undef su__VIEW_NAME
463 #define su__VIEW_NAME view_random_const
464 su__VIEW_IMPL_START
465 su__VIEW_IMPL_CONST
466 su__VIEW_IMPL_NONASSOC
467 su__VIEW_IMPL_NONASSOC_CONST
468 su__VIEW_IMPL_UNIDIR
469 su__VIEW_IMPL_UNIDIR_CONST
470 su__VIEW_IMPL_UNIDIR_NONASSOC
471 su__VIEW_IMPL_BIDIR
472 su__VIEW_IMPL_BIDIR_CONST
473 su__VIEW_IMPL_BIDIR_NONASSOC
474 su__VIEW_IMPL_RANDOM
475 su__VIEW_IMPL_RANDOM_CONST
476 su__VIEW_IMPL_RANDOM_NONASSOC
477 su__VIEW_IMPL_END
478 #undef su__VIEW_CATEGORY
479 #define su__VIEW_CATEGORY view_category_assoc
480 #undef su__VIEW_TYPE
481 #define su__VIEW_TYPE view_type_assoc_unidir
482 #undef su__VIEW_NAME
483 #undef su__VIEW_NAME_NONCONST
484 #define su__VIEW_NAME view_assoc_unidir
485 #define su__VIEW_NAME_NONCONST view_assoc_unidir
486 su__VIEW_IMPL_START
487 su__VIEW_IMPL_NONCONST
488 su__VIEW_IMPL_ASSOC
489 su__VIEW_IMPL_ASSOC_NONCONST
490 su__VIEW_IMPL_UNIDIR
491 su__VIEW_IMPL_UNIDIR_NONCONST
492 su__VIEW_IMPL_UNIDIR_ASSOC
493 su__VIEW_IMPL_END
494 #undef su__VIEW_NAME
495 #define su__VIEW_NAME view_assoc_unidir_const
496 su__VIEW_IMPL_START
497 su__VIEW_IMPL_CONST
498 su__VIEW_IMPL_ASSOC
499 su__VIEW_IMPL_ASSOC_CONST
500 su__VIEW_IMPL_UNIDIR
501 su__VIEW_IMPL_UNIDIR_CONST
502 su__VIEW_IMPL_UNIDIR_ASSOC
503 su__VIEW_IMPL_END
504 #undef su__VIEW_TYPE
505 #define su__VIEW_TYPE view_type_assoc_bidir
506 #undef su__VIEW_NAME
507 #undef su__VIEW_NAME_NONCONST
508 #define su__VIEW_NAME view_assoc_bidir
509 #define su__VIEW_NAME_NONCONST view_assoc_bidir
510 su__VIEW_IMPL_START
511 su__VIEW_IMPL_NONCONST
512 su__VIEW_IMPL_ASSOC
513 su__VIEW_IMPL_ASSOC_NONCONST
514 su__VIEW_IMPL_UNIDIR
515 su__VIEW_IMPL_UNIDIR_NONCONST
516 su__VIEW_IMPL_UNIDIR_ASSOC
517 su__VIEW_IMPL_BIDIR
518 su__VIEW_IMPL_BIDIR_NONCONST
519 su__VIEW_IMPL_BIDIR_ASSOC
520 su__VIEW_IMPL_END
521 #undef su__VIEW_NAME
522 #define su__VIEW_NAME view_assoc_bidir_const
523 su__VIEW_IMPL_START
524 su__VIEW_IMPL_CONST
525 su__VIEW_IMPL_ASSOC
526 su__VIEW_IMPL_ASSOC_CONST
527 su__VIEW_IMPL_UNIDIR
528 su__VIEW_IMPL_UNIDIR_CONST
529 su__VIEW_IMPL_UNIDIR_ASSOC
530 su__VIEW_IMPL_BIDIR
531 su__VIEW_IMPL_BIDIR_CONST
532 su__VIEW_IMPL_BIDIR_ASSOC
533 su__VIEW_IMPL_RANDOM
534 su__VIEW_IMPL_RANDOM_CONST
535 su__VIEW_IMPL_RANDOM_ASSOC
536 su__VIEW_IMPL_END
537 // }}}
538 // Cleanup {{{
539 #undef su__VIEW_DOWNCAST
540 #undef su__VIEW_IMPL_START
541 #undef su__VIEW_IMPL_NONCONST
542 #undef su__VIEW_IMPL_CONST
543 #undef su__VIEW_IMPL_NONASSOC
544 #undef su__VIEW_IMPL_NONASSOC_NONCONST
545 #undef su__VIEW_IMPL_NONASSOC_CONST
546 #undef su__VIEW_IMPL_ASSOC
547 #undef su__VIEW_IMPL_ASSOC_NONCONST
548 #undef su__VIEW_IMPL_ASSOC_CONST
549 #undef su__VIEW_IMPL_UNIDIR
550 #undef su__VIEW_IMPL_UNIDIR_NONCONST
551 #undef su__VIEW_IMPL_UNIDIR_CONST
552 #undef su__VIEW_IMPL_UNIDIR_NONASSOC
553 #undef su__VIEW_IMPL_UNIDIR_ASSOC
554 #undef su__VIEW_IMPL_BIDIR
555 #undef su__VIEW_IMPL_BIDIR_NONCONST
556 #undef su__VIEW_IMPL_BIDIR_CONST
557 #undef su__VIEW_IMPL_BIDIR_NONASSOC
558 #undef su__VIEW_IMPL_BIDIR_ASSOC
559 #undef su__VIEW_IMPL_RANDOM
560 #undef su__VIEW_IMPL_RANDOM_NONCONST
561 #undef su__VIEW_IMPL_RANDOM_CONST
562 #undef su__VIEW_IMPL_RANDOM_NONASSOC
563 #undef su__VIEW_IMPL_RANDOM_ASSOC
564 #undef su__VIEW_IMPL_END
565 #undef su__VIEW_CATEGORY
566 #undef su__VIEW_TYPE
567 #undef su__VIEW_NAME
568 #undef su__VIEW_NAME_NONCONST
569 // }}}
570 NSPC_END(su)
571 #include <su/code-ou.h>