16 #ifndef NCollection_BaseCollection_HeaderFile 17 #define NCollection_BaseCollection_HeaderFile 19 #include <NCollection_IncAllocator.hxx> 20 #include <NCollection_DefineAlloc.hxx> 52 virtual Standard_Boolean
More(
void)
const=0;
54 virtual void Next(
void)=0;
56 virtual const TheItemType&
Value(
void)
const=0;
61 DEFINE_NCOLLECTION_ALLOC
79 (
const Handle(NCollection_BaseAllocator)& theAllocator=0L)
81 if (theAllocator.IsNull())
82 myAllocator = NCollection_BaseAllocator::CommonBaseAllocator();
84 myAllocator = theAllocator;
88 virtual Standard_Integer
Size(
void)
const = 0;
101 const Handle(NCollection_BaseAllocator)& Allocator()
const {
return myAllocator; }
105 const Handle(NCollection_BaseAllocator)& IterAllocator(
void)
const 107 if (myIterAllocator.IsNull())
108 (Handle_NCollection_BaseAllocator&) myIterAllocator =
109 new NCollection_IncAllocator(64);
110 return myIterAllocator;
116 std::swap (myAllocator, theOther.myAllocator);
117 std::swap (myIterAllocator, theOther.myIterAllocator);
122 Handle(NCollection_BaseAllocator) myAllocator;
125 Handle(NCollection_BaseAllocator) myIterAllocator;
virtual ~Iterator(void)
Virtual destructor is necessary for classes with virtual methods.
NCollection_BaseCollection(const Handle(NCollection_BaseAllocator)&theAllocator=0L)
Common for all collections constructor takes care of theAllocator.
void exchangeAllocators(NCollection_BaseCollection &theOther)
Exchange allocators of two collections.
virtual Standard_Integer Size(void) const =0
Number of items.
Iterator(const Iterator &)
Copy constructor **.
Iterator(void)
Empty constructor.
virtual Standard_Boolean More(void) const =0
Query if the end of collection is reached by iterator.
const Handle(NCollection_BaseAllocator) &IterAllocator(void) const
virtual void Assign(const NCollection_BaseCollection &theOther)=0
Virtual assignment.
const Iterator & operator=(const Iterator &)
operator= is prohibited
Purpose: NCollection_BaseCollection is the base abstract class for all collection templates of this p...
const Handle(NCollection_BaseAllocator) &Allocator() const
Returns attached allocator.
virtual ~NCollection_BaseCollection(void)
Destructor - must be implemented to release the memory.
virtual TheItemType & ChangeValue(void) const =0
Value change access.
virtual const TheItemType & Value(void) const =0
Value inquiry.
virtual Iterator & CreateIterator(void) const =0
Method to create iterators for base collections.
virtual void Next(void)=0
Make a step along the collection.