#ifndef NCollection_Array1_HeaderFile
#define NCollection_Array1_HeaderFile
-#ifndef No_Exception
#include <Standard_DimensionMismatch.hxx>
#include <Standard_OutOfMemory.hxx>
#include <Standard_OutOfRange.hxx>
-#endif
#include <NCollection_DefineAlloc.hxx>
#include <NCollection_StlIterator.hxx>
myUpperBound (theUpper),
myDeletable (Standard_True)
{
-#if !defined No_Exception && !defined No_Standard_RangeError
- if (theUpper < theLower)
- Standard_RangeError::Raise ("NCollection_Array1::Create");
-#endif
+ Standard_RangeError_Raise_if (theUpper < theLower, "NCollection_Array1::Create");
TheItemType* pBegin = new TheItemType[Length()];
-#if !defined No_Exception && !defined No_Standard_OutOfMemory
- if (!pBegin)
- Standard_OutOfMemory::Raise ("NCollection_Array1 : Allocation failed");
-#endif
+ Standard_OutOfMemory_Raise_if (!pBegin, "NCollection_Array1 : Allocation failed");
myData = pBegin - theLower;
}
myDeletable (Standard_True)
{
TheItemType* pBegin = new TheItemType[Length()];
-#if !defined No_Exception && !defined No_Standard_OutOfMemory
- if (!pBegin)
- Standard_OutOfMemory::Raise ("NCollection_Array1 : Allocation failed");
-#endif
+ Standard_OutOfMemory_Raise_if (!pBegin, "NCollection_Array1 : Allocation failed");
myData = pBegin - myLowerBound;
*this = theOther;
myUpperBound (theUpper),
myDeletable (Standard_False)
{
-#if !defined No_Exception && !defined No_Standard_RangeError
- if (theUpper < theLower)
- Standard_RangeError::Raise ("NCollection_Array1::Array1");
-#endif
+ Standard_RangeError_Raise_if (theUpper < theLower, "NCollection_Array1::Create");
myData = (TheItemType *) &theBegin - theLower;
}
{
if (&theOther == this)
return *this;
-#if !defined No_Exception && !defined No_Standard_DimensionMismatch
- if (Length() != theOther.Length())
- Standard_DimensionMismatch::Raise ("NCollection_Array1::operator=");
-#endif
+ Standard_DimensionMismatch_Raise_if (Length() != theOther.Length(), "NCollection_Array1::operator=");
TheItemType * pMyItem = &myData[myLowerBound];
TheItemType * const pEndItem = &(theOther.myData)[theOther.myUpperBound];
TheItemType * pItem = &(theOther.myData)[theOther.myLowerBound];
//! Constant value access
const TheItemType& Value (const Standard_Integer theIndex) const
{
-#if !defined No_Exception && !defined No_Standard_OutOfRange
- if (theIndex < myLowerBound || theIndex > myUpperBound)
- Standard_OutOfRange::Raise ("NCollection_Array1::Value");
-#endif
+ Standard_OutOfRange_Raise_if (theIndex < myLowerBound || theIndex > myUpperBound, "NCollection_Array1::Value");
return myData[theIndex];
}
//! Variable value access
TheItemType& ChangeValue (const Standard_Integer theIndex)
{
-#if !defined No_Exception && !defined No_Standard_OutOfRange
- if (theIndex < myLowerBound || theIndex > myUpperBound)
- Standard_OutOfRange::Raise ("NCollection_Array1::ChangeValue");
-#endif
+ Standard_OutOfRange_Raise_if (theIndex < myLowerBound || theIndex > myUpperBound, "NCollection_Array1::ChangeValue");
return myData[theIndex];
}
void SetValue (const Standard_Integer theIndex,
const TheItemType& theItem)
{
-#if !defined No_Exception && !defined No_Standard_OutOfRange
- if (theIndex < myLowerBound || theIndex > myUpperBound)
- Standard_OutOfRange::Raise ("NCollection_Array1::SetValue");
-#endif
+ Standard_OutOfRange_Raise_if (theIndex < myLowerBound || theIndex > myUpperBound, "NCollection_Array1::SetValue");
myData[theIndex] = theItem;
}