1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
//////////////////////////////////////////////////////////////////////////
//
// pgAdmin III - PostgreSQL Tools
//
// Copyright (C) 2002 - 2014, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
// hdCollection.cpp - Generic implementation of a Collection used by dd
//
//////////////////////////////////////////////////////////////////////////
// App headers
#include "pgAdmin3.h"
// wxWindows headers
#include <wx/wx.h>
// App headers
#include "hotdraw/utilities/hdCollection.h"
#include "hotdraw/main/hdObject.h"
hdCollection::hdCollection(hdCollectionBase *collectionBase)
{
collection = collectionBase;
}
hdCollection::~hdCollection()
{
if(collection)
delete collection;
}
void hdCollection::addItem(hdObject *item)
{
collection->addItem(item);
}
void hdCollection::removeItem(hdObject *item)
{
collection->removeItem(item);
}
hdIteratorBase *hdCollection::createIterator()
{
if(collection)
return collection->createIterator();
return NULL;
}
hdIteratorBase *hdCollection::createDownIterator()
{
if(collection)
return collection->createDownIterator();
return NULL;
}
int hdCollection::count()
{
return collection->count();
}
bool hdCollection::existsObject(hdObject *item)
{
return collection->existsObject(item);
}
hdObject *hdCollection::getItemAt(int index)
{
return collection->getItemAt(index);
}
void hdCollection::removeItemAt(int index)
{
collection->removeItemAt(index);
}
// Remove all items from collection without deleting each one.
void hdCollection::removeAll()
{
collection->removeAll();
}
void hdCollection::deleteAll()
{
collection->deleteAll();
}
int hdCollection::getIndex(hdObject *item)
{
return collection->getIndex(item);
}
void hdCollection::insertAtIndex(hdObject *item, int index)
{
collection->insertAtIndex(item, index);
}
void hdCollection::replaceAtIndex(hdObject *item, int index)
{
collection->replaceAtIndex(item, index);
}
void hdCollection::bringToFront(hdObject *item)
{
collection->bringToFront(item);
}
void hdCollection::sendToBack(hdObject *item)
{
collection->sendToBack(item);
}
|