29#ifndef _SLOTMANAGER_H_INCLUDED_
30#define _SLOTMANAGER_H_INCLUDED_
38#define kOdNullSlotId OdSlotId(-1)
49 unsigned int m_numSlots;
61 if(m_freeSlots.isEmpty())
67 res = m_freeSlots.last();
68 m_freeSlots.removeLast();
79 if(slotId+1==m_numSlots)
85 m_freeSlots.append(slotId);
95 return (slotId < m_numSlots && !m_freeSlots.contains(slotId, 0));
117template <
class TVal,
class TAlloc = OdObjectsAllocator<TVal> >
122 if(slotId >= this->
size())
141 static const TVal*
emptySlotValue() {
static const TVal def = TVal();
return &def; }
192template <
class TVal,
class TAlloc = OdObjectsAllocator<TVal> >
OdArray< int, OdMemoryAllocator< int > > OdIntArray
const T * asArrayPtr() const
size_type physicalLength() const
OdArray(size_type physicalLength, int growLength=8)
typename A::size_type size_type
void resize(size_type logicalLength, const T &value)
OdManagedSlots(size_type physicalLength, int growLength=8)
OdSlots< TVal, TAlloc >::size_type size_type
void freeSlot(OdSlotId slotId)
unsigned int numSlots() const
bool contains(OdSlotId slotId) const
TVal & operator[](OdSlotId slotId)
static const TVal * emptySlotValue()
void setAt(OdSlotId slotId, const TVal &value)
OdSlots(size_type physicalLength, int growLength=8)
const TVal & getAt(OdSlotId slotId) const
OdArray< TVal, TAlloc >::size_type size_type
const TVal & operator[](OdSlotId slotId) const
GLsizei const GLfloat * value