示例#1
0
void ArrayData::newFullPos(FullPos &fp) {
  assert(fp.getContainer() == NULL);
  fp.setContainer(this);
  fp.setNext(strongIterators());
  setStrongIterators(&fp);
  getFullPos(fp);
}
示例#2
0
void ArrayData::newFullPos(FullPos &fp) {
  ASSERT(fp.container == NULL);
  fp.container = this;
  fp.next = strongIterators();
  setStrongIterators(&fp);
  getFullPos(fp);
}
示例#3
0
void ArrayData::newFullPos(FullPos &fp) {
  assert(!fp.getContainer());
  fp.setContainer(this);
  fp.setNext(strongIterators());
  setStrongIterators(&fp);
  fp.m_pos = m_pos;
}
示例#4
0
HOT_FUNC
ArrayData::~ArrayData() {
  // If there are any strong iterators pointing to this array, they need
  // to be invalidated.
  if (strongIterators()) {
    freeStrongIterators();
  }
}
示例#5
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);
}
示例#6
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);
}
示例#7
0
void ArrayData::freeStrongIterators() {
  for (FullPosRange r(strongIterators()); !r.empty(); r.popFront()) {
    r.front()->setContainer(NULL);
  }
  setStrongIterators(0);
}