use epics_throws macro

This commit is contained in:
Jeff Hill
2002-10-25 00:11:12 +00:00
parent 3e884afdff
commit 2011c3c7ba
26 changed files with 243 additions and 244 deletions

View File

@@ -33,7 +33,7 @@
#endif
#include "tsFreeList.h"
#include "cxxCompilerDepPlacementDelete.h"
#include "cxxCompilerDependencies.h"
#ifdef autoPtrFreeListh_epicsExportSharedSymbols
# define epicsExportSharedSymbols

View File

@@ -45,7 +45,7 @@
* between the 1st and 2nd beacons)
*/
bhe::bhe ( const epicsTime & initialTimeStamp,
unsigned initialBeaconNumber, const inetAddrID & addr ) throw () :
unsigned initialBeaconNumber, const inetAddrID & addr ) epics_throws (()) :
inetAddrID ( addr ), timeStamp ( initialTimeStamp ), averagePeriod ( - DBL_MAX ),
lastBeaconNumber ( initialBeaconNumber )
{
@@ -224,7 +224,7 @@ void bhe::show ( unsigned /* level */ ) const
static_cast <const void *> ( this ), this->averagePeriod );
}
double bhe::period () const throw ()
double bhe::period () const epics_throws (())
{
return this->averagePeriod;
}

View File

@@ -31,7 +31,7 @@
#include "tsDLList.h"
#include "tsFreeList.h"
#include "epicsTime.h"
#include "cxxCompilerDepPlacementDelete.h"
#include "cxxCompilerDependencies.h"
#ifdef bhehEpicsExportSharedSymbols
# define epicsExportSharedSymbols
@@ -56,13 +56,13 @@ public:
class bhe : public tsSLNode < bhe >, public inetAddrID {
public:
epicsShareFunc bhe ( const epicsTime & initialTimeStamp,
unsigned initialBeaconNumber, const inetAddrID & addr ) throw ();
unsigned initialBeaconNumber, const inetAddrID & addr ) epics_throws (());
epicsShareFunc ~bhe ();
epicsShareFunc bool updatePeriod (
const epicsTime & programBeginTime,
const epicsTime & currentTime, ca_uint32_t beaconNumber,
unsigned protocolRevision );
epicsShareFunc double period () const throw ();
epicsShareFunc double period () const epics_throws (());
epicsShareFunc epicsTime updateTime () const;
epicsShareFunc void show ( unsigned level) const;
epicsShareFunc void registerIIU ( tcpiiu & );

View File

@@ -1587,12 +1587,12 @@ void cac::initiateConnect ( nciu & chan )
this->pudpiiu->installChannel ( chan );
}
void *cacComBufMemoryManager::allocate ( size_t size ) throw ( std::bad_alloc )
void *cacComBufMemoryManager::allocate ( size_t size ) epics_throws (( std::bad_alloc ))
{
return this->freeList.allocate ( size );
}
void cacComBufMemoryManager::release ( void * pCadaver ) throw ()
void cacComBufMemoryManager::release ( void * pCadaver ) epics_throws (())
{
return this->freeList.release ( pCadaver );
}

View File

@@ -31,6 +31,7 @@
# undef epicsExportSharedSymbols
#endif
#include "cxxCompilerDependencies.h"
#include "ipAddrToAsciiAsynchronous.h"
#include "epicsTimer.h"
#include "epicsEvent.h"
@@ -98,8 +99,8 @@ private:
class cacComBufMemoryManager : public comBufMemoryManager
{
public:
void * allocate ( size_t ) throw ( std::bad_alloc );
void release ( void * ) throw ();
void * allocate ( size_t ) epics_throws (( std::bad_alloc ));
void release ( void * ) epics_throws (());
private:
tsFreeList < class comBuf, 0x20 > freeList;
};

View File

@@ -88,17 +88,16 @@ const char * cacChannel::pHostName () const
return ref->pointer ();
}
// ms visual c++ 7.0 appears to require these when they
// are not called?
void cacChannel::operator delete ( void * )
{
throw std::logic_error (
"why is the compiler calling cacChannel::operator delete?" );
}
void cacChannel::operator delete [] ( void * )
{
throw std::logic_error (
"why is the compiler calling cacChannel::operator delete?" );
// Visual C++ .net appears to require operator delete if
// placement operator delete is defined? I smell a ms rat
// because if I declare placement new and delete, but
// comment out the placement delete definition there are
// no undefined symbols.
errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked",
__FILE__, __LINE__ );
}

View File

