Esempio n. 1
0
void ArrayData::newFullPos(FullPos &fp) {
  assert(fp.getContainer() == NULL);
  fp.setContainer(this);
  fp.setNext(strongIterators());
  setStrongIterators(&fp);
  getFullPos(fp);
}
Esempio n. 2
0
void ArrayData::newFullPos(FullPos &fp) {
  ASSERT(fp.container == NULL);
  fp.container = this;
  fp.next = strongIterators();
  setStrongIterators(&fp);
  getFullPos(fp);
}
Esempio n. 3
0
void ArrayData::newFullPos(FullPos &fp) {
  assert(!fp.getContainer());
  fp.setContainer(this);
  fp.setNext(strongIterators());
  setStrongIterators(&fp);
  fp.m_pos = m_pos;
}
Esempio n. 4
0
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);
}
Esempio n. 5
0
void ArrayData::freeFullPos(FullPos &fp) {
  ASSERT(strongIterators() != 0 && fp.container == (ArrayData*)this);
  // search for fp in our list, then remove it.  Usually its the first one.
  FullPos* p = strongIterators();
  if (p == &fp) {
    setStrongIterators(p->next);
    fp.container = NULL;
    return;
  }
  for (; p->next; p = p->next) {
    if (p->next == &fp) {
      p->next = p->next->next;
      fp.container = 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);
}
Esempio n. 6
0
void ArrayData::freeStrongIterators() {
  for (FullPosRange r(strongIterators()); !r.empty(); r.popFront()) {
    r.front()->setContainer(NULL);
  }
  setStrongIterators(0);
}