use location exception

This commit is contained in:
Jeff Hill
2000-02-29 23:28:09 +00:00
parent a33c2b2b69
commit 4822b368d2
5 changed files with 20 additions and 62 deletions
+5 -20
View File
@@ -54,6 +54,7 @@
#include "tsSLList.h"
#include "shareLib.h"
#include "locationException.h"
typedef size_t resTableIndex;
@@ -328,11 +329,7 @@ resTable<T,ID>::resTable (unsigned nHashTableEntries) :
}
if ( nbits > ID::maxIndexBitWidth () ) {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw sizeExceedsMaxIndexWidth ();
# endif
throwWithLocation ( sizeExceedsMaxIndexWidth () );
}
//
@@ -349,11 +346,7 @@ resTable<T,ID>::resTable (unsigned nHashTableEntries) :
this->nInUse = 0u;
this->pTable = new tsSLList<T> [1<<nbits];
if (this->pTable==0) {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw dynamicMemoryAllocationFailed ();
# endif
throwWithLocation ( dynamicMemoryAllocationFailed () );
}
}
@@ -588,11 +581,7 @@ resTable<T,ID>::~resTable()
if (this->pTable) {
this->destroyAllEntries();
if (this->nInUse != 0u) {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw entryDidntRespondToDestroyVirtualFunction ();
# endif
throwWithLocation ( entryDidntRespondToDestroyVirtualFunction () );
}
delete [] this->pTable;
}
@@ -826,11 +815,7 @@ stringId::stringId (const char * idIn, allocationType typeIn) :
memcpy ((void *)this->pStr, idIn, nChars);
}
else {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw dynamicMemoryAllocationFailed ();
# endif
throwWithLocation ( dynamicMemoryAllocationFailed () );
}
}
else {
+2 -5
View File
@@ -1,5 +1,6 @@
#include <assert.h>
#include "locationException.h"
//
// tsBTreeRMRet
@@ -100,11 +101,7 @@ private:
}
}
else {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw invalid_btCmp ();
# endif
throwWithLocation ( invalid_btCmp () );
}
}
+6 -11
View File
@@ -35,6 +35,9 @@
#include <assert.h>
#include <locationException.h>
//
// the hp compiler complains about parameterized friend
// class that has not been declared without this?
@@ -368,11 +371,7 @@ template <class T>
void tsSLIterRm<T>::remove ()
{
if (this->pCurrent==0) {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw noCurrentItemInIterator ();
# endif
throwWithLocation ( noCurrentItemInIterator () );
}
tsSLNode<T> *pPrevNode;
@@ -384,12 +383,8 @@ void tsSLIterRm<T>::remove ()
// fail if it is an attempt to
// delete twice without moving the iterator
//
if (pPrevNode->pNext != this->pCurrent) {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw noCurrentItemInIterator ();
# endif
if (pPrevNode->pNext != this->pCurrent) {
throwWithLocation ( noCurrentItemInIterator ());
}
}
else {
+3 -6
View File
@@ -52,7 +52,8 @@
#include "osiThread.h"
#include "tsMinMax.h"
#include "fdManager.h"
#include "locationException.h"
//
// if the compiler supports explicit instantiation of
// template member functions
@@ -316,11 +317,7 @@ epicsShareFunc void fdManager::installReg (fdReg &reg)
int status = this->fdTbl.add (reg);
if (status!=0) {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw fdInterestSubscriptionAlreadyExits ();
# endif
throwWithLocation ( fdInterestSubscriptionAlreadyExits () );
}
}
+4 -20
View File
@@ -117,22 +117,14 @@ epicsShareFunc fdRegForOldFdmgr::fdRegForOldFdmgr (const SOCKET fdIn, const fdRe
pParam (pParamIn)
{
if (pFuncIn==NULL) {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw noFunctionSpecified ();
# endif
throwWithLocation ( noFunctionSpecified () );
}
}
epicsShareFunc fdRegForOldFdmgr::~fdRegForOldFdmgr ()
{
if (this->pFunc==NULL) {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw doubleDelete ();
# endif
throwWithLocation ( doubleDelete () );
}
}
@@ -147,11 +139,7 @@ osiTimerForOldFdmgr::osiTimerForOldFdmgr (oldFdmgr &fdmgrIn,
fdmgr (fdmgrIn), pFunc (pFuncIn), pParam(pParamIn)
{
if (pFuncIn==NULL) {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw noFunctionSpecified ();
# endif
throwWithLocation ( noFunctionSpecified () );
}
this->fdmgr.resTbl.add (*this);
@@ -160,11 +148,7 @@ osiTimerForOldFdmgr::osiTimerForOldFdmgr (oldFdmgr &fdmgrIn,
osiTimerForOldFdmgr::~osiTimerForOldFdmgr ()
{
if (this->pFunc==NULL) {
# ifdef noExceptionsFromCXX
assert (0);
# else
throw doubleDelete ();
# endif
throwWithLocation ( doubleDelete () );
}
this->pFunc = NULL;