void ArrayData::newFullPos(FullPos &fp) { assert(fp.getContainer() == NULL); fp.setContainer(this); fp.setNext(strongIterators()); setStrongIterators(&fp); getFullPos(fp); }
void ArrayData::newFullPos(FullPos &fp) { assert(!fp.getContainer()); fp.setContainer(this); fp.setNext(strongIterators()); setStrongIterators(&fp); fp.m_pos = m_pos; }
void ArrayData::freeFullPos(FullPos &fp) { assert(strongIterators() != 0 && fp.getContainer() == (ArrayData*)this); // search for fp in our list, then remove it. Usually its the first one. FullPos* p = strongIterators(); if (p == &fp) { setStrongIterators(p->getNext()); fp.setContainer(NULL); return; } for (; p->getNext(); p = p->getNext()) { if (p->getNext() == &fp) { p->setNext(p->getNext()->getNext()); fp.setContainer(NULL); return; } } // If the strong iterator list was empty or if fp could not be // found in the strong iterator list, then we are in a bad state assert(false); }