1
1
//////////////////////////////////////////////////////////////////////////
3
3
// pgAdmin III - PostgreSQL Tools
5
// Copyright (C) 2002 - 2010, The pgAdmin Development Team
5
// Copyright (C) 2002 - 2011, The pgAdmin Development Team
6
6
// This software is released under the PostgreSQL Licence
8
8
// gqbCollection.cpp - Generic implementation of a Collection used by GQB.
22
22
gqbCollection::gqbCollection(gqbCollectionBase *collectionBase)
24
collection=collectionBase;
24
collection = collectionBase;
28
28
gqbCollection::~gqbCollection()
35
35
void gqbCollection::addItem(gqbObject *item)
37
collection->addItem(item);
37
collection->addItem(item);
41
41
void gqbCollection::removeItem(gqbObject *item)
43
collection->removeItem(item);
47
gqbIteratorBase* gqbCollection::createIterator()
49
return collection->createIterator();
52
gqbIteratorBase* gqbCollection::createDownIterator()
54
return collection->createDownIterator();
43
collection->removeItem(item);
47
gqbIteratorBase *gqbCollection::createIterator()
49
return collection->createIterator();
52
gqbIteratorBase *gqbCollection::createDownIterator()
54
return collection->createDownIterator();
58
58
int gqbCollection::count()
60
return collection->count();
60
return collection->count();
64
64
bool gqbCollection::existsObject(gqbObject *item)
66
return collection->existsObject(item);
66
return collection->existsObject(item);
70
gqbObject* gqbCollection::getItemAt(int index)
70
gqbObject *gqbCollection::getItemAt(int index)
72
return collection->getItemAt(index);
72
return collection->getItemAt(index);
76
76
// Remove all items from collection without deleting each one.
77
77
void gqbCollection::removeAll()
79
collection->removeAll();
79
collection->removeAll();
83
83
void gqbCollection::deleteAll()
85
collection->deleteAll();
85
collection->deleteAll();
89
89
int gqbCollection::getIndex(gqbObject *item)
91
return collection->getIndex(item);
91
return collection->getIndex(item);
95
95
void gqbCollection::insertAtIndex(gqbObject *item, int index)
97
collection->insertAtIndex(item,index);
97
collection->insertAtIndex(item, index);