25 #include <tulip/BmdLink.h>
28 template <
typename TYPE>
31 typedef tlp::BmdLink<TYPE> BMDTYPE;
37 TYPE entry(BMDTYPE *it);
39 BMDTYPE *nextItem(BMDTYPE *p, BMDTYPE *predP);
40 BMDTYPE *predItem(BMDTYPE *p, BMDTYPE *succP);
41 BMDTYPE *cyclicPred(BMDTYPE *it, BMDTYPE *succIt);
42 BMDTYPE *cyclicSucc(BMDTYPE *it, BMDTYPE *predIt);
43 BMDTYPE *push(
const TYPE &a);
44 BMDTYPE *append(
const TYPE &a);
45 TYPE delItem(BMDTYPE *it);
49 void conc(BmdList<TYPE> &l);
51 void swap(BmdList<TYPE> &l);
59 #include <tulip/cxx/BmdList.cxx>
61 template <
typename TYPE>
62 struct BmdListIt :
public Iterator<TYPE> {
64 BmdListIt(BmdList<TYPE> &bmdList) : bmdList(bmdList) {
65 pos = bmdList.firstItem();
68 bool hasNext()
override {
69 return pos !=
nullptr;
71 TYPE next()
override {
72 TYPE val = pos->getData();
73 tlp::BmdLink<TYPE> *tmp = pos;
74 pos = bmdList.nextItem(pos, pred);
80 tlp::BmdLink<TYPE> *pos;
81 tlp::BmdLink<TYPE> *pred;
82 BmdList<TYPE> &bmdList;
85 template <
typename TYPE>
86 struct BmdListRevIt :
public Iterator<TYPE> {
87 BmdListRevIt(BmdList<TYPE> &bmdList) : bmdList(bmdList) {
88 pos = bmdList.lastItem();
91 bool hasNext()
override {
92 return pos !=
nullptr;
94 TYPE next()
override {
95 TYPE val = pos->getData();
96 tlp::BmdLink<TYPE> *tmp = pos;
97 pos = bmdList.predItem(pos, suc);
103 tlp::BmdLink<TYPE> *pos;
104 tlp::BmdLink<TYPE> *suc;
105 BmdList<TYPE> &bmdList;