@@ -205,9 +205,7 @@ private:
cacChannel ( const cacChannel & );
cacChannel & operator = ( const cacChannel & );
void * operator new ( size_t );
void * operator new [] ( size_t );
void operator delete ( void * );
void operator delete [] ( void * );
};
class cacNotify { // X aCC 655

View File

@@ -32,7 +32,7 @@
#include "comBuf.h"
#include "errlog.h"
bool comBuf::flushToWire ( wireSendAdapter & wire ) throw ()
bool comBuf::flushToWire ( wireSendAdapter & wire ) epics_throws (())
{
unsigned occupied = this->occupiedBytes ();
while ( occupied ) {
@@ -47,7 +47,7 @@ bool comBuf::flushToWire ( wireSendAdapter & wire ) throw ()
return true;
}
unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem ) throw ()
unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem ) epics_throws (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -59,7 +59,7 @@ unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem ) throw ()
return nElem;
}
unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem ) throw ()
unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem ) epics_throws (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -71,7 +71,7 @@ unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem ) throw ()
return nElem;
}
unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem ) throw ()
unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem ) epics_throws (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -87,7 +87,7 @@ unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem ) throw ()
return nElem;
}
unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem ) throw ()
unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem ) epics_throws (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -103,7 +103,7 @@ unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem ) throw ()
return nElem;
}
unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem ) throw ()
unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem ) epics_throws (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -114,7 +114,7 @@ unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem ) throw ()
return nElem;
}
unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) throw ()
unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) epics_throws (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -128,13 +128,12 @@ unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) throw ()
// throwing the exception from a function that isnt inline
// shrinks the GNU compiled object code
void comBuf::throwInsufficentBytesException ()
throw ( insufficentBytesAvailable )
epics_throws (( insufficentBytesAvailable ))
{
throw insufficentBytesAvailable ();
}
void comBuf::operator delete ( void *pCadaver )
throw ( std::logic_error )
{
// Visual C++ .net appears to require operator delete if
// placement operator delete is defined? I smell a ms rat

View File

@@ -34,7 +34,7 @@
#include "tsFreeList.h"
#include "tsDLList.h"
#include "osiWireFormat.h"
#include "cxxCompilerDepPlacementDelete.h"
#include "cxxCompilerDependencies.h"
static const unsigned comBufSize = 0x4000;
@@ -43,130 +43,128 @@ class comBufMemoryManager {
public:
virtual ~comBufMemoryManager ();
virtual void * allocate ( size_t )
throw ( std::bad_alloc ) = 0;
epics_throws (( std::bad_alloc )) = 0;
virtual void release ( void * )
throw () = 0;
epics_throws (()) = 0;
};
class wireSendAdapter { // X aCC 655
public:
virtual unsigned sendBytes ( const void *pBuf,
unsigned nBytesInBuf ) throw () = 0;
unsigned nBytesInBuf ) epics_throws (()) = 0;
};
class wireRecvAdapter { // X aCC 655
public:
virtual unsigned recvBytes ( void *pBuf,
unsigned nBytesInBuf ) throw () = 0;
unsigned nBytesInBuf ) epics_throws (()) = 0;
};
class comBuf : public tsDLNode < comBuf > {
public:
class insufficentBytesAvailable {};
comBuf () throw();
unsigned unoccupiedBytes () const throw();
unsigned occupiedBytes () const throw();
unsigned uncommittedBytes () const throw();
static unsigned capacityBytes () throw();
void clear () throw ();
unsigned copyInBytes ( const void *pBuf, unsigned nBytes ) throw();
unsigned push ( comBuf & ) throw();
bool push ( const epicsInt8 & value ) throw();
bool push ( const epicsUInt8 & value ) throw();
bool push ( const epicsInt16 & value ) throw();
bool push ( const epicsUInt16 & value ) throw();
bool push ( const epicsInt32 & value ) throw();
bool push ( const epicsUInt32 & value ) throw();
bool push ( const epicsFloat32 & value ) throw();
bool push ( const epicsFloat64 & value ) throw();
bool push ( const epicsOldString & value ) throw();
unsigned push ( const epicsInt8 *pValue, unsigned nElem ) throw();
unsigned push ( const epicsUInt8 *pValue, unsigned nElem ) throw();
unsigned push ( const epicsInt16 *pValue, unsigned nElem ) throw();
unsigned push ( const epicsUInt16 *pValue, unsigned nElem ) throw();
unsigned push ( const epicsInt32 *pValue, unsigned nElem ) throw();
unsigned push ( const epicsUInt32 *pValue, unsigned nElem ) throw();
unsigned push ( const epicsFloat32 *pValue, unsigned nElem ) throw();
unsigned push ( const epicsFloat64 *pValue, unsigned nElem ) throw();
unsigned push ( const epicsOldString *pValue, unsigned nElem ) throw();
void commitIncomming () throw();
void clearUncommittedIncomming () throw();
bool copyInAllBytes ( const void *pBuf, unsigned nBytes ) throw();
unsigned copyOutBytes ( void *pBuf, unsigned nBytes ) throw();
bool copyOutAllBytes ( void *pBuf, unsigned nBytes ) throw();
unsigned removeBytes ( unsigned nBytes ) throw();
bool flushToWire ( wireSendAdapter & ) throw ();
unsigned fillFromWire ( wireRecvAdapter & ) throw ();
comBuf () epics_throws (());
unsigned unoccupiedBytes () const epics_throws (());
unsigned occupiedBytes () const epics_throws (());
unsigned uncommittedBytes () const epics_throws (());
static unsigned capacityBytes () epics_throws (());
void clear () epics_throws (());
unsigned copyInBytes ( const void *pBuf, unsigned nBytes ) epics_throws (());
unsigned push ( comBuf & ) epics_throws (());
bool push ( const epicsInt8 & value ) epics_throws (());
bool push ( const epicsUInt8 & value ) epics_throws (());
bool push ( const epicsInt16 & value ) epics_throws (());
bool push ( const epicsUInt16 & value ) epics_throws (());
bool push ( const epicsInt32 & value ) epics_throws (());
bool push ( const epicsUInt32 & value ) epics_throws (());
bool push ( const epicsFloat32 & value ) epics_throws (());
bool push ( const epicsFloat64 & value ) epics_throws (());
bool push ( const epicsOldString & value ) epics_throws (());
unsigned push ( const epicsInt8 *pValue, unsigned nElem ) epics_throws (());
unsigned push ( const epicsUInt8 *pValue, unsigned nElem ) epics_throws (());
unsigned push ( const epicsInt16 *pValue, unsigned nElem ) epics_throws (());
unsigned push ( const epicsUInt16 *pValue, unsigned nElem ) epics_throws (());
unsigned push ( const epicsInt32 *pValue, unsigned nElem ) epics_throws (());
unsigned push ( const epicsUInt32 *pValue, unsigned nElem ) epics_throws (());
unsigned push ( const epicsFloat32 *pValue, unsigned nElem ) epics_throws (());
unsigned push ( const epicsFloat64 *pValue, unsigned nElem ) epics_throws (());
unsigned push ( const epicsOldString *pValue, unsigned nElem ) epics_throws (());
void commitIncomming () epics_throws (());
void clearUncommittedIncomming () epics_throws (());
bool copyInAllBytes ( const void *pBuf, unsigned nBytes ) epics_throws (());
unsigned copyOutBytes ( void *pBuf, unsigned nBytes ) epics_throws (());
bool copyOutAllBytes ( void *pBuf, unsigned nBytes ) epics_throws (());
unsigned removeBytes ( unsigned nBytes ) epics_throws (());
bool flushToWire ( wireSendAdapter & ) epics_throws (());
unsigned fillFromWire ( wireRecvAdapter & ) epics_throws (());
epicsUInt8 popUInt8 ()
throw ( comBuf::insufficentBytesAvailable );
epics_throws (( comBuf::insufficentBytesAvailable ));
epicsUInt16 popUInt16 ()
throw ( comBuf::insufficentBytesAvailable );
epics_throws (( comBuf::insufficentBytesAvailable ));
epicsUInt32 popUInt32 ()
throw ( comBuf::insufficentBytesAvailable );
epics_throws (( comBuf::insufficentBytesAvailable ));
static void throwInsufficentBytesException ()
throw ( comBuf::insufficentBytesAvailable );
epics_throws (( comBuf::insufficentBytesAvailable ));
void * operator new ( size_t size,
comBufMemoryManager & ) throw ( std::bad_alloc );
comBufMemoryManager & ) epics_throws (( std::bad_alloc ));
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *,
comBufMemoryManager & ) throw ();
comBufMemoryManager & ) epics_throws (());
# endif
private:
unsigned commitIndex;
unsigned nextWriteIndex;
unsigned nextReadIndex;
epicsUInt8 buf [ comBufSize ];
unsigned unoccupiedElem ( unsigned elemSize, unsigned nElem ) throw ();
unsigned occupiedElem ( unsigned elemSize, unsigned nElem ) throw ();
void * operator new ( size_t size ) throw ( std::bad_alloc );
void operator delete ( void * ) throw ( std::logic_error );
void * operator new [] ( size_t size ) throw ( std::bad_alloc );
void operator delete [] ( void * ) throw ( std::logic_error );
unsigned unoccupiedElem ( unsigned elemSize, unsigned nElem ) epics_throws (());
unsigned occupiedElem ( unsigned elemSize, unsigned nElem ) epics_throws (());
void * operator new ( size_t size ) epics_throws (( std::bad_alloc ));
void operator delete ( void * ) epics_throws (());
};
inline void * comBuf::operator new ( size_t size,
comBufMemoryManager & mgr )
throw ( std::bad_alloc )
epics_throws (( std::bad_alloc ))
{
return mgr.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
inline void comBuf::operator delete ( void * pCadaver,
comBufMemoryManager & mgr ) throw ()
comBufMemoryManager & mgr ) epics_throws (())
{
mgr.release ( pCadaver );
}
#endif
inline comBuf::comBuf () throw () : commitIndex ( 0u ),
inline comBuf::comBuf () epics_throws (()) : commitIndex ( 0u ),
nextWriteIndex ( 0u ), nextReadIndex ( 0u )
{
}
inline void comBuf::clear () throw ()
inline void comBuf::clear () epics_throws (())
{
this->commitIndex = 0u;
this->nextWriteIndex = 0u;
this->nextReadIndex = 0u;
}
inline unsigned comBuf::unoccupiedBytes () const throw ()
inline unsigned comBuf::unoccupiedBytes () const epics_throws (())
{
return sizeof ( this->buf ) - this->nextWriteIndex;
}
inline unsigned comBuf::occupiedBytes () const throw ()
inline unsigned comBuf::occupiedBytes () const epics_throws (())
{
return this->commitIndex - this->nextReadIndex;
}
inline unsigned comBuf::uncommittedBytes () const throw ()
inline unsigned comBuf::uncommittedBytes () const epics_throws (())
{
return this->nextWriteIndex - this->commitIndex;
}
inline unsigned comBuf::push ( comBuf & bufIn ) throw ()
inline unsigned comBuf::push ( comBuf & bufIn ) epics_throws (())
{
unsigned nBytes = this->copyInBytes (
& bufIn.buf[ bufIn.nextReadIndex ],
@@ -175,12 +173,12 @@ inline unsigned comBuf::push ( comBuf & bufIn ) throw ()
return nBytes;
}
inline unsigned comBuf::capacityBytes () throw ()
inline unsigned comBuf::capacityBytes () epics_throws (())
{
return comBufSize;
}
inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) throw ()
inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) epics_throws (())
{
unsigned nNewBytes = wire.recvBytes (
& this->buf[this->nextWriteIndex],
@@ -189,7 +187,7 @@ inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) throw ()
return nNewBytes;
}
inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) throw ()
inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) epics_throws (())
{
unsigned avail = this->unoccupiedBytes ();
if ( elemSize * nElem > avail ) {
@@ -198,7 +196,7 @@ inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) thr
return nElem;
}
inline bool comBuf::push ( const epicsInt8 & value ) throw ()
inline bool comBuf::push ( const epicsInt8 & value ) epics_throws (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -208,7 +206,7 @@ inline bool comBuf::push ( const epicsInt8 & value ) throw ()
return true;
}
inline bool comBuf::push ( const epicsUInt8 & value ) throw ()
inline bool comBuf::push ( const epicsUInt8 & value ) epics_throws (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -217,7 +215,7 @@ inline bool comBuf::push ( const epicsUInt8 & value ) throw ()
return true;
}
inline bool comBuf::push ( const epicsInt16 & value ) throw ()
inline bool comBuf::push ( const epicsInt16 & value ) epics_throws (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -229,7 +227,7 @@ inline bool comBuf::push ( const epicsInt16 & value ) throw ()
return true;
}
inline bool comBuf::push ( const epicsUInt16 & value ) throw ()
inline bool comBuf::push ( const epicsUInt16 & value ) epics_throws (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -241,7 +239,7 @@ inline bool comBuf::push ( const epicsUInt16 & value ) throw ()
return true;
}
inline bool comBuf::push ( const epicsInt32 & value ) throw ()
inline bool comBuf::push ( const epicsInt32 & value ) epics_throws (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -257,7 +255,7 @@ inline bool comBuf::push ( const epicsInt32 & value ) throw ()
return true;
}
inline bool comBuf::push ( const epicsUInt32 & value ) throw ()
inline bool comBuf::push ( const epicsUInt32 & value ) epics_throws (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -273,7 +271,7 @@ inline bool comBuf::push ( const epicsUInt32 & value ) throw ()
return true;
}
inline bool comBuf::push ( const epicsFloat32 & value ) throw ()
inline bool comBuf::push ( const epicsFloat32 & value ) epics_throws (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -284,7 +282,7 @@ inline bool comBuf::push ( const epicsFloat32 & value ) throw ()
return true;
}
inline bool comBuf::push ( const epicsFloat64 & value ) throw ()
inline bool comBuf::push ( const epicsFloat64 & value ) epics_throws (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -295,7 +293,7 @@ inline bool comBuf::push ( const epicsFloat64 & value ) throw ()
return true;
}
inline bool comBuf::push ( const epicsOldString & value ) throw ()
inline bool comBuf::push ( const epicsOldString & value ) epics_throws (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -305,17 +303,17 @@ inline bool comBuf::push ( const epicsOldString & value ) throw ()
return true;
}
inline unsigned comBuf::push ( const epicsInt8 *pValue, unsigned nElem ) throw ()
inline unsigned comBuf::push ( const epicsInt8 *pValue, unsigned nElem ) epics_throws (())
{
return copyInBytes ( pValue, nElem );
}
inline unsigned comBuf::push ( const epicsUInt8 *pValue, unsigned nElem ) throw ()
inline unsigned comBuf::push ( const epicsUInt8 *pValue, unsigned nElem ) epics_throws (())
{
return copyInBytes ( pValue, nElem );
}
inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) throw ()
inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) epics_throws (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
unsigned size = nElem * sizeof ( *pValue );
@@ -324,7 +322,7 @@ inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) th
return nElem;
}
inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) throw ()
inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) epics_throws (())
{
unsigned avail = this->occupiedBytes ();
if ( elemSize * nElem > avail ) {
@@ -333,17 +331,17 @@ inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) throw
return nElem;
}
inline void comBuf::commitIncomming () throw ()
inline void comBuf::commitIncomming () epics_throws (())
{
this->commitIndex = this->nextWriteIndex;
}
inline void comBuf::clearUncommittedIncomming () throw ()
inline void comBuf::clearUncommittedIncomming () epics_throws (())
{
this->nextWriteIndex = this->commitIndex;
}
inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) throw ()
inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) epics_throws (())
{
if ( nBytes <= this->unoccupiedBytes () ) {
memcpy ( & this->buf[this->nextWriteIndex], pBuf, nBytes );
@@ -353,7 +351,7 @@ inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) throw (
return false;
}
inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) throw ()
inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) epics_throws (())
{
if ( nBytes > 0u ) {
unsigned available = this->unoccupiedBytes ();
@@ -366,7 +364,7 @@ inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) throw
return nBytes;
}
inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) throw ()
inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) epics_throws (())
{
if ( nBytes <= this->occupiedBytes () ) {
memcpy ( pBuf, &this->buf[this->nextReadIndex], nBytes);
@@ -376,7 +374,7 @@ inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) throw ()
return false;
}
inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) throw ()
inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) epics_throws (())
{
unsigned occupied = this->occupiedBytes ();
if ( nBytes > occupied ) {
@@ -387,7 +385,7 @@ inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) throw ()
return nBytes;
}
inline unsigned comBuf::removeBytes ( unsigned nBytes ) throw ()
inline unsigned comBuf::removeBytes ( unsigned nBytes ) epics_throws (())
{
unsigned occupied = this->occupiedBytes ();
if ( nBytes > occupied ) {
@@ -398,7 +396,7 @@ inline unsigned comBuf::removeBytes ( unsigned nBytes ) throw ()
}
inline epicsUInt8 comBuf::popUInt8 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
if ( this->occupiedBytes () < 1u ) {
comBuf::throwInsufficentBytesException ();
@@ -407,7 +405,7 @@ inline epicsUInt8 comBuf::popUInt8 ()
}
inline epicsUInt16 comBuf::popUInt16 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
if ( this->occupiedBytes () < 2u ) {
comBuf::throwInsufficentBytesException ();
@@ -418,7 +416,7 @@ inline epicsUInt16 comBuf::popUInt16 ()
}
inline epicsUInt32 comBuf::popUInt32 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
if ( this->occupiedBytes () < 4u ) {
comBuf::throwInsufficentBytesException ();

View File

@@ -27,17 +27,17 @@
#include "iocinf.h"
#include "virtualCircuit.h"
comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ) throw () :
comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ) epics_throws (()) :
comBufMemMgr ( comBufMemoryManagerIn ), nBytesPending ( 0u )
{
}
comQueRecv::~comQueRecv () throw ()
comQueRecv::~comQueRecv () epics_throws (())
{
this->clear ();
}
void comQueRecv::clear () throw ()
void comQueRecv::clear () epics_throws (())
{
comBuf *pBuf;
while ( ( pBuf = this->bufs.get () ) ) {
@@ -47,7 +47,7 @@ void comQueRecv::clear () throw ()
this->nBytesPending = 0u;
}
unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) throw ()
unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epics_throws (())
{
unsigned totalBytes = 0u;
do {
@@ -68,7 +68,7 @@ unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) throw ()
return totalBytes;
}
unsigned comQueRecv::removeBytes ( unsigned nBytes ) throw ()
unsigned comQueRecv::removeBytes ( unsigned nBytes ) epics_throws (())
{
unsigned totalBytes = 0u;
unsigned bytesLeft = nBytes;
@@ -95,7 +95,7 @@ unsigned comQueRecv::removeBytes ( unsigned nBytes ) throw ()
}
void comQueRecv::popString ( epicsOldString *pStr )
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
for ( unsigned i = 0u; i < sizeof ( *pStr ); i++ ) {
pStr[0][i] = this->popInt8 ();
@@ -103,7 +103,7 @@ void comQueRecv::popString ( epicsOldString *pStr )
}
void comQueRecv::pushLastComBufReceived ( comBuf & bufIn )
throw ()
epics_throws (())
{
bufIn.commitIncomming ();
comBuf * pComBuf = this->bufs.last ();
@@ -128,7 +128,7 @@ void comQueRecv::pushLastComBufReceived ( comBuf & bufIn )
// 2) using canonical unsigned tmp avoids ANSI C conversions to int
// 3) cast required because sizeof(unsigned) >= sizeof(epicsUInt32)
epicsUInt16 comQueRecv::multiBufferPopUInt16 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
epicsUInt16 tmp;
if ( this->occupiedBytes() >= sizeof (tmp) ) {
@@ -147,7 +147,7 @@ epicsUInt16 comQueRecv::multiBufferPopUInt16 ()
// 2) using canonical unsigned temporary avoids ANSI C conversions to int
// 3) cast required because sizeof(unsigned) >= sizeof(epicsUInt32)
epicsUInt32 comQueRecv::multiBufferPopUInt32 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
epicsUInt32 tmp;
if ( this->occupiedBytes() >= sizeof (tmp) ) {
@@ -168,7 +168,7 @@ epicsUInt32 comQueRecv::multiBufferPopUInt32 ()
return tmp;
}
void comQueRecv::removeAndDestroyBuf ( comBuf & buf ) throw ()
void comQueRecv::removeAndDestroyBuf ( comBuf & buf ) epics_throws (())
{
this->bufs.remove ( buf );
buf.~comBuf ();

View File

@@ -27,56 +27,58 @@
#ifndef comQueRecvh
#define comQueRecvh
#include "comBuf.h"
class comQueRecv {
public:
comQueRecv ( comBufMemoryManager & ) throw ();
~comQueRecv () throw ();
unsigned occupiedBytes () const throw ();
unsigned copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) throw ();
unsigned removeBytes ( unsigned nBytes ) throw ();
void pushLastComBufReceived ( comBuf & ) throw ();
void clear () throw ();
epicsInt8 popInt8 () throw ( comBuf::insufficentBytesAvailable );
epicsUInt8 popUInt8 () throw ( comBuf::insufficentBytesAvailable );
epicsInt16 popInt16 () throw ( comBuf::insufficentBytesAvailable );
epicsUInt16 popUInt16 () throw ( comBuf::insufficentBytesAvailable );
epicsInt32 popInt32 () throw ( comBuf::insufficentBytesAvailable );
epicsUInt32 popUInt32 () throw ( comBuf::insufficentBytesAvailable );
epicsFloat32 popFloat32 () throw ( comBuf::insufficentBytesAvailable );
epicsFloat64 popFloat64 () throw ( comBuf::insufficentBytesAvailable );
void popString ( epicsOldString * ) throw ( comBuf::insufficentBytesAvailable );
comQueRecv ( comBufMemoryManager & ) epics_throws (());
~comQueRecv () epics_throws (());
unsigned occupiedBytes () const epics_throws (());
unsigned copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epics_throws (());
unsigned removeBytes ( unsigned nBytes ) epics_throws (());
void pushLastComBufReceived ( comBuf & ) epics_throws (());
void clear () epics_throws (());
epicsInt8 popInt8 () epics_throws (( comBuf::insufficentBytesAvailable ));
epicsUInt8 popUInt8 () epics_throws (( comBuf::insufficentBytesAvailable ));
epicsInt16 popInt16 () epics_throws (( comBuf::insufficentBytesAvailable ));
epicsUInt16 popUInt16 () epics_throws (( comBuf::insufficentBytesAvailable ));
epicsInt32 popInt32 () epics_throws (( comBuf::insufficentBytesAvailable ));
epicsUInt32 popUInt32 () epics_throws (( comBuf::insufficentBytesAvailable ));
epicsFloat32 popFloat32 () epics_throws (( comBuf::insufficentBytesAvailable ));
epicsFloat64 popFloat64 () epics_throws (( comBuf::insufficentBytesAvailable ));
void popString ( epicsOldString * ) epics_throws (( comBuf::insufficentBytesAvailable ));
private:
tsDLList < comBuf > bufs;
comBufMemoryManager & comBufMemMgr;
unsigned nBytesPending;
epicsUInt16 multiBufferPopUInt16 () throw ( comBuf::insufficentBytesAvailable );
epicsUInt32 multiBufferPopUInt32 () throw ( comBuf::insufficentBytesAvailable );
void removeAndDestroyBuf ( comBuf & ) throw ();
comQueRecv ( const comQueRecv & ) throw ();
comQueRecv & operator = ( const comQueRecv & ) throw ();
epicsUInt16 multiBufferPopUInt16 () epics_throws (( comBuf::insufficentBytesAvailable ));
epicsUInt32 multiBufferPopUInt32 () epics_throws (( comBuf::insufficentBytesAvailable ));
void removeAndDestroyBuf ( comBuf & ) epics_throws (());
comQueRecv ( const comQueRecv & ) epics_throws (());
comQueRecv & operator = ( const comQueRecv & ) epics_throws (());
};
inline unsigned comQueRecv::occupiedBytes () const
throw ()
epics_throws (())
{
return this->nBytesPending;
}
inline epicsInt8 comQueRecv::popInt8 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
return static_cast < epicsInt8 > ( this->popUInt8() );
}
inline epicsInt16 comQueRecv::popInt16 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
return static_cast < epicsInt16 > ( this->popInt8() << 8u
| this->popInt8() << 0u );
}
inline epicsInt32 comQueRecv::popInt32 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
epicsInt32 tmp ;
tmp = this->popInt8() << 24u;
@@ -87,7 +89,7 @@ inline epicsInt32 comQueRecv::popInt32 ()
}
inline epicsFloat32 comQueRecv::popFloat32 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
epicsFloat32 tmp;
epicsUInt8 wire[ sizeof ( tmp ) ];
@@ -100,7 +102,7 @@ inline epicsFloat32 comQueRecv::popFloat32 ()
}
inline epicsFloat64 comQueRecv::popFloat64 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
epicsFloat64 tmp;
epicsUInt8 wire[ sizeof ( tmp ) ];
@@ -113,7 +115,7 @@ inline epicsFloat64 comQueRecv::popFloat64 ()
}
inline epicsUInt8 comQueRecv::popUInt8 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
comBuf * pComBuf = this->bufs.first ();
if ( ! pComBuf ) {
@@ -129,7 +131,7 @@ inline epicsUInt8 comQueRecv::popUInt8 ()
// optimization here complicates this function somewhat
inline epicsUInt16 comQueRecv::popUInt16 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
comBuf *pComBuf = this->bufs.first ();
if ( ! pComBuf ) {
@@ -155,7 +157,7 @@ inline epicsUInt16 comQueRecv::popUInt16 ()
// optimization here complicates this function somewhat
inline epicsUInt32 comQueRecv::popUInt32 ()
throw ( comBuf::insufficentBytesAvailable )
epics_throws (( comBuf::insufficentBytesAvailable ))
{
comBuf *pComBuf = this->bufs.first ();
if ( ! pComBuf ) {

View File

@@ -81,18 +81,18 @@ const char cacNillBytes [] =
};
comQueSend::comQueSend ( wireSendAdapter & wireIn,
comBufMemoryManager & comBufMemMgrIn ) throw () :
comBufMemoryManager & comBufMemMgrIn ) epics_throws (()) :
comBufMemMgr ( comBufMemMgrIn ), wire ( wireIn ),
nBytesPending ( 0u )
{
}
comQueSend::~comQueSend () throw ()
comQueSend::~comQueSend () epics_throws (())
{
this->clear ();
}
void comQueSend::clear () throw ()
void comQueSend::clear () epics_throws (())
{
comBuf *pBuf;
@@ -109,7 +109,7 @@ void comQueSend::clear () throw ()
assert ( this->nBytesPending == 0 );
}
void comQueSend::clearUncommitted () throw ()
void comQueSend::clearUncommitted () epics_throws (())
{
while ( this->pFirstUncommited.valid() ) {
tsDLIter < comBuf > next = this->pFirstUncommited;
@@ -129,32 +129,32 @@ void comQueSend::clearUncommitted () throw ()
}
}
void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem ) throw ()
void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem ) epics_throws (())
{
this->push ( static_cast <const dbr_string_t *> ( pValue ), nElem );
}
void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem ) throw ()
void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem ) epics_throws (())
{
this->push ( static_cast <const dbr_short_t *> ( pValue ), nElem );
}
void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem ) throw ()
void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem ) epics_throws (())
{
this->push ( static_cast <const dbr_float_t *> ( pValue ), nElem );
}
void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem ) throw ()
void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem ) epics_throws (())
{
this->push ( static_cast <const dbr_char_t *> ( pValue ), nElem );
}
void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem ) throw ()
void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem ) epics_throws (())
{
this->push ( static_cast <const dbr_long_t *> ( pValue ), nElem );
}
void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem ) throw ()
void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem ) epics_throws (())
{
this->push ( static_cast <const dbr_double_t *> ( pValue ), nElem );
}
@@ -201,7 +201,7 @@ const comQueSend::copyFunc_t comQueSend::dbrCopyVector [39] = {
0 // DBR_CLASS_NAME
};
comBuf * comQueSend::popNextComBufToSend () throw ()
comBuf * comQueSend::popNextComBufToSend () epics_throws (())
{
comBuf *pBuf = this->bufs.get ();
if ( pBuf ) {
@@ -225,7 +225,7 @@ void comQueSend::insertRequestHeader (
ca_uint16_t request, ca_uint32_t payloadSize,
ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid,
ca_uint32_t requestDependent, bool v49Ok )
throw ( cacChannel::outOfBounds )
epics_throws (( cacChannel::outOfBounds ))
{
this->beginMsg ();
if ( payloadSize < 0xffff && nElem < 0xffff ) {
@@ -254,7 +254,7 @@ void comQueSend::insertRequestHeader (
void comQueSend::insertRequestWithPayLoad (
ca_uint16_t request, unsigned dataType, ca_uint32_t nElem,
ca_uint32_t cid, ca_uint32_t requestDependent, const void * pPayload,
bool v49Ok ) throw ( cacChannel::outOfBounds )
bool v49Ok ) epics_throws (( cacChannel::outOfBounds ))
{
if ( ! this->dbr_type_ok ( dataType ) ) {
throw cacChannel::badType();
@@ -299,7 +299,7 @@ void comQueSend::insertRequestWithPayLoad (
this->commitMsg ();
}
void comQueSend::commitMsg () throw ()
void comQueSend::commitMsg () epics_throws (())
{
while ( this->pFirstUncommited.valid() ) {
this->nBytesPending += this->pFirstUncommited->uncommittedBytes ();

View File

@@ -40,56 +40,56 @@
//
class comQueSend {
public:
comQueSend ( wireSendAdapter &, comBufMemoryManager & ) throw ();
~comQueSend () throw ();
void clear () throw ();
void beginMsg () throw ();
void commitMsg () throw ();
unsigned occupiedBytes () const throw ();
bool flushEarlyThreshold ( unsigned nBytesThisMsg ) const throw ();
bool flushBlockThreshold ( unsigned nBytesThisMsg ) const throw ();
bool dbr_type_ok ( unsigned type ) throw ();
void pushUInt16 ( const ca_uint16_t value ) throw ();
void pushUInt32 ( const ca_uint32_t value ) throw ();
void pushFloat32 ( const ca_float32_t value ) throw ();
void pushString ( const char *pVal, unsigned nChar ) throw ();
comQueSend ( wireSendAdapter &, comBufMemoryManager & ) epics_throws (());
~comQueSend () epics_throws (());
void clear () epics_throws (());
void beginMsg () epics_throws (());
void commitMsg () epics_throws (());
unsigned occupiedBytes () const epics_throws (());
bool flushEarlyThreshold ( unsigned nBytesThisMsg ) const epics_throws (());
bool flushBlockThreshold ( unsigned nBytesThisMsg ) const epics_throws (());
bool dbr_type_ok ( unsigned type ) epics_throws (());
void pushUInt16 ( const ca_uint16_t value ) epics_throws (());
void pushUInt32 ( const ca_uint32_t value ) epics_throws (());
void pushFloat32 ( const ca_float32_t value ) epics_throws (());
void pushString ( const char *pVal, unsigned nChar ) epics_throws (());
void insertRequestHeader (
ca_uint16_t request, ca_uint32_t payloadSize,
ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid,
ca_uint32_t requestDependent, bool v49Ok )
throw ( cacChannel::outOfBounds );
epics_throws (( cacChannel::outOfBounds ));
void insertRequestWithPayLoad (
ca_uint16_t request, unsigned dataType, ca_uint32_t nElem,
ca_uint32_t cid, ca_uint32_t requestDependent,
const void * pPayload, bool v49Ok )
throw ( cacChannel::outOfBounds );
void push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) throw ();
comBuf * popNextComBufToSend () throw ();
epics_throws (( cacChannel::outOfBounds ));
void push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) epics_throws (());
comBuf * popNextComBufToSend () epics_throws (());
private:
comBufMemoryManager & comBufMemMgr;
tsDLList < comBuf > bufs;
tsDLIter < comBuf > pFirstUncommited;
wireSendAdapter & wire;
unsigned nBytesPending;
void copy_dbr_string ( const void *pValue, unsigned nElem ) throw ();
void copy_dbr_short ( const void *pValue, unsigned nElem ) throw ();
void copy_dbr_float ( const void *pValue, unsigned nElem ) throw ();
void copy_dbr_char ( const void *pValue, unsigned nElem ) throw ();
void copy_dbr_long ( const void *pValue, unsigned nElem ) throw ();
void copy_dbr_double ( const void *pValue, unsigned nElem ) throw ();
void pushComBuf ( comBuf & ) throw ();
void copy_dbr_string ( const void *pValue, unsigned nElem ) epics_throws (());
void copy_dbr_short ( const void *pValue, unsigned nElem ) epics_throws (());
void copy_dbr_float ( const void *pValue, unsigned nElem ) epics_throws (());
void copy_dbr_char ( const void *pValue, unsigned nElem ) epics_throws (());
void copy_dbr_long ( const void *pValue, unsigned nElem ) epics_throws (());
void copy_dbr_double ( const void *pValue, unsigned nElem ) epics_throws (());
void pushComBuf ( comBuf & ) epics_throws (());
typedef void ( comQueSend::*copyFunc_t ) (
const void *pValue, unsigned nElem );
static const copyFunc_t dbrCopyVector [39];
void clearUncommitted () throw ();
void clearUncommitted () epics_throws (());
//
// visual C++ versions 6 & 7 do not allow out of
// class member template function definition
//
template < class T >
inline void push ( const T *pVal, const unsigned nElem ) throw ()
inline void push ( const T *pVal, const unsigned nElem ) epics_throws (())
{
comBuf * pLastBuf = this->bufs.last ();
unsigned nCopied;
@@ -113,7 +113,7 @@ private:
// class member template function definition
//
template < class T >
inline void push ( const T & val ) throw ()
inline void push ( const T & val ) epics_throws (())
{
comBuf * pComBuf = this->bufs.last ();
if ( pComBuf && pComBuf->push ( val ) ) {
@@ -124,13 +124,13 @@ private:
this->pushComBuf ( *pComBuf );
}
comQueSend ( const comQueSend & ) throw ();
comQueSend & operator = ( const comQueSend & ) throw ();
comQueSend ( const comQueSend & ) epics_throws (());
comQueSend & operator = ( const comQueSend & ) epics_throws (());
};
extern const char cacNillBytes[];
inline bool comQueSend::dbr_type_ok ( unsigned type ) throw ()
inline bool comQueSend::dbr_type_ok ( unsigned type ) epics_throws (())
{
if ( type >= ( sizeof ( this->dbrCopyVector ) / sizeof ( this->dbrCopyVector[0] ) ) ) {
return false;
@@ -141,34 +141,34 @@ inline bool comQueSend::dbr_type_ok ( unsigned type ) throw ()
return true;
}
inline void comQueSend::pushUInt16 ( const ca_uint16_t value ) throw ()
inline void comQueSend::pushUInt16 ( const ca_uint16_t value ) epics_throws (())
{
this->push ( value );
}
inline void comQueSend::pushUInt32 ( const ca_uint32_t value ) throw ()
inline void comQueSend::pushUInt32 ( const ca_uint32_t value ) epics_throws (())
{
this->push ( value );
}
inline void comQueSend::pushFloat32 ( const ca_float32_t value ) throw ()
inline void comQueSend::pushFloat32 ( const ca_float32_t value ) epics_throws (())
{
this->push ( value );
}
inline void comQueSend::pushString ( const char *pVal, unsigned nChar ) throw ()
inline void comQueSend::pushString ( const char *pVal, unsigned nChar ) epics_throws (())
{
this->push ( pVal, nChar );
}
// it is assumed that dbr_type_ok() was called prior to calling this routine
// to check the type code
inline void comQueSend::push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) throw ()
inline void comQueSend::push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) epics_throws (())
{
( this->*dbrCopyVector [type] ) ( pVal, nElem );
}
inline void comQueSend::pushComBuf ( comBuf & cb ) throw ()
inline void comQueSend::pushComBuf ( comBuf & cb ) epics_throws (())
{
this->bufs.add ( cb );
if ( ! this->pFirstUncommited.valid() ) {
@@ -176,22 +176,22 @@ inline void comQueSend::pushComBuf ( comBuf & cb ) throw ()
}
}
inline unsigned comQueSend::occupiedBytes () const throw ()
inline unsigned comQueSend::occupiedBytes () const epics_throws (())
{
return this->nBytesPending;
}
inline bool comQueSend::flushBlockThreshold ( unsigned nBytesThisMsg ) const throw ()
inline bool comQueSend::flushBlockThreshold ( unsigned nBytesThisMsg ) const epics_throws (())
{
return ( this->nBytesPending + nBytesThisMsg > 16 * comBuf::capacityBytes () );
}
inline bool comQueSend::flushEarlyThreshold ( unsigned nBytesThisMsg ) const throw ()
inline bool comQueSend::flushEarlyThreshold ( unsigned nBytesThisMsg ) const epics_throws (())
{
return ( this->nBytesPending + nBytesThisMsg > 4 * comBuf::capacityBytes () );
}
inline void comQueSend::beginMsg () throw ()
inline void comQueSend::beginMsg () epics_throws (())
{
if ( this->pFirstUncommited.valid() ) {
this->clearUncommitted ();

View File

@@ -30,7 +30,7 @@
#include "ipAddrToAsciiAsynchronous.h"
#include "tsFreeList.h"
#include "epicsMutex.h"
#include "cxxCompilerDepPlacementDelete.h"
#include "cxxCompilerDependencies.h"
class cac;
class callbackMutex;

View File

@@ -35,7 +35,7 @@
#include "tsDLList.h"
#include "tsFreeList.h"
#include "epicsMutex.h"
#include "cxxCompilerDepPlacementDelete.h"
#include "cxxCompilerDependencies.h"
#ifdef nciuh_restore_epicsExportSharedSymbols
# define epicsExportSharedSymbols

View File

@@ -27,7 +27,7 @@
#define netIOh
#include "nciu.h"
#include "cxxCompilerDepPlacementDelete.h"
#include "cxxCompilerDependencies.h"
// SUN PRO generates multiply defined symbols if the baseNMIU
// destructor is virtual (therefore it is protected).

View File

@@ -33,7 +33,7 @@
#endif
#include "tsFreeList.h"
#include "cxxCompilerDepPlacementDelete.h"
#include "cxxCompilerDependencies.h"
#ifdef oldAccessh_restore_epicsExportSharedSymbols
# define epicsExportSharedSymbols

View File

@@ -34,7 +34,7 @@
#include "tsDLList.h"
#include "tsFreeList.h"
#include "cxxCompilerDepPlacementDelete.h"
#include "cxxCompilerDependencies.h"
#ifdef repeaterClienth_restore_epicsExportSharedSymbols
# define epicsExportSharedSymbols

View File

@@ -35,7 +35,7 @@
#include "tsFreeList.h"
#include "resourceLib.h"
#include "epicsEvent.h"
#include "cxxCompilerDepPlacementDelete.h"
#include "cxxCompilerDependencies.h"
#ifdef syncGrouph_restore_epicsExportSharedSymbols
# define epicsExportSharedSymbols

View File

@@ -139,7 +139,7 @@ void tcpSendThread::run ()
}
unsigned tcpiiu::sendBytes ( const void *pBuf,
unsigned nBytesInBuf ) throw ()
unsigned nBytesInBuf ) epics_throws (())
{
int status;
unsigned nBytes = 0u;
@@ -202,7 +202,7 @@ unsigned tcpiiu::sendBytes ( const void *pBuf,
return nBytes;
}
unsigned tcpiiu::recvBytes ( void * pBuf, unsigned nBytesInBuf ) throw ()
unsigned tcpiiu::recvBytes ( void * pBuf, unsigned nBytesInBuf ) epics_throws (())
{
if ( this->state != iiucs_connected &&
this->state != iiucs_clean_shutdown ) {

View File

@@ -170,8 +170,8 @@ private:
bool recvProcessPostponedFlush;
bool processIncoming ( epicsGuard < callbackMutex > & );
unsigned sendBytes ( const void *pBuf, unsigned nBytesInBuf ) throw ();
unsigned recvBytes ( void *pBuf, unsigned nBytesInBuf ) throw ();
unsigned sendBytes ( const void *pBuf, unsigned nBytesInBuf ) epics_throws (());
unsigned recvBytes ( void *pBuf, unsigned nBytesInBuf ) epics_throws (());
void connect ();
const char * pHostName () const;

View File

@@ -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 -> ();
}

View File

@@ -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 ) );

View File

@@ -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;

View File

@@ -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 )
{
}

View File

@@ -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: