upgraded compiler specific macros

This commit is contained in:
Jeff Hill
2002-10-30 18:29:40 +00:00
parent 0dce06f4cf
commit d4cb389a5d
28 changed files with 252 additions and 349 deletions
+3 -1
View File
@@ -62,7 +62,9 @@ inline autoPtrFreeList<T>::~autoPtrFreeList ()
{
if ( this->p ) {
this->p->~T();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
// its probably a good idea to require that the class has placement delete
// by calling it during cleanup if the compiler supports it
# if defined ( CXX_PLACEMENT_DELETE )
T::operator delete ( this->p, this->freeList );
# else
this->freeList.release ( this->p );
+2 -2
View File
@@ -45,7 +45,7 @@
* between the 1st and 2nd beacons)
*/
bhe::bhe ( const epicsTime & initialTimeStamp,
unsigned initialBeaconNumber, const inetAddrID & addr ) epics_throws (()) :
unsigned initialBeaconNumber, const inetAddrID & addr ) epicsThrows (()) :
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 epics_throws (())
double bhe::period () const epicsThrows (())
{
return this->averagePeriod;
}
+4 -6
View File
@@ -56,22 +56,20 @@ public:
class bhe : public tsSLNode < bhe >, public inetAddrID {
public:
epicsShareFunc bhe ( const epicsTime & initialTimeStamp,
unsigned initialBeaconNumber, const inetAddrID & addr ) epics_throws (());
unsigned initialBeaconNumber, const inetAddrID & addr ) epicsThrows (());
epicsShareFunc ~bhe ();
epicsShareFunc bool updatePeriod (
const epicsTime & programBeginTime,
const epicsTime & currentTime, ca_uint32_t beaconNumber,
unsigned protocolRevision );
epicsShareFunc double period () const epics_throws (());
epicsShareFunc double period () const epicsThrows (());
epicsShareFunc epicsTime updateTime () const;
epicsShareFunc void show ( unsigned level) const;
epicsShareFunc void registerIIU ( tcpiiu & );
epicsShareFunc void unregisterIIU ( tcpiiu & );
epicsShareFunc void * operator new ( size_t size,
bheMemoryManager & );
epicsShareFunc void * operator new ( size_t size, bheMemoryManager & );
#ifdef CXX_PLACEMENT_DELETE
epicsShareFunc void operator delete ( void *,
bheMemoryManager & );
epicsShareFunc void operator delete ( void *, bheMemoryManager & ) epicsThrows (());
#endif
private:
tsDLList < tcpiiu > iiuList;
+5 -25
View File
@@ -49,51 +49,31 @@ ca_client_context::~ca_client_context ()
void ca_client_context::destroyChannel ( oldChannelNotify & chan )
{
chan.~oldChannelNotify ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
oldChannelNotify::operator delete ( & chan, this->oldChannelNotifyFreeList );
# else
this->oldChannelNotifyFreeList.release ( & chan );
# endif
this->oldChannelNotifyFreeList.release ( & chan );
}
void ca_client_context::destroyGetCopy ( getCopy & gc )
{
gc.~getCopy ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
getCopy::operator delete ( & gc, this->getCopyFreeList );
# else
this->getCopyFreeList.release ( & gc );
# endif
this->getCopyFreeList.release ( & gc );
}
void ca_client_context::destroyGetCallback ( getCallback & gcb )
{
gcb.~getCallback ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
getCallback::operator delete ( & gcb, this->getCallbackFreeList );
# else
this->getCallbackFreeList.release ( & gcb );
# endif
this->getCallbackFreeList.release ( & gcb );
}
void ca_client_context::destroyPutCallback ( putCallback & pcb )
{
pcb.~putCallback ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
putCallback::operator delete ( & pcb, this->putCallbackFreeList );
# else
this->putCallbackFreeList.release ( & pcb );
# endif
this->putCallbackFreeList.release ( & pcb );
}
void ca_client_context::destroySubscription ( oldSubscription & os )
{
os.~oldSubscription ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
oldSubscription::operator delete ( & os, this->subscriptionFreeList );
# else
this->subscriptionFreeList.release ( & os );
# endif
this->subscriptionFreeList.release ( & os );
}
void ca_client_context::changeExceptionEvent ( caExceptionHandler *pfunc, void *arg )
+5 -17
View File
@@ -277,11 +277,7 @@ cac::~cac ()
this->beaconTable.removeAll ( tmpBeaconList );
while ( bhe * pBHE = tmpBeaconList.get() ) {
pBHE->~bhe ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
bhe::operator delete ( pBHE, this->bheFreeList );
# else
this->bheFreeList.release ( pBHE );
# endif
this->bheFreeList.release ( pBHE );
}
osiSockRelease ();
@@ -416,11 +412,7 @@ void cac::beaconNotify ( const inetAddrID & addr, const epicsTime & currentTime,
if ( pBHE ) {
if ( this->beaconTable.add ( *pBHE ) < 0 ) {
pBHE->~bhe ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
bhe::operator delete ( pBHE, this->bheFreeList );
# else
this->bheFreeList.release ( pBHE );
# endif
this->bheFreeList.release ( pBHE );
}
}
return;
@@ -714,11 +706,7 @@ void cac::destroyChannel ( nciu & chan )
// run channel's destructor and return it to the free list
chan.~nciu ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
nciu::operator delete ( & chan, this->channelFreeList );
# else
this->channelFreeList.release ( & chan );
# endif
this->channelFreeList.release ( & chan );
}
int cac::printf ( const char *pformat, ... ) const
@@ -1586,12 +1574,12 @@ void cac::initiateConnect ( nciu & chan )
this->pudpiiu->installChannel ( chan );
}
void *cacComBufMemoryManager::allocate ( size_t size ) epics_throws (( std::bad_alloc ))
void *cacComBufMemoryManager::allocate ( size_t size ) epicsThrows (( std::bad_alloc ))
{
return this->freeList.allocate ( size );
}
void cacComBufMemoryManager::release ( void * pCadaver ) epics_throws (())
void cacComBufMemoryManager::release ( void * pCadaver ) epicsThrows (())
{
return this->freeList.release ( pCadaver );
}
+2 -2
View File
@@ -100,8 +100,8 @@ private:
class cacComBufMemoryManager : public comBufMemoryManager
{
public:
void * allocate ( size_t ) epics_throws (( std::bad_alloc ));
void release ( void * ) epics_throws (());
void * allocate ( size_t ) epicsThrows (( std::bad_alloc ));
void release ( void * ) epicsThrows (());
private:
tsFreeList < class comBuf, 0x20 > freeList;
};
+9 -9
View File
@@ -29,7 +29,7 @@
#include "comBuf.h"
#include "errlog.h"
bool comBuf::flushToWire ( wireSendAdapter & wire ) epics_throws (())
bool comBuf::flushToWire ( wireSendAdapter & wire ) epicsThrows (())
{
unsigned occupied = this->occupiedBytes ();
while ( occupied ) {
@@ -44,7 +44,7 @@ bool comBuf::flushToWire ( wireSendAdapter & wire ) epics_throws (())
return true;
}
unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem ) epics_throws (())
unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem ) epicsThrows (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -56,7 +56,7 @@ unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem ) epics_throws
return nElem;
}
unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem ) epics_throws (())
unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem ) epicsThrows (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -68,7 +68,7 @@ unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem ) epics_throw
return nElem;
}
unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem ) epics_throws (())
unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem ) epicsThrows (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -84,7 +84,7 @@ unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem ) epics_throws
return nElem;
}
unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem ) epics_throws (())
unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem ) epicsThrows (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -100,7 +100,7 @@ unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem ) epics_throw
return nElem;
}
unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem ) epics_throws (())
unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem ) epicsThrows (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -111,7 +111,7 @@ unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem ) epics_thro
return nElem;
}
unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) epics_throws (())
unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) epicsThrows (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
for ( unsigned i = 0u; i < nElem; i++ ) {
@@ -125,12 +125,12 @@ unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) epics_thro
// throwing the exception from a function that isnt inline
// shrinks the GNU compiled object code
void comBuf::throwInsufficentBytesException ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
throw comBuf::insufficentBytesAvailable ();
}
void comBuf::operator delete ( void * ) epics_throws (())
void comBuf::operator delete ( void * ) epicsThrows (())
{
// Visual C++ .net appears to require operator delete if
// placement operator delete is defined? I smell a ms rat
+82 -85
View File
@@ -43,128 +43,125 @@ class comBufMemoryManager {
public:
virtual ~comBufMemoryManager ();
virtual void * allocate ( size_t )
epics_throws (( std::bad_alloc )) = 0;
epicsThrows (( std::bad_alloc )) = 0;
virtual void release ( void * )
epics_throws (()) = 0;
epicsThrows (()) = 0;
};
class wireSendAdapter { // X aCC 655
public:
virtual unsigned sendBytes ( const void *pBuf,
unsigned nBytesInBuf ) epics_throws (()) = 0;
unsigned nBytesInBuf ) epicsThrows (()) = 0;
};
class wireRecvAdapter { // X aCC 655
public:
virtual unsigned recvBytes ( void *pBuf,
unsigned nBytesInBuf ) epics_throws (()) = 0;
unsigned nBytesInBuf ) epicsThrows (()) = 0;
};
class comBuf : public tsDLNode < comBuf > {
public:
class insufficentBytesAvailable {};
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 (());
comBuf () epicsThrows (());
unsigned unoccupiedBytes () const epicsThrows (());
unsigned occupiedBytes () const epicsThrows (());
unsigned uncommittedBytes () const epicsThrows (());
static unsigned capacityBytes () epicsThrows (());
void clear () epicsThrows (());
unsigned copyInBytes ( const void *pBuf, unsigned nBytes ) epicsThrows (());
unsigned push ( comBuf & ) epicsThrows (());
bool push ( const epicsInt8 & value ) epicsThrows (());
bool push ( const epicsUInt8 & value ) epicsThrows (());
bool push ( const epicsInt16 & value ) epicsThrows (());
bool push ( const epicsUInt16 & value ) epicsThrows (());
bool push ( const epicsInt32 & value ) epicsThrows (());
bool push ( const epicsUInt32 & value ) epicsThrows (());
bool push ( const epicsFloat32 & value ) epicsThrows (());
bool push ( const epicsFloat64 & value ) epicsThrows (());
bool push ( const epicsOldString & value ) epicsThrows (());
unsigned push ( const epicsInt8 *pValue, unsigned nElem ) epicsThrows (());
unsigned push ( const epicsUInt8 *pValue, unsigned nElem ) epicsThrows (());
unsigned push ( const epicsInt16 *pValue, unsigned nElem ) epicsThrows (());
unsigned push ( const epicsUInt16 *pValue, unsigned nElem ) epicsThrows (());
unsigned push ( const epicsInt32 *pValue, unsigned nElem ) epicsThrows (());
unsigned push ( const epicsUInt32 *pValue, unsigned nElem ) epicsThrows (());
unsigned push ( const epicsFloat32 *pValue, unsigned nElem ) epicsThrows (());
unsigned push ( const epicsFloat64 *pValue, unsigned nElem ) epicsThrows (());
unsigned push ( const epicsOldString *pValue, unsigned nElem ) epicsThrows (());
void commitIncomming () epicsThrows (());
void clearUncommittedIncomming () epicsThrows (());
bool copyInAllBytes ( const void *pBuf, unsigned nBytes ) epicsThrows (());
unsigned copyOutBytes ( void *pBuf, unsigned nBytes ) epicsThrows (());
bool copyOutAllBytes ( void *pBuf, unsigned nBytes ) epicsThrows (());
unsigned removeBytes ( unsigned nBytes ) epicsThrows (());
bool flushToWire ( wireSendAdapter & ) epicsThrows (());
unsigned fillFromWire ( wireRecvAdapter & ) epicsThrows (());
epicsUInt8 popUInt8 ()
epics_throws (( comBuf::insufficentBytesAvailable ));
epicsThrows (( comBuf::insufficentBytesAvailable ));
epicsUInt16 popUInt16 ()
epics_throws (( comBuf::insufficentBytesAvailable ));
epicsThrows (( comBuf::insufficentBytesAvailable ));
epicsUInt32 popUInt32 ()
epics_throws (( comBuf::insufficentBytesAvailable ));
epicsThrows (( comBuf::insufficentBytesAvailable ));
static void throwInsufficentBytesException ()
epics_throws (( comBuf::insufficentBytesAvailable ));
epicsThrows (( comBuf::insufficentBytesAvailable ));
void * operator new ( size_t size,
comBufMemoryManager & ) epics_throws (( std::bad_alloc ));
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *,
comBufMemoryManager & ) epics_throws (());
# endif
comBufMemoryManager & ) epicsThrows (( std::bad_alloc ));
epicsPlacementDeleteOperator (( void *, comBufMemoryManager & ))
private:
unsigned commitIndex;
unsigned nextWriteIndex;
unsigned nextReadIndex;
epicsUInt8 buf [ comBufSize ];
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 (());
unsigned unoccupiedElem ( unsigned elemSize, unsigned nElem ) epicsThrows (());
unsigned occupiedElem ( unsigned elemSize, unsigned nElem ) epicsThrows (());
void * operator new ( size_t size ) epicsThrows (( std::bad_alloc ));
void operator delete ( void * ) epicsThrows (());
};
inline void * comBuf::operator new ( size_t size,
comBufMemoryManager & mgr )
epics_throws (( std::bad_alloc ))
epicsThrows (( std::bad_alloc ))
{
return mgr.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
inline void comBuf::operator delete ( void * pCadaver,
comBufMemoryManager & mgr ) epics_throws (())
comBufMemoryManager & mgr ) epicsThrows (())
{
mgr.release ( pCadaver );
}
#endif
inline comBuf::comBuf () epics_throws (()) : commitIndex ( 0u ),
inline comBuf::comBuf () epicsThrows (()) : commitIndex ( 0u ),
nextWriteIndex ( 0u ), nextReadIndex ( 0u )
{
}
inline void comBuf::clear () epics_throws (())
inline void comBuf::clear () epicsThrows (())
{
this->commitIndex = 0u;
this->nextWriteIndex = 0u;
this->nextReadIndex = 0u;
}
inline unsigned comBuf::unoccupiedBytes () const epics_throws (())
inline unsigned comBuf::unoccupiedBytes () const epicsThrows (())
{
return sizeof ( this->buf ) - this->nextWriteIndex;
}
inline unsigned comBuf::occupiedBytes () const epics_throws (())
inline unsigned comBuf::occupiedBytes () const epicsThrows (())
{
return this->commitIndex - this->nextReadIndex;
}
inline unsigned comBuf::uncommittedBytes () const epics_throws (())
inline unsigned comBuf::uncommittedBytes () const epicsThrows (())
{
return this->nextWriteIndex - this->commitIndex;
}
inline unsigned comBuf::push ( comBuf & bufIn ) epics_throws (())
inline unsigned comBuf::push ( comBuf & bufIn ) epicsThrows (())
{
unsigned nBytes = this->copyInBytes (
& bufIn.buf[ bufIn.nextReadIndex ],
@@ -173,12 +170,12 @@ inline unsigned comBuf::push ( comBuf & bufIn ) epics_throws (())
return nBytes;
}
inline unsigned comBuf::capacityBytes () epics_throws (())
inline unsigned comBuf::capacityBytes () epicsThrows (())
{
return comBufSize;
}
inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) epics_throws (())
inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) epicsThrows (())
{
unsigned nNewBytes = wire.recvBytes (
& this->buf[this->nextWriteIndex],
@@ -187,7 +184,7 @@ inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) epics_throws (()
return nNewBytes;
}
inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) epics_throws (())
inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) epicsThrows (())
{
unsigned avail = this->unoccupiedBytes ();
if ( elemSize * nElem > avail ) {
@@ -196,7 +193,7 @@ inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) epi
return nElem;
}
inline bool comBuf::push ( const epicsInt8 & value ) epics_throws (())
inline bool comBuf::push ( const epicsInt8 & value ) epicsThrows (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -206,7 +203,7 @@ inline bool comBuf::push ( const epicsInt8 & value ) epics_throws (())
return true;
}
inline bool comBuf::push ( const epicsUInt8 & value ) epics_throws (())
inline bool comBuf::push ( const epicsUInt8 & value ) epicsThrows (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -215,7 +212,7 @@ inline bool comBuf::push ( const epicsUInt8 & value ) epics_throws (())
return true;
}
inline bool comBuf::push ( const epicsInt16 & value ) epics_throws (())
inline bool comBuf::push ( const epicsInt16 & value ) epicsThrows (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -227,7 +224,7 @@ inline bool comBuf::push ( const epicsInt16 & value ) epics_throws (())
return true;
}
inline bool comBuf::push ( const epicsUInt16 & value ) epics_throws (())
inline bool comBuf::push ( const epicsUInt16 & value ) epicsThrows (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -239,7 +236,7 @@ inline bool comBuf::push ( const epicsUInt16 & value ) epics_throws (())
return true;
}
inline bool comBuf::push ( const epicsInt32 & value ) epics_throws (())
inline bool comBuf::push ( const epicsInt32 & value ) epicsThrows (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -255,7 +252,7 @@ inline bool comBuf::push ( const epicsInt32 & value ) epics_throws (())
return true;
}
inline bool comBuf::push ( const epicsUInt32 & value ) epics_throws (())
inline bool comBuf::push ( const epicsUInt32 & value ) epicsThrows (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -271,7 +268,7 @@ inline bool comBuf::push ( const epicsUInt32 & value ) epics_throws (())
return true;
}
inline bool comBuf::push ( const epicsFloat32 & value ) epics_throws (())
inline bool comBuf::push ( const epicsFloat32 & value ) epicsThrows (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -282,7 +279,7 @@ inline bool comBuf::push ( const epicsFloat32 & value ) epics_throws (())
return true;
}
inline bool comBuf::push ( const epicsFloat64 & value ) epics_throws (())
inline bool comBuf::push ( const epicsFloat64 & value ) epicsThrows (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -293,7 +290,7 @@ inline bool comBuf::push ( const epicsFloat64 & value ) epics_throws (())
return true;
}
inline bool comBuf::push ( const epicsOldString & value ) epics_throws (())
inline bool comBuf::push ( const epicsOldString & value ) epicsThrows (())
{
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
return false;
@@ -303,17 +300,17 @@ inline bool comBuf::push ( const epicsOldString & value ) epics_throws (())
return true;
}
inline unsigned comBuf::push ( const epicsInt8 *pValue, unsigned nElem ) epics_throws (())
inline unsigned comBuf::push ( const epicsInt8 *pValue, unsigned nElem ) epicsThrows (())
{
return copyInBytes ( pValue, nElem );
}
inline unsigned comBuf::push ( const epicsUInt8 *pValue, unsigned nElem ) epics_throws (())
inline unsigned comBuf::push ( const epicsUInt8 *pValue, unsigned nElem ) epicsThrows (())
{
return copyInBytes ( pValue, nElem );
}
inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) epics_throws (())
inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) epicsThrows (())
{
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
unsigned size = nElem * sizeof ( *pValue );
@@ -322,7 +319,7 @@ inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) ep
return nElem;
}
inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) epics_throws (())
inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) epicsThrows (())
{
unsigned avail = this->occupiedBytes ();
if ( elemSize * nElem > avail ) {
@@ -331,17 +328,17 @@ inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) epics
return nElem;
}
inline void comBuf::commitIncomming () epics_throws (())
inline void comBuf::commitIncomming () epicsThrows (())
{
this->commitIndex = this->nextWriteIndex;
}
inline void comBuf::clearUncommittedIncomming () epics_throws (())
inline void comBuf::clearUncommittedIncomming () epicsThrows (())
{
this->nextWriteIndex = this->commitIndex;
}
inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) epics_throws (())
inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) epicsThrows (())
{
if ( nBytes <= this->unoccupiedBytes () ) {
memcpy ( & this->buf[this->nextWriteIndex], pBuf, nBytes );
@@ -351,7 +348,7 @@ inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) epics_t
return false;
}
inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) epics_throws (())
inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) epicsThrows (())
{
if ( nBytes > 0u ) {
unsigned available = this->unoccupiedBytes ();
@@ -364,7 +361,7 @@ inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) epics_
return nBytes;
}
inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) epics_throws (())
inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) epicsThrows (())
{
if ( nBytes <= this->occupiedBytes () ) {
memcpy ( pBuf, &this->buf[this->nextReadIndex], nBytes);
@@ -374,7 +371,7 @@ inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) epics_throw
return false;
}
inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) epics_throws (())
inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) epicsThrows (())
{
unsigned occupied = this->occupiedBytes ();
if ( nBytes > occupied ) {
@@ -385,7 +382,7 @@ inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) epics_throw
return nBytes;
}
inline unsigned comBuf::removeBytes ( unsigned nBytes ) epics_throws (())
inline unsigned comBuf::removeBytes ( unsigned nBytes ) epicsThrows (())
{
unsigned occupied = this->occupiedBytes ();
if ( nBytes > occupied ) {
@@ -396,7 +393,7 @@ inline unsigned comBuf::removeBytes ( unsigned nBytes ) epics_throws (())
}
inline epicsUInt8 comBuf::popUInt8 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
if ( this->occupiedBytes () < 1u ) {
comBuf::throwInsufficentBytesException ();
@@ -405,7 +402,7 @@ inline epicsUInt8 comBuf::popUInt8 ()
}
inline epicsUInt16 comBuf::popUInt16 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
if ( this->occupiedBytes () < 2u ) {
comBuf::throwInsufficentBytesException ();
@@ -416,7 +413,7 @@ inline epicsUInt16 comBuf::popUInt16 ()
}
inline epicsUInt32 comBuf::popUInt32 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
if ( this->occupiedBytes () < 4u ) {
comBuf::throwInsufficentBytesException ();
+10 -10
View File
@@ -27,17 +27,17 @@
#include "iocinf.h"
#include "virtualCircuit.h"
comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ) epics_throws (()) :
comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ) epicsThrows (()) :
comBufMemMgr ( comBufMemoryManagerIn ), nBytesPending ( 0u )
{
}
comQueRecv::~comQueRecv () epics_throws (())
comQueRecv::~comQueRecv () epicsThrows (())
{
this->clear ();
}
void comQueRecv::clear () epics_throws (())
void comQueRecv::clear () epicsThrows (())
{
comBuf *pBuf;
while ( ( pBuf = this->bufs.get () ) ) {
@@ -47,7 +47,7 @@ void comQueRecv::clear () epics_throws (())
this->nBytesPending = 0u;
}
unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epics_throws (())
unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epicsThrows (())
{
unsigned totalBytes = 0u;
do {
@@ -68,7 +68,7 @@ unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epics_thr
return totalBytes;
}
unsigned comQueRecv::removeBytes ( unsigned nBytes ) epics_throws (())
unsigned comQueRecv::removeBytes ( unsigned nBytes ) epicsThrows (())
{
unsigned totalBytes = 0u;
unsigned bytesLeft = nBytes;
@@ -95,7 +95,7 @@ unsigned comQueRecv::removeBytes ( unsigned nBytes ) epics_throws (())
}
void comQueRecv::popString ( epicsOldString *pStr )
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( 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 )
epics_throws (())
epicsThrows (())
{
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 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( 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 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
epicsUInt32 tmp;
if ( this->occupiedBytes() >= sizeof (tmp) ) {
@@ -169,7 +169,7 @@ epicsUInt32 comQueRecv::multiBufferPopUInt32 ()
return tmp;
}
void comQueRecv::removeAndDestroyBuf ( comBuf & buf ) epics_throws (())
void comQueRecv::removeAndDestroyBuf ( comBuf & buf ) epicsThrows (())
{
this->bufs.remove ( buf );
buf.~comBuf ();
+30 -30
View File
@@ -31,54 +31,54 @@
class comQueRecv {
public:
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 ));
comQueRecv ( comBufMemoryManager & ) epicsThrows (());
~comQueRecv () epicsThrows (());
unsigned occupiedBytes () const epicsThrows (());
unsigned copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epicsThrows (());
unsigned removeBytes ( unsigned nBytes ) epicsThrows (());
void pushLastComBufReceived ( comBuf & ) epicsThrows (());
void clear () epicsThrows (());
epicsInt8 popInt8 () epicsThrows (( comBuf::insufficentBytesAvailable ));
epicsUInt8 popUInt8 () epicsThrows (( comBuf::insufficentBytesAvailable ));
epicsInt16 popInt16 () epicsThrows (( comBuf::insufficentBytesAvailable ));
epicsUInt16 popUInt16 () epicsThrows (( comBuf::insufficentBytesAvailable ));
epicsInt32 popInt32 () epicsThrows (( comBuf::insufficentBytesAvailable ));
epicsUInt32 popUInt32 () epicsThrows (( comBuf::insufficentBytesAvailable ));
epicsFloat32 popFloat32 () epicsThrows (( comBuf::insufficentBytesAvailable ));
epicsFloat64 popFloat64 () epicsThrows (( comBuf::insufficentBytesAvailable ));
void popString ( epicsOldString * ) epicsThrows (( comBuf::insufficentBytesAvailable ));
private:
tsDLList < comBuf > bufs;
comBufMemoryManager & comBufMemMgr;
unsigned nBytesPending;
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 (());
epicsUInt16 multiBufferPopUInt16 () epicsThrows (( comBuf::insufficentBytesAvailable ));
epicsUInt32 multiBufferPopUInt32 () epicsThrows (( comBuf::insufficentBytesAvailable ));
void removeAndDestroyBuf ( comBuf & ) epicsThrows (());
comQueRecv ( const comQueRecv & ) epicsThrows (());
comQueRecv & operator = ( const comQueRecv & ) epicsThrows (());
};
inline unsigned comQueRecv::occupiedBytes () const
epics_throws (())
epicsThrows (())
{
return this->nBytesPending;
}
inline epicsInt8 comQueRecv::popInt8 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
return static_cast < epicsInt8 > ( this->popUInt8() );
}
inline epicsInt16 comQueRecv::popInt16 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
return static_cast < epicsInt16 > ( ( this->popInt8() << 8u )
| ( this->popInt8() << 0u ) );
}
inline epicsInt32 comQueRecv::popInt32 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
epicsInt32 tmp ;
tmp = this->popInt8() << 24u;
@@ -89,7 +89,7 @@ inline epicsInt32 comQueRecv::popInt32 ()
}
inline epicsFloat32 comQueRecv::popFloat32 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
epicsFloat32 tmp;
epicsUInt8 wire[ sizeof ( tmp ) ];
@@ -102,7 +102,7 @@ inline epicsFloat32 comQueRecv::popFloat32 ()
}
inline epicsFloat64 comQueRecv::popFloat64 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
epicsFloat64 tmp;
epicsUInt8 wire[ sizeof ( tmp ) ];
@@ -115,7 +115,7 @@ inline epicsFloat64 comQueRecv::popFloat64 ()
}
inline epicsUInt8 comQueRecv::popUInt8 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
comBuf * pComBuf = this->bufs.first ();
if ( ! pComBuf ) {
@@ -131,7 +131,7 @@ inline epicsUInt8 comQueRecv::popUInt8 ()
// optimization here complicates this function somewhat
inline epicsUInt16 comQueRecv::popUInt16 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
comBuf *pComBuf = this->bufs.first ();
if ( ! pComBuf ) {
@@ -157,7 +157,7 @@ inline epicsUInt16 comQueRecv::popUInt16 ()
// optimization here complicates this function somewhat
inline epicsUInt32 comQueRecv::popUInt32 ()
epics_throws (( comBuf::insufficentBytesAvailable ))
epicsThrows (( comBuf::insufficentBytesAvailable ))
{
comBuf *pComBuf = this->bufs.first ();
if ( ! pComBuf ) {
+16 -25
View File
@@ -81,35 +81,31 @@ const char cacNillBytes [] =
};
comQueSend::comQueSend ( wireSendAdapter & wireIn,
comBufMemoryManager & comBufMemMgrIn ) epics_throws (()) :
comBufMemoryManager & comBufMemMgrIn ) epicsThrows (()) :
comBufMemMgr ( comBufMemMgrIn ), wire ( wireIn ),
nBytesPending ( 0u )
{
}
comQueSend::~comQueSend () epics_throws (())
comQueSend::~comQueSend () epicsThrows (())
{
this->clear ();
}
void comQueSend::clear () epics_throws (())
void comQueSend::clear () epicsThrows (())
{
comBuf *pBuf;
while ( ( pBuf = this->bufs.get () ) ) {
this->nBytesPending -= pBuf->occupiedBytes ();
pBuf->~comBuf ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
comBuf::operator delete ( pBuf, this->comBufMemMgr );
# else
this->comBufMemMgr.release ( pBuf );
# endif
this->comBufMemMgr.release ( pBuf );
}
this->pFirstUncommited = tsDLIter < comBuf > ();
assert ( this->nBytesPending == 0 );
}
void comQueSend::clearUncommitted () epics_throws (())
void comQueSend::clearUncommitted () epicsThrows (())
{
while ( this->pFirstUncommited.valid() ) {
tsDLIter < comBuf > next = this->pFirstUncommited;
@@ -118,43 +114,38 @@ void comQueSend::clearUncommitted () epics_throws (())
if ( this->pFirstUncommited->occupiedBytes() == 0u ) {
this->bufs.remove ( *this->pFirstUncommited );
this->pFirstUncommited->~comBuf ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
comBuf::operator delete
( this->pFirstUncommited.pointer(), this->comBufMemMgr );
# else
this->comBufMemMgr.release ( this->pFirstUncommited.pointer() );
# endif
this->comBufMemMgr.release ( this->pFirstUncommited.pointer() );
}
this->pFirstUncommited = next;
}
}
void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem ) epics_throws (())
void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem ) epicsThrows (())
{
this->push ( static_cast <const dbr_string_t *> ( pValue ), nElem );
}
void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem ) epics_throws (())
void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem ) epicsThrows (())
{
this->push ( static_cast <const dbr_short_t *> ( pValue ), nElem );
}
void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem ) epics_throws (())
void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem ) epicsThrows (())
{
this->push ( static_cast <const dbr_float_t *> ( pValue ), nElem );
}
void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem ) epics_throws (())
void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem ) epicsThrows (())
{
this->push ( static_cast <const dbr_char_t *> ( pValue ), nElem );
}
void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem ) epics_throws (())
void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem ) epicsThrows (())
{
this->push ( static_cast <const dbr_long_t *> ( pValue ), nElem );
}
void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem ) epics_throws (())
void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem ) epicsThrows (())
{
this->push ( static_cast <const dbr_double_t *> ( pValue ), nElem );
}
@@ -201,7 +192,7 @@ const comQueSend::copyFunc_t comQueSend::dbrCopyVector [39] = {
0 // DBR_CLASS_NAME
};
comBuf * comQueSend::popNextComBufToSend () epics_throws (())
comBuf * comQueSend::popNextComBufToSend () epicsThrows (())
{
comBuf *pBuf = this->bufs.get ();
if ( pBuf ) {
@@ -225,7 +216,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 )
epics_throws (( cacChannel::outOfBounds ))
epicsThrows (( cacChannel::outOfBounds ))
{
this->beginMsg ();
if ( payloadSize < 0xffff && nElem < 0xffff ) {
@@ -254,7 +245,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 ) epics_throws (( cacChannel::outOfBounds, cacChannel::badType ))
bool v49Ok ) epicsThrows (( cacChannel::outOfBounds, cacChannel::badType ))
{
if ( ! this->dbr_type_ok ( dataType ) ) {
throw cacChannel::badType();
@@ -299,7 +290,7 @@ void comQueSend::insertRequestWithPayLoad (
this->commitMsg ();
}
void comQueSend::commitMsg () epics_throws (())
void comQueSend::commitMsg () epicsThrows (())
{
while ( this->pFirstUncommited.valid() ) {
this->nBytesPending += this->pFirstUncommited->uncommittedBytes ();
+40 -40
View File
@@ -39,56 +39,56 @@
//
class comQueSend {
public:
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 (());
comQueSend ( wireSendAdapter &, comBufMemoryManager & ) epicsThrows (());
~comQueSend () epicsThrows (());
void clear () epicsThrows (());
void beginMsg () epicsThrows (());
void commitMsg () epicsThrows (());
unsigned occupiedBytes () const epicsThrows (());
bool flushEarlyThreshold ( unsigned nBytesThisMsg ) const epicsThrows (());
bool flushBlockThreshold ( unsigned nBytesThisMsg ) const epicsThrows (());
bool dbr_type_ok ( unsigned type ) epicsThrows (());
void pushUInt16 ( const ca_uint16_t value ) epicsThrows (());
void pushUInt32 ( const ca_uint32_t value ) epicsThrows (());
void pushFloat32 ( const ca_float32_t value ) epicsThrows (());
void pushString ( const char *pVal, unsigned nChar ) epicsThrows (());
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 )
epics_throws (( cacChannel::outOfBounds ));
epicsThrows (( 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 )
epics_throws (( cacChannel::outOfBounds, cacChannel::badType ));
void push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) epics_throws (());
comBuf * popNextComBufToSend () epics_throws (());
epicsThrows (( cacChannel::outOfBounds, cacChannel::badType ));
void push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) epicsThrows (());
comBuf * popNextComBufToSend () epicsThrows (());
private:
comBufMemoryManager & comBufMemMgr;
tsDLList < comBuf > bufs;
tsDLIter < comBuf > pFirstUncommited;
wireSendAdapter & wire;
unsigned nBytesPending;
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 (());
void copy_dbr_string ( const void *pValue, unsigned nElem ) epicsThrows (());
void copy_dbr_short ( const void *pValue, unsigned nElem ) epicsThrows (());
void copy_dbr_float ( const void *pValue, unsigned nElem ) epicsThrows (());
void copy_dbr_char ( const void *pValue, unsigned nElem ) epicsThrows (());
void copy_dbr_long ( const void *pValue, unsigned nElem ) epicsThrows (());
void copy_dbr_double ( const void *pValue, unsigned nElem ) epicsThrows (());
void pushComBuf ( comBuf & ) epicsThrows (());
typedef void ( comQueSend::*copyFunc_t ) (
const void *pValue, unsigned nElem );
static const copyFunc_t dbrCopyVector [39];
void clearUncommitted () epics_throws (());
void clearUncommitted () epicsThrows (());
//
// 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 ) epics_throws (())
inline void push ( const T *pVal, const unsigned nElem ) epicsThrows (())
{
comBuf * pLastBuf = this->bufs.last ();
unsigned nCopied;
@@ -112,7 +112,7 @@ private:
// class member template function definition
//
template < class T >
inline void push ( const T & val ) epics_throws (())
inline void push ( const T & val ) epicsThrows (())
{
comBuf * pComBuf = this->bufs.last ();
if ( pComBuf && pComBuf->push ( val ) ) {
@@ -123,13 +123,13 @@ private:
this->pushComBuf ( *pComBuf );
}
comQueSend ( const comQueSend & ) epics_throws (());
comQueSend & operator = ( const comQueSend & ) epics_throws (());
comQueSend ( const comQueSend & ) epicsThrows (());
comQueSend & operator = ( const comQueSend & ) epicsThrows (());
};
extern const char cacNillBytes[];
inline bool comQueSend::dbr_type_ok ( unsigned type ) epics_throws (())
inline bool comQueSend::dbr_type_ok ( unsigned type ) epicsThrows (())
{
if ( type >= ( sizeof ( this->dbrCopyVector ) / sizeof ( this->dbrCopyVector[0] ) ) ) {
return false;
@@ -140,34 +140,34 @@ inline bool comQueSend::dbr_type_ok ( unsigned type ) epics_throws (())
return true;
}
inline void comQueSend::pushUInt16 ( const ca_uint16_t value ) epics_throws (())
inline void comQueSend::pushUInt16 ( const ca_uint16_t value ) epicsThrows (())
{
this->push ( value );
}
inline void comQueSend::pushUInt32 ( const ca_uint32_t value ) epics_throws (())
inline void comQueSend::pushUInt32 ( const ca_uint32_t value ) epicsThrows (())
{
this->push ( value );
}
inline void comQueSend::pushFloat32 ( const ca_float32_t value ) epics_throws (())
inline void comQueSend::pushFloat32 ( const ca_float32_t value ) epicsThrows (())
{
this->push ( value );
}
inline void comQueSend::pushString ( const char *pVal, unsigned nChar ) epics_throws (())
inline void comQueSend::pushString ( const char *pVal, unsigned nChar ) epicsThrows (())
{
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 ) epics_throws (())
inline void comQueSend::push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) epicsThrows (())
{
( this->*dbrCopyVector [type] ) ( pVal, nElem );
}
inline void comQueSend::pushComBuf ( comBuf & cb ) epics_throws (())
inline void comQueSend::pushComBuf ( comBuf & cb ) epicsThrows (())
{
this->bufs.add ( cb );
if ( ! this->pFirstUncommited.valid() ) {
@@ -175,22 +175,22 @@ inline void comQueSend::pushComBuf ( comBuf & cb ) epics_throws (())
}
}
inline unsigned comQueSend::occupiedBytes () const epics_throws (())
inline unsigned comQueSend::occupiedBytes () const epicsThrows (())
{
return this->nBytesPending;
}
inline bool comQueSend::flushBlockThreshold ( unsigned nBytesThisMsg ) const epics_throws (())
inline bool comQueSend::flushBlockThreshold ( unsigned nBytesThisMsg ) const epicsThrows (())
{
return ( this->nBytesPending + nBytesThisMsg > 16 * comBuf::capacityBytes () );
}
inline bool comQueSend::flushEarlyThreshold ( unsigned nBytesThisMsg ) const epics_throws (())
inline bool comQueSend::flushEarlyThreshold ( unsigned nBytesThisMsg ) const epicsThrows (())
{
return ( this->nBytesPending + nBytesThisMsg > 4 * comBuf::capacityBytes () );
}
inline void comQueSend::beginMsg () epics_throws (())
inline void comQueSend::beginMsg () epicsThrows (())
{
if ( this->pFirstUncommited.valid() ) {
this->clearUncommitted ();
+1 -4
View File
@@ -43,11 +43,8 @@ class msgForMultiplyDefinedPV : public ipAddrToAsciiAsynchronous {
public:
msgForMultiplyDefinedPV ( callbackForMultiplyDefinedPV &,
const char * pChannelName, const char * pAcc, const osiSockAddr & rej );
//msgForMultiplyDefinedPV ( const osiSockAddr &addr, ipAddrToAsciiEngine &engine );
void * operator new ( size_t size, tsFreeList < class msgForMultiplyDefinedPV, 16 > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *, tsFreeList < class msgForMultiplyDefinedPV, 16 > & );
# endif
epicsPlacementDeleteOperator (( void *, tsFreeList < class msgForMultiplyDefinedPV, 16 > & ))
private:
char acc[64];
char channel[64];
+1 -3
View File
@@ -98,9 +98,7 @@ public:
int status, const char *pContext, unsigned type, arrayElementCount count );
cacChannel::priLev getPriority () const;
void * operator new ( size_t size, tsFreeList < class nciu, 1024 > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *, tsFreeList < class nciu, 1024 > & );
# endif
epicsPlacementDeleteOperator (( void *, tsFreeList < class nciu, 1024 > & ))
private:
caAccessRights accessRightState;
cac & cacCtx;
+6 -12
View File
@@ -86,10 +86,8 @@ private:
void operator delete ( void * );
void * operator new ( size_t,
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & );
# if defined ( CXX_PLACEMENT_DELETE )
void operator delete ( void *,
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & ))
void destroy ( class cacRecycle & );
void completion ();
void exception ( int status,
@@ -119,10 +117,8 @@ private:
void operator delete ( void * );
void * operator new ( size_t,
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & );
# if defined ( CXX_PLACEMENT_DELETE )
void operator delete ( void *,
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & ))
void destroy ( class cacRecycle & );
void completion ();
void exception ( int status, const char *pContext );
@@ -151,10 +147,8 @@ private:
void operator delete ( void * );
void * operator new ( size_t,
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & );
# if defined ( CXX_PLACEMENT_DELETE )
void operator delete ( void *,
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & ))
class netSubscription * isSubscription ();
void destroy ( class cacRecycle & );
void completion ();
+10 -20
View File
@@ -87,10 +87,8 @@ public:
ca_client_context & getClientCtx ();
void * operator new ( size_t size,
tsFreeList < struct oldChannelNotify, 1024 > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void * ,
tsFreeList < struct oldChannelNotify, 1024 > & );
# endif
epicsPlacementDeleteOperator (( void * ,
tsFreeList < struct oldChannelNotify, 1024 > & ))
private:
ca_client_context & cacCtx;
cacChannel & io;
@@ -124,10 +122,8 @@ public:
void cancel ();
void * operator new ( size_t size,
tsFreeList < class getCopy, 1024 > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *,
tsFreeList < class getCopy, 1024 > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < class getCopy, 1024 > & ))
private:
arrayElementCount count;
ca_client_context &cacCtx;
@@ -153,10 +149,8 @@ public:
void destroy ();
void * operator new ( size_t size,
tsFreeList < class getCallback, 1024 > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *,
tsFreeList < class getCallback, 1024 > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < class getCallback, 1024 > & ))
private:
oldChannelNotify & chan;
caEventCallBackFunc * pFunc;
@@ -178,10 +172,8 @@ public:
~putCallback ();
void * operator new ( size_t size,
tsFreeList < class putCallback, 1024 > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *,
tsFreeList < class putCallback, 1024 > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < class putCallback, 1024 > & ))
private:
oldChannelNotify & chan;
caEventCallBackFunc * pFunc;
@@ -204,10 +196,8 @@ public:
oldChannelNotify & channel () const;
void * operator new ( size_t size,
tsFreeList < struct oldSubscription, 1024 > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *,
tsFreeList < struct oldSubscription, 1024 > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < struct oldSubscription, 1024 > & ))
void ioCancel ();
private:
oldChannelNotify & chan;
+2 -4
View File
@@ -59,10 +59,8 @@ public:
bool identicalPort ( const osiSockAddr &from );
void * operator new ( size_t size,
tsFreeList < repeaterClient, 0x20 > & );
#ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *,
tsFreeList < repeaterClient, 0x20 > & );
#endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < repeaterClient, 0x20 > & ))
private:
osiSockAddr from;
SOCKET sock;
+5 -11
View File
@@ -90,10 +90,8 @@ private:
void operator delete ( void * );
void * operator new ( size_t,
tsFreeList < class syncGroupReadNotify, 128, epicsMutexNOOP > & );
# if defined ( CXX_PLACEMENT_DELETE )
void operator delete ( void *,
tsFreeList < class syncGroupReadNotify, 128, epicsMutexNOOP > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < class syncGroupReadNotify, 128, epicsMutexNOOP > & ))
void completion (
unsigned type, arrayElementCount count, const void *pData );
void exception (
@@ -120,10 +118,8 @@ private:
void operator delete ( void * );
void * operator new ( size_t,
tsFreeList < class syncGroupWriteNotify, 128, epicsMutexNOOP > & );
# if defined ( CXX_PLACEMENT_DELETE )
void operator delete ( void *,
tsFreeList < class syncGroupWriteNotify, 128, epicsMutexNOOP > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < class syncGroupWriteNotify, 128, epicsMutexNOOP > & ))
void completion ();
void exception ( int status, const char *pContext,
unsigned type, arrayElementCount count );
@@ -163,9 +159,7 @@ public:
const char *pFileName, unsigned lineNo, oldChannelNotify &chan,
unsigned type, arrayElementCount count, unsigned op );
void * operator new ( size_t size, tsFreeList < struct CASG, 128 > & );
# if defined ( CXX_PLACEMENT_DELETE )
void operator delete ( void *, tsFreeList < struct CASG, 128 > & );
# endif
epicsPlacementDeleteOperator (( void *, tsFreeList < struct CASG, 128 > & ))
private:
tsDLList < syncGroupNotify > ioPendingList;
tsDLList < syncGroupNotify > ioCompletedList;
-4
View File
@@ -65,11 +65,7 @@ extern "C" int epicsShareAPI ca_sg_delete ( const CA_SYNC_GID gid )
}
pcasg->~CASG ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
CASG::operator delete ( pcasg, pcac->casgFreeList );
# else
pcac->casgFreeList.release ( pcasg );
# endif
return ECA_NORMAL;
}
+7 -19
View File
@@ -139,7 +139,7 @@ void tcpSendThread::run ()
}
unsigned tcpiiu::sendBytes ( const void *pBuf,
unsigned nBytesInBuf ) epics_throws (())
unsigned nBytesInBuf ) epicsThrows (())
{
int status;
unsigned nBytes = 0u;
@@ -202,7 +202,7 @@ unsigned tcpiiu::sendBytes ( const void *pBuf,
return nBytes;
}
unsigned tcpiiu::recvBytes ( void * pBuf, unsigned nBytesInBuf ) epics_throws (())
unsigned tcpiiu::recvBytes ( void * pBuf, unsigned nBytesInBuf ) epicsThrows (())
{
if ( this->state != iiucs_connected &&
this->state != iiucs_clean_shutdown ) {
@@ -382,8 +382,8 @@ void tcpRecvThread::run ()
pComBuf = 0;
// execute receive labor
bool noProtocolViolation = this->iiu.processIncoming ( guard );
if ( ! noProtocolViolation ) {
bool protocolOK = this->iiu.processIncoming ( guard );
if ( ! protocolOK ) {
this->iiu.cacRef.initiateAbortShutdown ( this->iiu );
break;
}
@@ -408,11 +408,7 @@ void tcpRecvThread::run ()
if ( pComBuf ) {
pComBuf->~comBuf ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
comBuf::operator delete ( pComBuf, this->iiu.comBufMemMgr );
# else
this->iiu.comBufMemMgr.release ( pComBuf );
# endif
this->iiu.comBufMemMgr.release ( pComBuf );
}
}
catch ( ... ) {
@@ -1206,21 +1202,13 @@ bool tcpiiu::flush ()
success = pBuf->flushToWire ( *this );
pBuf->~comBuf ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
comBuf::operator delete ( pBuf, this->comBufMemMgr );
# else
this->comBufMemMgr.release ( pBuf );
# endif
this->comBufMemMgr.release ( pBuf );
if ( ! success ) {
epicsGuard < cacMutex > autoMutex ( this->cacRef.mutexRef() );
while ( ( pBuf = this->sendQue.popNextComBufToSend () ) ) {
pBuf->~comBuf ();
# if defined ( CXX_PLACEMENT_DELETE ) && 0
comBuf::operator delete ( pBuf, this->comBufMemMgr );
# else
this->comBufMemMgr.release ( pBuf );
# endif
this->comBufMemMgr.release ( pBuf );
}
break;
}
+2 -2
View File
@@ -170,8 +170,8 @@ private:
bool recvProcessPostponedFlush;
bool processIncoming ( epicsGuard < callbackMutex > & );
unsigned sendBytes ( const void *pBuf, unsigned nBytesInBuf ) epics_throws (());
unsigned recvBytes ( void *pBuf, unsigned nBytesInBuf ) epics_throws (());
unsigned sendBytes ( const void *pBuf, unsigned nBytesInBuf ) epicsThrows (());
unsigned recvBytes ( void *pBuf, unsigned nBytesInBuf ) epicsThrows (());
void connect ();
const char * pHostName () const;
+2 -4
View File
@@ -46,10 +46,8 @@ public:
resTableIndex hash () const;
void * operator new ( size_t size,
tsFreeList < class ipIgnoreEntry, 128 > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *,
tsFreeList < class ipIgnoreEntry, 128 > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < class ipIgnoreEntry, 128 > & ))
private:
unsigned ipAddr;
ipIgnoreEntry ( const ipIgnoreEntry & );
+1 -3
View File
@@ -83,9 +83,7 @@ public:
void channelDeleteException ();
void show ( unsigned level ) const;
void * operator new ( size_t size, tsFreeList < dbSubscriptionIO > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *, tsFreeList < dbSubscriptionIO > & );
# endif
epicsPlacementDeleteOperator (( void *, tsFreeList < dbSubscriptionIO > & ))
private:
cacStateNotify & notify;
dbChannelIO & chan;
+1 -1
View File
@@ -135,7 +135,7 @@ void * dbChannelIO::operator new ( size_t size,
return freeList.allocate ( size );
}
# ifdef CXX_PLACEMENT_DELETE
#ifdef CXX_PLACEMENT_DELETE
void dbChannelIO::operator delete ( void *pCadaver,
tsFreeList < dbChannelIO > & freeList )
{
+1 -3
View File
@@ -54,9 +54,7 @@ public:
void show ( unsigned level ) const;
const char *pName () const;
void * operator new ( size_t size, tsFreeList < dbChannelIO > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *, tsFreeList < dbChannelIO > & );
# endif
epicsPlacementDeleteOperator (( void *, tsFreeList < dbChannelIO > & ))
private:
dbServiceIO & serviceIO;
dbAddr addr;
+2 -2
View File
@@ -188,13 +188,13 @@ void * dbPutNotifyBlocker::operator new ( size_t size,
return freeList.allocate ( size );
}
# ifdef CXX_PLACEMENT_DELETE
#ifdef CXX_PLACEMENT_DELETE
void dbPutNotifyBlocker::operator delete ( void *pCadaver,
tsFreeList < dbPutNotifyBlocker > & freeList )
{
freeList.release ( pCadaver );
}
# endif
#endif
void dbPutNotifyBlocker::operator delete ( void * )
{
+2 -4
View File
@@ -50,10 +50,8 @@ public:
void show ( unsigned level ) const;
void * operator new ( size_t size,
tsFreeList < dbPutNotifyBlocker > & );
# ifdef CXX_PLACEMENT_DELETE
void operator delete ( void *,
tsFreeList < dbPutNotifyBlocker > & );
# endif
epicsPlacementDeleteOperator (( void *,
tsFreeList < dbPutNotifyBlocker > & ))
private:
putNotify pn;
//
+1 -1
View File
@@ -61,7 +61,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 epicsThrows (());
#else
# define epicsPlacementDeleteOperator(X)
#endif