48 #include "dcmtk/config/osconfig.h"
49 #include "dcmtk/ofstd/oftypes.h"
50 #include "dcmtk/ofstd/ofcast.h"
52 #ifndef HAVE_CLASS_TEMPLATE
53 #error Your C++ compiler cannot handle class templates:
56 #if defined(HAVE_STL) || defined(HAVE_STL_LIST)
64 #ifdef HAVE_STD_NAMESPACE
65 #define OFList std::list
66 #define OFListIterator(x) std::list< x >::iterator
67 #define OFListConstIterator(x) std::list< x >::const_iterator
70 #define OFListIterator(x) list< x >::iterator
71 #define OFListConstIterator(x) list< x >::const_iterator
74 #define OFListInsert(InputIterator, T, c, pos, first, last) (c).insert((pos), (first), (last))
75 #define OFListRemoveIf(Predicate, T, c, pred) (c).remove_if((pred))
78 #define OFLIST_TYPENAME OFTypename
82 #define INCLUDE_CASSERT
83 #define INCLUDE_CSTDDEF
84 #include "dcmtk/ofstd/ofstdinc.h"
86 #define OFLIST_TYPENAME
89 #ifdef HAVE_SYS_TYPES_H
91 #include <sys/types.h>
123 void base_recalcListSize();
129 OFBool base_empty()
const {
return afterLast == afterLast->next; }
130 size_t base_size()
const {
return listSize; }
223 assert(!
node->dummy);
313 while (vfirst != vend)
353 OFBool
empty()
const {
return OFListBase::base_empty(); }
358 size_t size()
const {
return OFListBase::base_size(); }
423 while (position != last) position =
erase(position);
430 void clear() { OFListBase::base_clear(); }
451 splice(position, x, change, i);
464 OFListBase::base_splice(position.
node, first.
node, last.
node);
472 void remove(
const T& value)
478 if (*first == value) first =
erase(first);
491 #ifdef HAVE_FUNCTION_TEMPLATE
493 #define OFListInsert(InputIterator, T, c, pos, first, last) OF_ListInsert((c), (pos), (first), (last))
495 #define OFListRemoveIf(Predicate, T, c, pred) OF_ListRemoveIf((c), (pred))
497 #elif defined(HAVE_STATIC_TEMPLATE_METHOD)
499 #define OFListInsert(InputIterator, T, c, pos, first, last) OF_ListInsertClass<InputIterator, T>::OF_ListInsert((c), (pos), (first), (last))
501 #define OFListRemoveIf(Predicate, T, c, pred) OF_ListRemoveIfClass<Predicate, T>::OF_ListRemoveIf((c), (pred))
504 #error Your C++ Compiler is not capable of compiling this code
508 template <
class InputIterator,
class T>
509 #if defined(HAVE_STATIC_TEMPLATE_METHOD) && !defined(HAVE_FUNCTION_TEMPLATE)
510 class OF_ListInsertClass
516 InputIterator first, InputIterator last)
520 c.
insert(position, *first);
524 #if defined(HAVE_STATIC_TEMPLATE_METHOD) && !defined(HAVE_FUNCTION_TEMPLATE)
530 template <
class Predicate,
class T>
531 #if defined(HAVE_STATIC_TEMPLATE_METHOD) && !defined(HAVE_FUNCTION_TEMPLATE)
532 class OF_ListRemoveIfClass
537 void OF_ListRemoveIf(
OFList<T>& c, Predicate pred)
541 while (first != last)
544 first = c.
erase(first);
550 #if defined(HAVE_STATIC_TEMPLATE_METHOD) && !defined(HAVE_FUNCTION_TEMPLATE)
554 #define OFListIterator(x) OFIterator< x >
555 #define OFListConstIterator(x) OFIterator< x >