Ejemplo n.º 1
0
//
// MetaTable::clearTable
//
// Removes all objects from a metatable.
//
void MetaTable::clearTable()
{
   MetaObject *obj = NULL;

   // iterate on the source table
   while((obj = tableIterator(obj)))
   {
      removeObject(obj);
      delete obj;
      obj = NULL; // restart from the beginning
   }
}
Ejemplo n.º 2
0
//
// MetaTable::clearTable
//
// Removes all objects from a metatable.
//
void MetaTable::clearTable()
{
   MetaObject *obj = NULL;

   // iterate on the source table
   while((obj = tableIterator(NULL)))
   {
      removeObject(obj);

      delete obj;
   }
}
Ejemplo n.º 3
0
//
// MetaTable::copyTableTo
//
// Adds copies of all objects in the source table to the destination table.
//
void MetaTable::copyTableTo(MetaTable *dest) const
{
   MetaObject *srcobj = NULL;

   // iterate on the source table
   while((srcobj = tableIterator(srcobj)))
   {
      // create the new object
      MetaObject *newObject = srcobj->clone();

      // add the new object to the destination table
      dest->addObject(newObject);
   }
}
Ejemplo n.º 4
0
//
// Adds copies of all objects in the source table to the destination table.
//
void MetaTable::copyTableTo(MetaTable *dest) const
{
   MetaObject *srcobj = nullptr;

   // iterate on the source table
   while((srcobj = tableIterator(srcobj)))
   {
      // create the new object
      MetaObject *newObject = srcobj->clone();

      // add the new object to the destination table
      dest->addObject(newObject);
   }

   // since we iterated head to tail above, the items have been added in
   // reversed order; the only good way to fix this is to have the hash
   // tables reverse their chains now.
   dest->pImpl->reverseTables();
}
Ejemplo n.º 5
0
TableIterator ReportTableBase::end(void)
{
  TableIterator tableIterator(*this);
  return tableIterator.end();
}
Ejemplo n.º 6
0
////////////////////////////////////////////////////////////////////////////////
// operations that return an iterator position
TableIterator ReportTableBase::begin(void)
{
  TableIterator tableIterator(*this);
  return tableIterator.begin();
}