use epics_throws macro
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsGuard.h"
|
||||
#include "epicsThread.h"
|
||||
#include "cxxCompilerDependencies.h"
|
||||
|
||||
// This class exists for the purpose of avoiding file scope
|
||||
// object chicken and egg problems. It implements thread safe
|
||||
@@ -41,33 +42,33 @@ public:
|
||||
// inline func def required by visual c++ 7
|
||||
class reference {
|
||||
public:
|
||||
reference ( TYPE & tIn ) throw () :
|
||||
reference ( TYPE & tIn ) epics_throws (()) :
|
||||
instance ( tIn )
|
||||
{
|
||||
}
|
||||
|
||||
~reference () throw ()
|
||||
~reference () epics_throws (())
|
||||
{
|
||||
}
|
||||
|
||||
TYPE * operator -> () throw ()
|
||||
TYPE * operator -> () epics_throws (())
|
||||
{
|
||||
return & this->instance;
|
||||
}
|
||||
|
||||
const TYPE * operator -> () const throw ()
|
||||
const TYPE * operator -> () const epics_throws (())
|
||||
{
|
||||
typename epicsSingleton<TYPE>::reference & ref =
|
||||
const_cast < typename epicsSingleton<TYPE>::reference & > ( *this );
|
||||
return ref.operator -> ();
|
||||
}
|
||||
|
||||
TYPE & operator * () throw ()
|
||||
TYPE & operator * () epics_throws (())
|
||||
{
|
||||
return * this->operator -> ();
|
||||
}
|
||||
|
||||
const TYPE & operator * () const throw ()
|
||||
const TYPE & operator * () const epics_throws (())
|
||||
{
|
||||
return * this->operator -> ();
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
#include <new>
|
||||
#include "string.h"
|
||||
|
||||
#include "cxxCompilerDependencies.h"
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsGuard.h"
|
||||
|
||||
@@ -85,21 +86,21 @@ template < class T, unsigned N = 0x400,
|
||||
class tsFreeList {
|
||||
public:
|
||||
tsFreeList ()
|
||||
throw ();
|
||||
epics_throws (());
|
||||
~tsFreeList ()
|
||||
throw ();
|
||||
epics_throws (());
|
||||
void * allocate ( size_t size )
|
||||
throw ( std::bad_alloc );
|
||||
epics_throws (( std::bad_alloc ));
|
||||
void release ( void * p )
|
||||
throw ();
|
||||
epics_throws (());
|
||||
void release ( void * p, size_t size )
|
||||
throw ();
|
||||
epics_throws (());
|
||||
private:
|
||||
MUTEX mutex;
|
||||
tsFreeListItem < T > * pFreeList;
|
||||
tsFreeListChunk < T, N > * pChunkList;
|
||||
void * allocateFromNewChunk ()
|
||||
throw ( std::bad_alloc );
|
||||
epics_throws (( std::bad_alloc ));
|
||||
};
|
||||
|
||||
template < class T >
|
||||
@@ -117,10 +118,10 @@ struct tsFreeListChunk {
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
inline tsFreeList < T, N, MUTEX > :: tsFreeList ()
|
||||
throw () : pFreeList ( 0 ), pChunkList ( 0 ) {}
|
||||
epics_throws (()) : pFreeList ( 0 ), pChunkList ( 0 ) {}
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
tsFreeList < T, N, MUTEX > :: ~tsFreeList () throw ()
|
||||
tsFreeList < T, N, MUTEX > :: ~tsFreeList () epics_throws (())
|
||||
{
|
||||
while ( tsFreeListChunk < T, N > *pChunk = this->pChunkList ) {
|
||||
this->pChunkList = this->pChunkList->pNext;
|
||||
@@ -130,7 +131,7 @@ tsFreeList < T, N, MUTEX > :: ~tsFreeList () throw ()
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
void * tsFreeList < T, N, MUTEX >::allocate ( size_t size )
|
||||
throw ( std::bad_alloc )
|
||||
epics_throws (( std::bad_alloc ))
|
||||
{
|
||||
if ( size != sizeof ( T ) || N == 0u || tsFreeListDebugBypass ) {
|
||||
void * p = ::operator new ( size );
|
||||
@@ -150,7 +151,7 @@ void * tsFreeList < T, N, MUTEX >::allocate ( size_t size )
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
void * tsFreeList < T, N, MUTEX >::allocateFromNewChunk ()
|
||||
throw ( std::bad_alloc )
|
||||
epics_throws (( std::bad_alloc ))
|
||||
{
|
||||
tsFreeListChunk < T, N > * pChunk =
|
||||
new tsFreeListChunk < T, N >;
|
||||
@@ -170,7 +171,7 @@ void * tsFreeList < T, N, MUTEX >::allocateFromNewChunk ()
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
void tsFreeList < T, N, MUTEX >::release ( void * pCadaver, size_t size )
|
||||
throw ()
|
||||
epics_throws (())
|
||||
{
|
||||
if ( size != sizeof ( T ) ) {
|
||||
tsFreeListMemSetDelete ( pCadaver, size );
|
||||
@@ -183,7 +184,7 @@ 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 )
|
||||
throw ()
|
||||
epics_throws (())
|
||||
{
|
||||
if ( N == 0u || tsFreeListDebugBypass ) {
|
||||
tsFreeListMemSetDelete ( pCadaver, sizeof ( T ) );
|
||||
|
||||
@@ -39,7 +39,7 @@ epicsTimerNotify::~epicsTimerNotify () {}
|
||||
|
||||
void epicsTimerNotify::show ( unsigned /* level */ ) const {}
|
||||
|
||||
epicsTimerForC::epicsTimerForC ( timerQueue &queue, epicsTimerCallback pCBIn, void *pPrivateIn ) throw () :
|
||||
epicsTimerForC::epicsTimerForC ( timerQueue &queue, epicsTimerCallback pCBIn, void *pPrivateIn ) epics_throws (()) :
|
||||
timer ( queue ), pCallBack ( pCBIn ), pPrivate ( pPrivateIn )
|
||||
{
|
||||
}
|
||||
@@ -70,7 +70,7 @@ epicsTimerQueueActiveForC::~epicsTimerQueueActiveForC ()
|
||||
{
|
||||
}
|
||||
|
||||
void epicsTimerQueueActiveForC::release () throw ()
|
||||
void epicsTimerQueueActiveForC::release () epics_throws (())
|
||||
{
|
||||
epicsSingleton < timerQueueActiveMgr >::reference pMgr =
|
||||
timerQueueMgrEPICS;
|
||||
|
||||
@@ -35,7 +35,7 @@ template class tsFreeList < timer, 0x20 >;
|
||||
# pragma warning ( pop )
|
||||
#endif
|
||||
|
||||
timer::timer ( timerQueue & queueIn ) throw ():
|
||||
timer::timer ( timerQueue & queueIn ) epics_throws (()):
|
||||
queue ( queueIn ), curState ( stateLimbo ), pNotify ( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "epicsSingleton.h"
|
||||
#include "tsDLList.h"
|
||||
#include "epicsTimer.h"
|
||||
#include "cxxCompilerDepPlacementDelete.h"
|
||||
#include "cxxCompilerDependencies.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
# define debugPrintf(ARGSINPAREN) printf ARGSINPAREN
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
void operator delete ( void *, tsFreeList < timer, 0x20 > & );
|
||||
#endif
|
||||
protected:
|
||||
timer ( class timerQueue & ) throw ();
|
||||
timer ( class timerQueue & ) epics_throws (());
|
||||
~timer ();
|
||||
timerQueue & queue;
|
||||
private:
|
||||
@@ -69,7 +69,7 @@ struct epicsTimerForC : public epicsTimerNotify, public timer {
|
||||
public:
|
||||
void destroy ();
|
||||
protected:
|
||||
epicsTimerForC ( timerQueue &, epicsTimerCallback, void *pPrivateIn ) throw ();
|
||||
epicsTimerForC ( timerQueue &, epicsTimerCallback, void *pPrivateIn ) epics_throws (());
|
||||
~epicsTimerForC ();
|
||||
void * operator new ( size_t size, tsFreeList < epicsTimerForC, 0x20 > & );
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
@@ -199,7 +199,7 @@ struct epicsTimerQueueActiveForC : public timerQueueActive,
|
||||
public tsDLNode < epicsTimerQueueActiveForC > {
|
||||
public:
|
||||
epicsTimerQueueActiveForC ( bool okToShare, unsigned priority );
|
||||
void release () throw();
|
||||
void release () epics_throws (());
|
||||
void * operator new ( size_t );
|
||||
void operator delete ( void * );
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user