removed exception specifications

This commit is contained in:
Jeff Hill
2003-02-12 19:03:59 +00:00
parent 648557b72c
commit 234c515b05
8 changed files with 37 additions and 52 deletions
+6 -6
View File
@@ -42,33 +42,33 @@ public:
// inline mf def for class within a template required by visual c++ 7
class reference {
public:
reference ( TYPE & tIn ) epicsThrows (()) :
reference ( TYPE & tIn ):
instance ( tIn )
{
}
~reference () epicsThrows (())
~reference ()
{
}
TYPE * operator -> () epicsThrows (())
TYPE * operator -> ()
{
return & this->instance;
}
const TYPE * operator -> () const epicsThrows (())
const TYPE * operator -> () const
{
typename epicsSingleton<TYPE>::reference & ref =
const_cast < typename epicsSingleton<TYPE>::reference & > ( *this );
return ref.operator -> ();
}
TYPE & operator * () epicsThrows (())
TYPE & operator * ()
{
return * this->operator -> ();
}
const TYPE & operator * () const epicsThrows (())
const TYPE & operator * () const
{
return * this->operator -> ();
}
+15 -19
View File
@@ -22,6 +22,12 @@
* Author: Jeff Hill
*/
//
// TODO: this should allow free list chaining so that a free
// list (in a different lock domain) is used to provide the
// tsFreeListChunk.
//
//
// To allow your class to be allocated off of a free list
// using the new operator:
@@ -85,22 +91,16 @@ template < class T, unsigned N = 0x400,
class MUTEX = epicsMutex >
class tsFreeList {
public:
tsFreeList ()
epicsThrows (());
~tsFreeList ()
epicsThrows (());
void * allocate ( size_t size )
epicsThrows (( std::bad_alloc ));
void release ( void * p )
epicsThrows (());
void release ( void * p, size_t size )
epicsThrows (());
tsFreeList ();
~tsFreeList ();
void * allocate ( size_t size );
void release ( void * p );
void release ( void * p, size_t size );
private:
MUTEX mutex;
tsFreeListItem < T > * pFreeList;
tsFreeListChunk < T, N > * pChunkList;
void * allocateFromNewChunk ()
epicsThrows (( std::bad_alloc ));
void * allocateFromNewChunk ();
};
template < class T >
@@ -117,11 +117,11 @@ struct tsFreeListChunk {
};
template < class T, unsigned N, class MUTEX >
inline tsFreeList < T, N, MUTEX > :: tsFreeList ()
epicsThrows (()) : pFreeList ( 0 ), pChunkList ( 0 ) {}
inline tsFreeList < T, N, MUTEX > :: tsFreeList () :
pFreeList ( 0 ), pChunkList ( 0 ) {}
template < class T, unsigned N, class MUTEX >
tsFreeList < T, N, MUTEX > :: ~tsFreeList () epicsThrows (())
tsFreeList < T, N, MUTEX > :: ~tsFreeList ()
{
while ( tsFreeListChunk < T, N > *pChunk = this->pChunkList ) {
this->pChunkList = this->pChunkList->pNext;
@@ -131,7 +131,6 @@ tsFreeList < T, N, MUTEX > :: ~tsFreeList () epicsThrows (())
template < class T, unsigned N, class MUTEX >
void * tsFreeList < T, N, MUTEX >::allocate ( size_t size )
epicsThrows (( std::bad_alloc ))
{
if ( size != sizeof ( T ) || N == 0u || tsFreeListDebugBypass ) {
void * p = ::operator new ( size );
@@ -151,7 +150,6 @@ void * tsFreeList < T, N, MUTEX >::allocate ( size_t size )
template < class T, unsigned N, class MUTEX >
void * tsFreeList < T, N, MUTEX >::allocateFromNewChunk ()
epicsThrows (( std::bad_alloc ))
{
tsFreeListChunk < T, N > * pChunk =
new tsFreeListChunk < T, N >;
@@ -171,7 +169,6 @@ void * tsFreeList < T, N, MUTEX >::allocateFromNewChunk ()
template < class T, unsigned N, class MUTEX >
void tsFreeList < T, N, MUTEX >::release ( void * pCadaver, size_t size )
epicsThrows (())
{
if ( size != sizeof ( T ) ) {
tsFreeListMemSetDelete ( pCadaver, size );
@@ -184,7 +181,6 @@ void tsFreeList < T, N, MUTEX >::release ( void * pCadaver, size_t size )
template < class T, unsigned N, class MUTEX >
void tsFreeList < T, N, MUTEX >::release ( void * pCadaver )
epicsThrows (())
{
if ( N == 0u || tsFreeListDebugBypass ) {
tsFreeListMemSetDelete ( pCadaver, sizeof ( T ) );
+1 -1
View File
@@ -63,7 +63,7 @@
// usage: epicsPlacementDeleteOperator (( void *, myMemoryManager & ))
#if defined ( CXX_PLACEMENT_DELETE )
# define epicsPlacementDeleteOperator(X) void operator delete X epicsThrows (());
# define epicsPlacementDeleteOperator(X) void operator delete X;
#else
# define epicsPlacementDeleteOperator(X)
#endif
+1 -6
View File
@@ -192,7 +192,7 @@ void epicsShareAPI epicsMutexShowAll(int onlyLocked,unsigned int level)
epicsMutexOsdUnlock(epicsMutexGlobalLock);
}
epicsMutex :: epicsMutex () epicsThrows (( epicsMutex::mutexCreateFailed )) :
epicsMutex :: epicsMutex () :
id ( epicsMutexCreate () )
{
if ( this->id == 0 ) {
@@ -201,13 +201,11 @@ epicsMutex :: epicsMutex () epicsThrows (( epicsMutex::mutexCreateFailed )) :
}
epicsMutex ::~epicsMutex ()
epicsThrows (())
{
epicsMutexDestroy ( this->id );
}
void epicsMutex::lock ()
epicsThrows (( epicsMutex::invalidMutex ))
{
epicsMutexLockStatus status = epicsMutexLock ( this->id );
if ( status != epicsMutexLockOK ) {
@@ -216,7 +214,6 @@ void epicsMutex::lock ()
}
bool epicsMutex::tryLock () // X aCC 361
epicsThrows (( epicsMutex::invalidMutex ))
{
epicsMutexLockStatus status = epicsMutexTryLock ( this->id );
if ( status == epicsMutexLockOK ) {
@@ -229,13 +226,11 @@ bool epicsMutex::tryLock () // X aCC 361
}
void epicsMutex::unlock ()
epicsThrows (())
{
epicsMutexUnlock ( this->id );
}
void epicsMutex :: show ( unsigned level ) const
epicsThrows (())
{
epicsMutexShow ( this->id, level );
}
+6 -12
View File
@@ -27,18 +27,12 @@ class epicsShareClass epicsMutex {
public:
class mutexCreateFailed {}; // exception
class invalidMutex {}; // exception
epicsMutex ()
epicsThrows (( mutexCreateFailed ));
~epicsMutex ()
epicsThrows (());
void show ( unsigned level ) const
epicsThrows (());
void lock () /* blocks until success */
epicsThrows (( invalidMutex ));
void unlock ()
epicsThrows (());
bool tryLock () /* true if successful */
epicsThrows (( invalidMutex ));
epicsMutex ();
~epicsMutex ();
void show ( unsigned level ) const;
void lock (); /* blocks until success */
void unlock ();
bool tryLock (); /* true if successful */
private:
epicsMutexId id;
epicsMutex ( const epicsMutex & );
+2 -2
View File
@@ -41,7 +41,7 @@ epicsTimerNotify::~epicsTimerNotify () {}
void epicsTimerNotify::show ( unsigned /* level */ ) const {}
epicsTimerForC::epicsTimerForC ( timerQueue &queue, epicsTimerCallback pCBIn, void *pPrivateIn ) epicsThrows (()) :
epicsTimerForC::epicsTimerForC ( timerQueue &queue, epicsTimerCallback pCBIn, void *pPrivateIn ) :
timer ( queue ), pCallBack ( pCBIn ), pPrivate ( pPrivateIn )
{
}
@@ -72,7 +72,7 @@ epicsTimerQueueActiveForC::~epicsTimerQueueActiveForC ()
{
}
void epicsTimerQueueActiveForC::release () epicsThrows (())
void epicsTimerQueueActiveForC::release ()
{
epicsSingleton < timerQueueActiveMgr >::reference pMgr =
timerQueueMgrEPICS.getReference ();
+1 -1
View File
@@ -35,7 +35,7 @@ template class tsFreeList < timer, 0x20 >;
# pragma warning ( pop )
#endif
timer::timer ( timerQueue & queueIn ) epicsThrows (()):
timer::timer ( timerQueue & queueIn ) :
queue ( queueIn ), curState ( stateLimbo ), pNotify ( 0 )
{
}
+5 -5
View File
@@ -43,7 +43,7 @@ public:
void * operator new ( size_t size, tsFreeList < timer, 0x20 > & );
epicsPlacementDeleteOperator (( void *, tsFreeList < timer, 0x20 > & ))
protected:
timer ( class timerQueue & ) epicsThrows (());
timer ( class timerQueue & );
~timer ();
timerQueue & queue;
private:
@@ -67,7 +67,7 @@ struct epicsTimerForC : public epicsTimerNotify, public timer {
public:
void destroy ();
protected:
epicsTimerForC ( timerQueue &, epicsTimerCallback, void *pPrivateIn ) epicsThrows (());
epicsTimerForC ( timerQueue &, epicsTimerCallback, void *pPrivateIn );
~epicsTimerForC ();
void * operator new ( size_t size, tsFreeList < epicsTimerForC, 0x20 > & );
epicsPlacementDeleteOperator (( void *, tsFreeList < epicsTimerForC, 0x20 > & ))
@@ -195,7 +195,7 @@ struct epicsTimerQueueActiveForC : public timerQueueActive,
public tsDLNode < epicsTimerQueueActiveForC > {
public:
epicsTimerQueueActiveForC ( bool okToShare, unsigned priority );
void release () epicsThrows (());
void release ();
void * operator new ( size_t );
void operator delete ( void * );
protected:
@@ -223,7 +223,7 @@ inline void * timer::operator new ( size_t size,
#ifdef CXX_PLACEMENT_DELETE
inline void timer::operator delete ( void * pCadaver,
tsFreeList < timer, 0x20 > & freeList ) epicsThrows(())
tsFreeList < timer, 0x20 > & freeList )
{
freeList.release ( pCadaver );
}
@@ -237,7 +237,7 @@ inline void * epicsTimerForC::operator new ( size_t size,
#ifdef CXX_PLACEMENT_DELETE
inline void epicsTimerForC::operator delete ( void * pCadaver,
tsFreeList < epicsTimerForC, 0x20 > & freeList ) epicsThrows(())
tsFreeList < epicsTimerForC, 0x20 > & freeList )
{
freeList.release ( pCadaver );
}