home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 5.2 KB | 198 lines | [TEXT/MPS ] |
- // The C++ Booch Components (Version 2.1)
- // (C) Copyright 1990-1993 Grady Booch. All Rights Reserved.
- //
- // Restricted Rights Legend
- // Use, duplication, or disclosure is subject to restrictions as set forth
- // in subdivision (c)(1)(ii) of the Rights in Technical Data and Computer
- // Software clause at DFARS 252.227-7013.
- //
- // BCCollU.cpp
- //
- // This file contains the definitions for the unbounded collection.
-
- #include "BCCollU.h"
-
- template<class Item, class StorageManager>
- BC_TUnboundedCollection<Item, StorageManager>::BC_TUnboundedCollection() {}
-
- template<class Item, class StorageManager>
- BC_TUnboundedCollection<Item, StorageManager>::
- BC_TUnboundedCollection(const BC_TUnboundedCollection<Item, StorageManager>& c)
- : fRep(c.fRep) {}
-
- template<class Item, class StorageManager>
- BC_TUnboundedCollection<Item, StorageManager>::~BC_TUnboundedCollection() {}
-
- template<class Item, class StorageManager>
- BC_TCollection<Item>& BC_TUnboundedCollection<Item, StorageManager>::
- operator=(const BC_TCollection<Item>& c)
- {
- return BC_TCollection<Item>::operator=(c);
- }
-
- template<class Item, class StorageManager>
- BC_TCollection<Item>& BC_TUnboundedCollection<Item, StorageManager>::
- operator=(const BC_TUnboundedCollection<Item, StorageManager>& c)
- {
- fRep = c.fRep;
- return *this;
- }
-
- template<class Item, class StorageManager>
- BC_Boolean BC_TUnboundedCollection<Item, StorageManager>::
- operator==(const BC_TCollection<Item>& c) const
- {
- return BC_TCollection<Item>::operator==(c);
- }
-
- template<class Item, class StorageManager>
- BC_Boolean BC_TUnboundedCollection<Item, StorageManager>::
- operator==(const BC_TUnboundedCollection<Item, StorageManager>& c) const
- {
- return (fRep == c.fRep);
- }
-
- template<class Item, class StorageManager>
- BC_Boolean BC_TUnboundedCollection<Item, StorageManager>::
- operator!=(const BC_TUnboundedCollection<Item, StorageManager>& c) const
- {
- return !operator==(c);
- }
-
- template<class Item, class StorageManager>
- const Item& BC_TUnboundedCollection<Item, StorageManager>::
- operator[](BC_Index index) const
- {
- return fRep[index];
- }
-
- template<class Item, class StorageManager>
- Item& BC_TUnboundedCollection<Item, StorageManager>::operator[](BC_Index index)
- {
- return (Item&)(fRep[index]);
- }
-
- template<class Item, class StorageManager>
- void BC_TUnboundedCollection<Item, StorageManager>::Clear()
- {
- fRep.Clear();
- }
-
- template<class Item, class StorageManager>
- void BC_TUnboundedCollection<Item, StorageManager>::Insert(const Item& item)
- {
- fRep.Insert(item);
- }
-
- template<class Item, class StorageManager>
- void BC_TUnboundedCollection<Item, StorageManager>::
- Insert(const Item& item, BC_Index before)
- {
- fRep.Insert(item, before);
- }
-
- template<class Item, class StorageManager>
- void BC_TUnboundedCollection<Item, StorageManager>::Append(const Item& item)
- {
- fRep.Append(item);
- }
-
- template<class Item, class StorageManager>
- void BC_TUnboundedCollection<Item, StorageManager>::
- Append(const Item& item, BC_Index after)
- {
- fRep.Append(item, after);
- }
-
- template<class Item, class StorageManager>
- void BC_TUnboundedCollection<Item, StorageManager>::Remove(BC_Index at)
- {
- fRep.Remove(at);
- }
-
- template<class Item, class StorageManager>
- void BC_TUnboundedCollection<Item, StorageManager>::
- Replace(BC_Index at, const Item& item)
- {
- fRep.Replace(at, item);
- }
-
- template<class Item, class StorageManager>
- BC_Index BC_TUnboundedCollection<Item, StorageManager>::Length() const
- {
- return fRep.Length();
- }
-
- template<class Item, class StorageManager>
- BC_Boolean BC_TUnboundedCollection<Item, StorageManager>::IsEmpty() const
- {
- return (fRep.Length() == 0);
- }
-
- template<class Item, class StorageManager>
- const Item& BC_TUnboundedCollection<Item, StorageManager>::First() const
- {
- return fRep.First();
- }
-
- template<class Item, class StorageManager>
- Item& BC_TUnboundedCollection<Item, StorageManager>::First()
- {
- return (Item&)(fRep.First());
- }
-
- template<class Item, class StorageManager>
- const Item& BC_TUnboundedCollection<Item, StorageManager>::Last() const
- {
- return fRep.Last();
- }
-
- template<class Item, class StorageManager>
- Item& BC_TUnboundedCollection<Item, StorageManager>::Last()
- {
- return (Item&)(fRep.Last());
- }
-
- template<class Item, class StorageManager>
- BC_ExtendedIndex BC_TUnboundedCollection<Item, StorageManager>::
- Location(const Item& item) const
- {
- return fRep.Location(item);
- }
-
- template<class Item, class StorageManager>
- void BC_TUnboundedCollection<Item, StorageManager>::Purge()
- {
- fRep.Clear();
- }
-
- template<class Item, class StorageManager>
- void BC_TUnboundedCollection<Item, StorageManager>::Add(const Item& item)
- {
- fRep.Append(item);
- }
-
- template<class Item, class StorageManager>
- BC_Index BC_TUnboundedCollection<Item, StorageManager>::Cardinality() const
- {
- return fRep.Length();
- }
-
- template<class Item, class StorageManager>
- const Item& BC_TUnboundedCollection<Item, StorageManager>::ItemAt(BC_Index index) const
- {
- return fRep.ItemAt(index);
- }
-
- template<class Item, class StorageManager>
- void* BC_TUnboundedCollection<Item, StorageManager>::operator new(size_t s)
- {
- return StorageManager::Allocate(s);
- }
-
- template<class Item, class StorageManager>
- void BC_TUnboundedCollection<Item, StorageManager>::operator delete(void* p, size_t s)
- {
- StorageManager::Deallocate(p, s);
- }
-