MemBlock& aLastBlock = myData [myNBlocks - 1];
Standard_RangeError_Raise_if (theIndex < aLastBlock.FirstIndex(),
"NColelction_BaseVector::ExpandV");
- const unsigned int anIndLastBlock = theIndex - aLastBlock.FirstIndex();
+ Standard_Integer anIndLastBlock = theIndex - aLastBlock.FirstIndex();
// Is there still room for 1 item in the last array?
if (anIndLastBlock < aLastBlock.Size()) {
myLength = aNewLength;
: myAlloc(theAlloc),
myFirstInd(theFirstInd), myLength(0), mySize(theLength), myData(0L) {}
virtual void Reinit (const Standard_Integer,
- const size_t) {}
+ const Standard_Integer) {}
Standard_Integer FirstIndex () const { return myFirstInd; }
- size_t Size () const { return mySize; }
+ Standard_Integer Size () const { return mySize; }
public:
virtual ~MemBlock () {}
- void SetLength (const size_t theLen)
+ void SetLength (const Standard_Integer theLen)
{ myLength = theLen; }
- size_t Length () const { return myLength; }
+ Standard_Integer Length () const { return myLength; }
void * Find (const Standard_Integer theInd,
const size_t theSize) const
{ return ((char *) myData)+theInd*theSize;}
GetIndexV (void * theItem, const size_t theSz) const;
protected:
Standard_Integer myFirstInd;
- size_t myLength;
- size_t mySize;
+ Standard_Integer myLength;
+ Standard_Integer mySize;
NCollection_BaseAllocator * myAlloc;
void * myData;
friend class NCollection_BaseVector;
{ return &myVector -> myData[myICurBlock]; }
const NCollection_BaseVector * myVector; // the Master vector
- size_t myICurBlock; // # of the current block
- size_t myIEndBlock;
- size_t myCurIndex; // Index in the current block
- size_t myEndIndex;
+ Standard_Integer myICurBlock; // # of the current block
+ Standard_Integer myIEndBlock;
+ Standard_Integer myCurIndex; // Index in the current block
+ Standard_Integer myEndIndex;
};
protected:
: NCollection_BaseVector::MemBlock (theFirstInd, theSize, theAlloc)
{
myData = myAlloc->Allocate(theSize * sizeof(TheItemType));
- for (size_t i=0; i < theSize; i++)
+ for (Standard_Integer i=0; i < theSize; i++)
new (&((TheItemType *) myData)[i]) TheItemType;
}
//! Copy constructor
{
myLength = theOther.Length();
myData = myAlloc->Allocate(Size() * sizeof(TheItemType));
- size_t i;
+ Standard_Integer i;
for (i=0; i < Length(); i++)
new (&((TheItemType *) myData)[i]) TheItemType(theOther.Value(i));
for (; i < Size(); i++)
}
//! Reinit
virtual void Reinit (const Standard_Integer theFirst,
- const size_t theSize)
+ const Standard_Integer theSize)
{
if (myData) {
- for (size_t i=0; i < mySize; i++)
+ for (Standard_Integer i=0; i < mySize; i++)
((TheItemType *) myData)[i].~TheItemTypeD();
myAlloc->Free(myData);
myData = NULL;
}
if (theSize > 0) {
myData = myAlloc->Allocate(theSize * sizeof(TheItemType));
- for (size_t i=0; i < theSize; i++)
+ for (Standard_Integer i=0; i < theSize; i++)
new (&((TheItemType *) myData)[i]) TheItemType;
}
myFirstInd = theFirst;
virtual ~MemBlock ()
{
if (myData) {
- for (size_t i=0; i < Size(); i++)
+ for (Standard_Integer i=0; i < Size(); i++)
((TheItemType *) myData)[i].~TheItemTypeD();
myAlloc->Free(myData);
myData = NULL;