removed throw specifications
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
* between the 1st and 2nd beacons)
|
||||
*/
|
||||
bhe::bhe ( const epicsTime & initialTimeStamp,
|
||||
unsigned initialBeaconNumber, const inetAddrID & addr ) epicsThrows (()) :
|
||||
unsigned initialBeaconNumber, const inetAddrID & addr ) :
|
||||
inetAddrID ( addr ), timeStamp ( initialTimeStamp ), averagePeriod ( - DBL_MAX ),
|
||||
pIIU ( 0 ), lastBeaconNumber ( initialBeaconNumber )
|
||||
{
|
||||
@@ -218,7 +218,7 @@ void bhe::show ( unsigned /* level */ ) const
|
||||
static_cast <const void *> ( this ), this->averagePeriod );
|
||||
}
|
||||
|
||||
double bhe::period () const epicsThrows (())
|
||||
double bhe::period () const
|
||||
{
|
||||
return this->averagePeriod;
|
||||
}
|
||||
|
||||
@@ -56,20 +56,20 @@ public:
|
||||
class bhe : public tsSLNode < bhe >, public inetAddrID {
|
||||
public:
|
||||
epicsShareFunc bhe ( const epicsTime & initialTimeStamp,
|
||||
unsigned initialBeaconNumber, const inetAddrID & addr ) epicsThrows (());
|
||||
unsigned initialBeaconNumber, const inetAddrID & addr );
|
||||
epicsShareFunc ~bhe ();
|
||||
epicsShareFunc bool updatePeriod (
|
||||
const epicsTime & programBeginTime,
|
||||
const epicsTime & currentTime, ca_uint32_t beaconNumber,
|
||||
unsigned protocolRevision );
|
||||
epicsShareFunc double period () const epicsThrows (());
|
||||
epicsShareFunc double period () const;
|
||||
epicsShareFunc epicsTime updateTime () const;
|
||||
epicsShareFunc void show ( unsigned level) const;
|
||||
epicsShareFunc void registerIIU ( tcpiiu &, const epicsTime & );
|
||||
epicsShareFunc void unregisterIIU ( tcpiiu & );
|
||||
epicsShareFunc void * operator new ( size_t size, bheMemoryManager & );
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
epicsShareFunc void operator delete ( void *, bheMemoryManager & ) epicsThrows (());
|
||||
epicsShareFunc void operator delete ( void *, bheMemoryManager & );
|
||||
#endif
|
||||
private:
|
||||
epicsTime timeStamp;
|
||||
@@ -101,7 +101,7 @@ inline void * bhe::operator new ( size_t size,
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void bhe::operator delete ( void * pCadaver,
|
||||
bheMemoryManager & mgr ) epicsThrows(())
|
||||
bheMemoryManager & mgr )
|
||||
{
|
||||
mgr.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -1585,12 +1585,12 @@ void cac::initiateConnect ( nciu & chan )
|
||||
this->pudpiiu->installChannel ( chan );
|
||||
}
|
||||
|
||||
void *cacComBufMemoryManager::allocate ( size_t size ) epicsThrows (( std::bad_alloc ))
|
||||
void *cacComBufMemoryManager::allocate ( size_t size )
|
||||
{
|
||||
return this->freeList.allocate ( size );
|
||||
}
|
||||
|
||||
void cacComBufMemoryManager::release ( void * pCadaver ) epicsThrows (())
|
||||
void cacComBufMemoryManager::release ( void * pCadaver )
|
||||
{
|
||||
this->freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -95,8 +95,8 @@ private:
|
||||
class cacComBufMemoryManager : public comBufMemoryManager
|
||||
{
|
||||
public:
|
||||
void * allocate ( size_t ) epicsThrows (( std::bad_alloc ));
|
||||
void release ( void * ) epicsThrows (());
|
||||
void * allocate ( size_t );
|
||||
void release ( void * );
|
||||
private:
|
||||
tsFreeList < comBuf, 0x20 > freeList;
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "comBuf.h"
|
||||
#include "errlog.h"
|
||||
|
||||
bool comBuf::flushToWire ( wireSendAdapter & wire ) epicsThrows (())
|
||||
bool comBuf::flushToWire ( wireSendAdapter & wire )
|
||||
{
|
||||
unsigned occupied = this->occupiedBytes ();
|
||||
while ( occupied ) {
|
||||
@@ -44,7 +44,7 @@ bool comBuf::flushToWire ( wireSendAdapter & wire ) epicsThrows (())
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem ) epicsThrows (())
|
||||
unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem )
|
||||
{
|
||||
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 ) epicsThrows
|
||||
return nElem;
|
||||
}
|
||||
|
||||
unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem ) epicsThrows (())
|
||||
unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem )
|
||||
{
|
||||
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 ) epicsThrows
|
||||
return nElem;
|
||||
}
|
||||
|
||||
unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem ) epicsThrows (())
|
||||
unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem )
|
||||
{
|
||||
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 ) epicsThrows
|
||||
return nElem;
|
||||
}
|
||||
|
||||
unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem ) epicsThrows (())
|
||||
unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem )
|
||||
{
|
||||
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 ) epicsThrows
|
||||
return nElem;
|
||||
}
|
||||
|
||||
unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem ) epicsThrows (())
|
||||
unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem )
|
||||
{
|
||||
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 ) epicsThrow
|
||||
return nElem;
|
||||
}
|
||||
|
||||
unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) epicsThrows (())
|
||||
unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem )
|
||||
{
|
||||
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
|
||||
for ( unsigned i = 0u; i < nElem; i++ ) {
|
||||
@@ -125,12 +125,11 @@ unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) epicsThrow
|
||||
// throwing the exception from a function that isnt inline
|
||||
// shrinks the GNU compiled object code
|
||||
void comBuf::throwInsufficentBytesException ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
throw comBuf::insufficentBytesAvailable ();
|
||||
}
|
||||
|
||||
void comBuf::operator delete ( void * ) epicsThrows (())
|
||||
void comBuf::operator delete ( void * )
|
||||
{
|
||||
// Visual C++ .net appears to require operator delete if
|
||||
// placement operator delete is defined? I smell a ms rat
|
||||
|
||||
166
src/ca/comBuf.h
166
src/ca/comBuf.h
@@ -42,126 +42,119 @@ static const unsigned comBufSize = 0x4000;
|
||||
class comBufMemoryManager {
|
||||
public:
|
||||
virtual ~comBufMemoryManager ();
|
||||
virtual void * allocate ( size_t )
|
||||
epicsThrows (( std::bad_alloc )) = 0;
|
||||
virtual void release ( void * )
|
||||
epicsThrows (()) = 0;
|
||||
virtual void * allocate ( size_t ) = 0;
|
||||
virtual void release ( void * ) = 0;
|
||||
};
|
||||
|
||||
class wireSendAdapter { // X aCC 655
|
||||
public:
|
||||
virtual unsigned sendBytes ( const void *pBuf,
|
||||
unsigned nBytesInBuf ) epicsThrows (()) = 0;
|
||||
unsigned nBytesInBuf ) = 0;
|
||||
};
|
||||
|
||||
class wireRecvAdapter { // X aCC 655
|
||||
public:
|
||||
virtual unsigned recvBytes ( void *pBuf,
|
||||
unsigned nBytesInBuf ) epicsThrows (()) = 0;
|
||||
unsigned nBytesInBuf ) = 0;
|
||||
};
|
||||
|
||||
class comBuf : public tsDLNode < comBuf > {
|
||||
public:
|
||||
class insufficentBytesAvailable {};
|
||||
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 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ));
|
||||
epicsUInt16 popUInt16 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ));
|
||||
epicsUInt32 popUInt32 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ));
|
||||
static void throwInsufficentBytesException ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ));
|
||||
comBuf ();
|
||||
unsigned unoccupiedBytes () const;
|
||||
unsigned occupiedBytes () const;
|
||||
unsigned uncommittedBytes () const;
|
||||
static unsigned capacityBytes ();
|
||||
void clear ();
|
||||
unsigned copyInBytes ( const void *pBuf, unsigned nBytes );
|
||||
unsigned push ( comBuf & );
|
||||
bool push ( const epicsInt8 & value );
|
||||
bool push ( const epicsUInt8 & value );
|
||||
bool push ( const epicsInt16 & value );
|
||||
bool push ( const epicsUInt16 & value );
|
||||
bool push ( const epicsInt32 & value );
|
||||
bool push ( const epicsUInt32 & value );
|
||||
bool push ( const epicsFloat32 & value );
|
||||
bool push ( const epicsFloat64 & value );
|
||||
bool push ( const epicsOldString & value );
|
||||
unsigned push ( const epicsInt8 *pValue, unsigned nElem );
|
||||
unsigned push ( const epicsUInt8 *pValue, unsigned nElem );
|
||||
unsigned push ( const epicsInt16 *pValue, unsigned nElem );
|
||||
unsigned push ( const epicsUInt16 *pValue, unsigned nElem );
|
||||
unsigned push ( const epicsInt32 *pValue, unsigned nElem );
|
||||
unsigned push ( const epicsUInt32 *pValue, unsigned nElem );
|
||||
unsigned push ( const epicsFloat32 *pValue, unsigned nElem );
|
||||
unsigned push ( const epicsFloat64 *pValue, unsigned nElem );
|
||||
unsigned push ( const epicsOldString *pValue, unsigned nElem );
|
||||
void commitIncomming ();
|
||||
void clearUncommittedIncomming ();
|
||||
bool copyInAllBytes ( const void *pBuf, unsigned nBytes );
|
||||
unsigned copyOutBytes ( void *pBuf, unsigned nBytes );
|
||||
bool copyOutAllBytes ( void *pBuf, unsigned nBytes );
|
||||
unsigned removeBytes ( unsigned nBytes );
|
||||
bool flushToWire ( wireSendAdapter & );
|
||||
unsigned fillFromWire ( wireRecvAdapter & );
|
||||
epicsUInt8 popUInt8 ();
|
||||
epicsUInt16 popUInt16 ();
|
||||
epicsUInt32 popUInt32 ();
|
||||
static void throwInsufficentBytesException ();
|
||||
void * operator new ( size_t size,
|
||||
comBufMemoryManager & ) epicsThrows (( std::bad_alloc ));
|
||||
comBufMemoryManager & );
|
||||
epicsPlacementDeleteOperator (( void *, comBufMemoryManager & ))
|
||||
private:
|
||||
unsigned commitIndex;
|
||||
unsigned nextWriteIndex;
|
||||
unsigned nextReadIndex;
|
||||
epicsUInt8 buf [ comBufSize ];
|
||||
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 (());
|
||||
unsigned unoccupiedElem ( unsigned elemSize, unsigned nElem );
|
||||
unsigned occupiedElem ( unsigned elemSize, unsigned nElem );
|
||||
void * operator new ( size_t size );
|
||||
void operator delete ( void * );
|
||||
};
|
||||
|
||||
inline void * comBuf::operator new ( size_t size,
|
||||
comBufMemoryManager & mgr )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
comBufMemoryManager & mgr )
|
||||
{
|
||||
return mgr.allocate ( size );
|
||||
}
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void comBuf::operator delete ( void * pCadaver,
|
||||
comBufMemoryManager & mgr ) epicsThrows (())
|
||||
comBufMemoryManager & mgr )
|
||||
{
|
||||
mgr.release ( pCadaver );
|
||||
}
|
||||
#endif
|
||||
|
||||
inline comBuf::comBuf () epicsThrows (()) : commitIndex ( 0u ),
|
||||
inline comBuf::comBuf () : commitIndex ( 0u ),
|
||||
nextWriteIndex ( 0u ), nextReadIndex ( 0u )
|
||||
{
|
||||
}
|
||||
|
||||
inline void comBuf::clear () epicsThrows (())
|
||||
inline void comBuf::clear ()
|
||||
{
|
||||
this->commitIndex = 0u;
|
||||
this->nextWriteIndex = 0u;
|
||||
this->nextReadIndex = 0u;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::unoccupiedBytes () const epicsThrows (())
|
||||
inline unsigned comBuf::unoccupiedBytes () const
|
||||
{
|
||||
return sizeof ( this->buf ) - this->nextWriteIndex;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::occupiedBytes () const epicsThrows (())
|
||||
inline unsigned comBuf::occupiedBytes () const
|
||||
{
|
||||
return this->commitIndex - this->nextReadIndex;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::uncommittedBytes () const epicsThrows (())
|
||||
inline unsigned comBuf::uncommittedBytes () const
|
||||
{
|
||||
return this->nextWriteIndex - this->commitIndex;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::push ( comBuf & bufIn ) epicsThrows (())
|
||||
inline unsigned comBuf::push ( comBuf & bufIn )
|
||||
{
|
||||
unsigned nBytes = this->copyInBytes (
|
||||
& bufIn.buf[ bufIn.nextReadIndex ],
|
||||
@@ -170,12 +163,12 @@ inline unsigned comBuf::push ( comBuf & bufIn ) epicsThrows (())
|
||||
return nBytes;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::capacityBytes () epicsThrows (())
|
||||
inline unsigned comBuf::capacityBytes ()
|
||||
{
|
||||
return comBufSize;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) epicsThrows (())
|
||||
inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire )
|
||||
{
|
||||
unsigned nNewBytes = wire.recvBytes (
|
||||
& this->buf[this->nextWriteIndex],
|
||||
@@ -184,7 +177,7 @@ inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) epicsThrows (())
|
||||
return nNewBytes;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) epicsThrows (())
|
||||
inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem )
|
||||
{
|
||||
unsigned avail = this->unoccupiedBytes ();
|
||||
if ( elemSize * nElem > avail ) {
|
||||
@@ -193,7 +186,7 @@ inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) epi
|
||||
return nElem;
|
||||
}
|
||||
|
||||
inline bool comBuf::push ( const epicsInt8 & value ) epicsThrows (())
|
||||
inline bool comBuf::push ( const epicsInt8 & value )
|
||||
{
|
||||
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
|
||||
return false;
|
||||
@@ -203,7 +196,7 @@ inline bool comBuf::push ( const epicsInt8 & value ) epicsThrows (())
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool comBuf::push ( const epicsUInt8 & value ) epicsThrows (())
|
||||
inline bool comBuf::push ( const epicsUInt8 & value )
|
||||
{
|
||||
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
|
||||
return false;
|
||||
@@ -212,7 +205,7 @@ inline bool comBuf::push ( const epicsUInt8 & value ) epicsThrows (())
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool comBuf::push ( const epicsInt16 & value ) epicsThrows (())
|
||||
inline bool comBuf::push ( const epicsInt16 & value )
|
||||
{
|
||||
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
|
||||
return false;
|
||||
@@ -224,7 +217,7 @@ inline bool comBuf::push ( const epicsInt16 & value ) epicsThrows (())
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool comBuf::push ( const epicsUInt16 & value ) epicsThrows (())
|
||||
inline bool comBuf::push ( const epicsUInt16 & value )
|
||||
{
|
||||
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
|
||||
return false;
|
||||
@@ -236,7 +229,7 @@ inline bool comBuf::push ( const epicsUInt16 & value ) epicsThrows (())
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool comBuf::push ( const epicsInt32 & value ) epicsThrows (())
|
||||
inline bool comBuf::push ( const epicsInt32 & value )
|
||||
{
|
||||
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
|
||||
return false;
|
||||
@@ -252,7 +245,7 @@ inline bool comBuf::push ( const epicsInt32 & value ) epicsThrows (())
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool comBuf::push ( const epicsUInt32 & value ) epicsThrows (())
|
||||
inline bool comBuf::push ( const epicsUInt32 & value )
|
||||
{
|
||||
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
|
||||
return false;
|
||||
@@ -268,7 +261,7 @@ inline bool comBuf::push ( const epicsUInt32 & value ) epicsThrows (())
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool comBuf::push ( const epicsFloat32 & value ) epicsThrows (())
|
||||
inline bool comBuf::push ( const epicsFloat32 & value )
|
||||
{
|
||||
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
|
||||
return false;
|
||||
@@ -279,7 +272,7 @@ inline bool comBuf::push ( const epicsFloat32 & value ) epicsThrows (())
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool comBuf::push ( const epicsFloat64 & value ) epicsThrows (())
|
||||
inline bool comBuf::push ( const epicsFloat64 & value )
|
||||
{
|
||||
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
|
||||
return false;
|
||||
@@ -290,7 +283,7 @@ inline bool comBuf::push ( const epicsFloat64 & value ) epicsThrows (())
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool comBuf::push ( const epicsOldString & value ) epicsThrows (())
|
||||
inline bool comBuf::push ( const epicsOldString & value )
|
||||
{
|
||||
if ( this->unoccupiedBytes () < sizeof ( value ) ) {
|
||||
return false;
|
||||
@@ -300,17 +293,17 @@ inline bool comBuf::push ( const epicsOldString & value ) epicsThrows (())
|
||||
return true;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::push ( const epicsInt8 *pValue, unsigned nElem ) epicsThrows (())
|
||||
inline unsigned comBuf::push ( const epicsInt8 *pValue, unsigned nElem )
|
||||
{
|
||||
return copyInBytes ( pValue, nElem );
|
||||
}
|
||||
|
||||
inline unsigned comBuf::push ( const epicsUInt8 *pValue, unsigned nElem ) epicsThrows (())
|
||||
inline unsigned comBuf::push ( const epicsUInt8 *pValue, unsigned nElem )
|
||||
{
|
||||
return copyInBytes ( pValue, nElem );
|
||||
}
|
||||
|
||||
inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) epicsThrows (())
|
||||
inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem )
|
||||
{
|
||||
nElem = this->unoccupiedElem ( sizeof (*pValue), nElem );
|
||||
unsigned size = nElem * sizeof ( *pValue );
|
||||
@@ -319,7 +312,7 @@ inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) ep
|
||||
return nElem;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) epicsThrows (())
|
||||
inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem )
|
||||
{
|
||||
unsigned avail = this->occupiedBytes ();
|
||||
if ( elemSize * nElem > avail ) {
|
||||
@@ -328,17 +321,17 @@ inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) epics
|
||||
return nElem;
|
||||
}
|
||||
|
||||
inline void comBuf::commitIncomming () epicsThrows (())
|
||||
inline void comBuf::commitIncomming ()
|
||||
{
|
||||
this->commitIndex = this->nextWriteIndex;
|
||||
}
|
||||
|
||||
inline void comBuf::clearUncommittedIncomming () epicsThrows (())
|
||||
inline void comBuf::clearUncommittedIncomming ()
|
||||
{
|
||||
this->nextWriteIndex = this->commitIndex;
|
||||
}
|
||||
|
||||
inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) epicsThrows (())
|
||||
inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes )
|
||||
{
|
||||
if ( nBytes <= this->unoccupiedBytes () ) {
|
||||
memcpy ( & this->buf[this->nextWriteIndex], pBuf, nBytes );
|
||||
@@ -348,7 +341,7 @@ inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) epicsTh
|
||||
return false;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) epicsThrows (())
|
||||
inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes )
|
||||
{
|
||||
if ( nBytes > 0u ) {
|
||||
unsigned available = this->unoccupiedBytes ();
|
||||
@@ -361,7 +354,7 @@ inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) epicsT
|
||||
return nBytes;
|
||||
}
|
||||
|
||||
inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) epicsThrows (())
|
||||
inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes )
|
||||
{
|
||||
if ( nBytes <= this->occupiedBytes () ) {
|
||||
memcpy ( pBuf, &this->buf[this->nextReadIndex], nBytes);
|
||||
@@ -371,7 +364,7 @@ inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) epicsThrows
|
||||
return false;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) epicsThrows (())
|
||||
inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes )
|
||||
{
|
||||
unsigned occupied = this->occupiedBytes ();
|
||||
if ( nBytes > occupied ) {
|
||||
@@ -382,7 +375,7 @@ inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) epicsThrows
|
||||
return nBytes;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::removeBytes ( unsigned nBytes ) epicsThrows (())
|
||||
inline unsigned comBuf::removeBytes ( unsigned nBytes )
|
||||
{
|
||||
unsigned occupied = this->occupiedBytes ();
|
||||
if ( nBytes > occupied ) {
|
||||
@@ -393,7 +386,6 @@ inline unsigned comBuf::removeBytes ( unsigned nBytes ) epicsThrows (())
|
||||
}
|
||||
|
||||
inline epicsUInt8 comBuf::popUInt8 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
if ( this->occupiedBytes () < 1u ) {
|
||||
comBuf::throwInsufficentBytesException ();
|
||||
@@ -402,7 +394,6 @@ inline epicsUInt8 comBuf::popUInt8 ()
|
||||
}
|
||||
|
||||
inline epicsUInt16 comBuf::popUInt16 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
if ( this->occupiedBytes () < 2u ) {
|
||||
comBuf::throwInsufficentBytesException ();
|
||||
@@ -413,7 +404,6 @@ inline epicsUInt16 comBuf::popUInt16 ()
|
||||
}
|
||||
|
||||
inline epicsUInt32 comBuf::popUInt32 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
if ( this->occupiedBytes () < 4u ) {
|
||||
comBuf::throwInsufficentBytesException ();
|
||||
|
||||
@@ -27,17 +27,17 @@
|
||||
#include "iocinf.h"
|
||||
#include "virtualCircuit.h"
|
||||
|
||||
comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ) epicsThrows (()) :
|
||||
comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ):
|
||||
comBufMemMgr ( comBufMemoryManagerIn ), nBytesPending ( 0u )
|
||||
{
|
||||
}
|
||||
|
||||
comQueRecv::~comQueRecv () epicsThrows (())
|
||||
comQueRecv::~comQueRecv ()
|
||||
{
|
||||
this->clear ();
|
||||
}
|
||||
|
||||
void comQueRecv::clear () epicsThrows (())
|
||||
void comQueRecv::clear ()
|
||||
{
|
||||
comBuf *pBuf;
|
||||
while ( ( pBuf = this->bufs.get () ) ) {
|
||||
@@ -47,7 +47,7 @@ void comQueRecv::clear () epicsThrows (())
|
||||
this->nBytesPending = 0u;
|
||||
}
|
||||
|
||||
unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epicsThrows (())
|
||||
unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes )
|
||||
{
|
||||
unsigned totalBytes = 0u;
|
||||
do {
|
||||
@@ -68,7 +68,7 @@ unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epicsThro
|
||||
return totalBytes;
|
||||
}
|
||||
|
||||
unsigned comQueRecv::removeBytes ( unsigned nBytes ) epicsThrows (())
|
||||
unsigned comQueRecv::removeBytes ( unsigned nBytes )
|
||||
{
|
||||
unsigned totalBytes = 0u;
|
||||
unsigned bytesLeft = nBytes;
|
||||
@@ -95,7 +95,6 @@ unsigned comQueRecv::removeBytes ( unsigned nBytes ) epicsThrows (())
|
||||
}
|
||||
|
||||
void comQueRecv::popString ( epicsOldString *pStr )
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
for ( unsigned i = 0u; i < sizeof ( *pStr ); i++ ) {
|
||||
pStr[0][i] = this->popInt8 ();
|
||||
@@ -103,7 +102,7 @@ void comQueRecv::popString ( epicsOldString *pStr )
|
||||
}
|
||||
|
||||
void comQueRecv::pushLastComBufReceived ( comBuf & bufIn )
|
||||
epicsThrows (())
|
||||
|
||||
{
|
||||
bufIn.commitIncomming ();
|
||||
comBuf * pComBuf = this->bufs.last ();
|
||||
@@ -128,7 +127,6 @@ 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 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
epicsUInt16 tmp;
|
||||
if ( this->occupiedBytes() >= sizeof (tmp) ) {
|
||||
@@ -147,7 +145,6 @@ 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 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
epicsUInt32 tmp;
|
||||
if ( this->occupiedBytes() >= sizeof (tmp) ) {
|
||||
@@ -169,7 +166,7 @@ epicsUInt32 comQueRecv::multiBufferPopUInt32 ()
|
||||
return tmp;
|
||||
}
|
||||
|
||||
void comQueRecv::removeAndDestroyBuf ( comBuf & buf ) epicsThrows (())
|
||||
void comQueRecv::removeAndDestroyBuf ( comBuf & buf )
|
||||
{
|
||||
this->bufs.remove ( buf );
|
||||
buf.~comBuf ();
|
||||
|
||||
@@ -31,54 +31,51 @@
|
||||
|
||||
class comQueRecv {
|
||||
public:
|
||||
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 ));
|
||||
comQueRecv ( comBufMemoryManager & );
|
||||
~comQueRecv ();
|
||||
unsigned occupiedBytes () const;
|
||||
unsigned copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes );
|
||||
unsigned removeBytes ( unsigned nBytes );
|
||||
void pushLastComBufReceived ( comBuf & );
|
||||
void clear ();
|
||||
epicsInt8 popInt8 ();
|
||||
epicsUInt8 popUInt8 ();
|
||||
epicsInt16 popInt16 ();
|
||||
epicsUInt16 popUInt16 ();
|
||||
epicsInt32 popInt32 ();
|
||||
epicsUInt32 popUInt32 ();
|
||||
epicsFloat32 popFloat32 ();
|
||||
epicsFloat64 popFloat64 ();
|
||||
void popString ( epicsOldString * );
|
||||
private:
|
||||
tsDLList < comBuf > bufs;
|
||||
comBufMemoryManager & comBufMemMgr;
|
||||
unsigned nBytesPending;
|
||||
epicsUInt16 multiBufferPopUInt16 () epicsThrows (( comBuf::insufficentBytesAvailable ));
|
||||
epicsUInt32 multiBufferPopUInt32 () epicsThrows (( comBuf::insufficentBytesAvailable ));
|
||||
void removeAndDestroyBuf ( comBuf & ) epicsThrows (());
|
||||
comQueRecv ( const comQueRecv & ) epicsThrows (());
|
||||
comQueRecv & operator = ( const comQueRecv & ) epicsThrows (());
|
||||
epicsUInt16 multiBufferPopUInt16 ();
|
||||
epicsUInt32 multiBufferPopUInt32 ();
|
||||
void removeAndDestroyBuf ( comBuf & );
|
||||
comQueRecv ( const comQueRecv & );
|
||||
comQueRecv & operator = ( const comQueRecv & );
|
||||
};
|
||||
|
||||
inline unsigned comQueRecv::occupiedBytes () const
|
||||
epicsThrows (())
|
||||
|
||||
{
|
||||
return this->nBytesPending;
|
||||
}
|
||||
|
||||
inline epicsInt8 comQueRecv::popInt8 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
return static_cast < epicsInt8 > ( this->popUInt8() );
|
||||
}
|
||||
|
||||
inline epicsInt16 comQueRecv::popInt16 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
return static_cast < epicsInt16 > ( ( this->popInt8() << 8u )
|
||||
| ( this->popInt8() << 0u ) );
|
||||
}
|
||||
|
||||
inline epicsInt32 comQueRecv::popInt32 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
epicsInt32 tmp ;
|
||||
tmp = this->popInt8() << 24u;
|
||||
@@ -89,7 +86,6 @@ inline epicsInt32 comQueRecv::popInt32 ()
|
||||
}
|
||||
|
||||
inline epicsFloat32 comQueRecv::popFloat32 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
epicsFloat32 tmp;
|
||||
epicsUInt8 wire[ sizeof ( tmp ) ];
|
||||
@@ -102,7 +98,6 @@ inline epicsFloat32 comQueRecv::popFloat32 ()
|
||||
}
|
||||
|
||||
inline epicsFloat64 comQueRecv::popFloat64 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
epicsFloat64 tmp;
|
||||
epicsUInt8 wire[ sizeof ( tmp ) ];
|
||||
@@ -115,7 +110,6 @@ inline epicsFloat64 comQueRecv::popFloat64 ()
|
||||
}
|
||||
|
||||
inline epicsUInt8 comQueRecv::popUInt8 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
comBuf * pComBuf = this->bufs.first ();
|
||||
if ( ! pComBuf ) {
|
||||
@@ -131,7 +125,6 @@ inline epicsUInt8 comQueRecv::popUInt8 ()
|
||||
|
||||
// optimization here complicates this function somewhat
|
||||
inline epicsUInt16 comQueRecv::popUInt16 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
comBuf *pComBuf = this->bufs.first ();
|
||||
if ( ! pComBuf ) {
|
||||
@@ -157,7 +150,6 @@ inline epicsUInt16 comQueRecv::popUInt16 ()
|
||||
|
||||
// optimization here complicates this function somewhat
|
||||
inline epicsUInt32 comQueRecv::popUInt32 ()
|
||||
epicsThrows (( comBuf::insufficentBytesAvailable ))
|
||||
{
|
||||
comBuf *pComBuf = this->bufs.first ();
|
||||
if ( ! pComBuf ) {
|
||||
|
||||
@@ -81,20 +81,18 @@ const char cacNillBytes [] =
|
||||
};
|
||||
|
||||
comQueSend::comQueSend ( wireSendAdapter & wireIn,
|
||||
comBufMemoryManager & comBufMemMgrIn ) epicsThrows (()) :
|
||||
comBufMemoryManager & comBufMemMgrIn ):
|
||||
comBufMemMgr ( comBufMemMgrIn ), wire ( wireIn ),
|
||||
nBytesPending ( 0u )
|
||||
{
|
||||
}
|
||||
|
||||
comQueSend::~comQueSend ()
|
||||
epicsThrows (())
|
||||
comQueSend::~comQueSend ()
|
||||
{
|
||||
this->clear ();
|
||||
}
|
||||
|
||||
void comQueSend::clear ()
|
||||
epicsThrows (())
|
||||
{
|
||||
comBuf *pBuf;
|
||||
|
||||
@@ -108,7 +106,6 @@ void comQueSend::clear ()
|
||||
}
|
||||
|
||||
void comQueSend::clearUncommitted ()
|
||||
epicsThrows (())
|
||||
{
|
||||
while ( this->pFirstUncommited.valid() ) {
|
||||
tsDLIter < comBuf > next = this->pFirstUncommited;
|
||||
@@ -124,37 +121,31 @@ void comQueSend::clearUncommitted ()
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
this->push ( static_cast <const dbr_string_t *> ( pValue ), nElem );
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
this->push ( static_cast <const dbr_short_t *> ( pValue ), nElem );
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
this->push ( static_cast <const dbr_float_t *> ( pValue ), nElem );
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
this->push ( static_cast <const dbr_char_t *> ( pValue ), nElem );
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
this->push ( static_cast <const dbr_long_t *> ( pValue ), nElem );
|
||||
}
|
||||
|
||||
void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
this->push ( static_cast <const dbr_double_t *> ( pValue ), nElem );
|
||||
}
|
||||
@@ -202,7 +193,6 @@ const comQueSend::copyFunc_t comQueSend::dbrCopyVector [39] = {
|
||||
};
|
||||
|
||||
comBuf * comQueSend::popNextComBufToSend ()
|
||||
epicsThrows (( ))
|
||||
{
|
||||
comBuf *pBuf = this->bufs.get ();
|
||||
if ( pBuf ) {
|
||||
@@ -226,7 +216,6 @@ 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 )
|
||||
epicsThrows (( cacChannel::outOfBounds, std::bad_alloc ))
|
||||
{
|
||||
this->beginMsg ();
|
||||
if ( payloadSize < 0xffff && nElem < 0xffff ) {
|
||||
@@ -256,8 +245,6 @@ 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 )
|
||||
epicsThrows (( cacChannel::outOfBounds,
|
||||
cacChannel::badType, std::bad_alloc ))
|
||||
{
|
||||
if ( ! this->dbr_type_ok ( dataType ) ) {
|
||||
throw cacChannel::badType();
|
||||
@@ -303,7 +290,6 @@ void comQueSend::insertRequestWithPayLoad (
|
||||
}
|
||||
|
||||
void comQueSend::commitMsg ()
|
||||
epicsThrows (())
|
||||
{
|
||||
while ( this->pFirstUncommited.valid() ) {
|
||||
this->nBytesPending += this->pFirstUncommited->uncommittedBytes ();
|
||||
|
||||
@@ -39,43 +39,28 @@
|
||||
//
|
||||
class comQueSend {
|
||||
public:
|
||||
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 (( std::bad_alloc ));
|
||||
void pushUInt32 ( const ca_uint32_t value )
|
||||
epicsThrows (( std::bad_alloc ));
|
||||
void pushFloat32 ( const ca_float32_t value )
|
||||
epicsThrows (( std::bad_alloc ));
|
||||
void pushString ( const char *pVal, unsigned nChar )
|
||||
epicsThrows (( std::bad_alloc ));
|
||||
comQueSend ( wireSendAdapter &, comBufMemoryManager & );
|
||||
~comQueSend ();
|
||||
void clear ();
|
||||
void beginMsg ();
|
||||
void commitMsg ();
|
||||
unsigned occupiedBytes () const;
|
||||
bool flushEarlyThreshold ( unsigned nBytesThisMsg ) const;
|
||||
bool flushBlockThreshold ( unsigned nBytesThisMsg ) const;
|
||||
bool dbr_type_ok ( unsigned type );
|
||||
void pushUInt16 ( const ca_uint16_t value );
|
||||
void pushUInt32 ( const ca_uint32_t value );
|
||||
void pushFloat32 ( const ca_float32_t value );
|
||||
void pushString ( const char *pVal, unsigned nChar );
|
||||
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 )
|
||||
epicsThrows (( cacChannel::outOfBounds, std::bad_alloc ));
|
||||
ca_uint32_t requestDependent, bool v49Ok );
|
||||
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 )
|
||||
epicsThrows (( cacChannel::outOfBounds,
|
||||
cacChannel::badType, std::bad_alloc ));
|
||||
comBuf * popNextComBufToSend () epicsThrows (());
|
||||
const void * pPayload, bool v49Ok );
|
||||
comBuf * popNextComBufToSend ();
|
||||
private:
|
||||
comBufMemoryManager & comBufMemMgr;
|
||||
tsDLList < comBuf > bufs;
|
||||
@@ -86,24 +71,15 @@ private:
|
||||
const void *pValue, unsigned nElem );
|
||||
static const copyFunc_t dbrCopyVector [39];
|
||||
|
||||
void copy_dbr_string ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ));
|
||||
void copy_dbr_short ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ));
|
||||
void copy_dbr_float ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ));
|
||||
void copy_dbr_char ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ));
|
||||
void copy_dbr_long ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ));
|
||||
void copy_dbr_double ( const void *pValue, unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ));
|
||||
void pushComBuf ( comBuf & )
|
||||
epicsThrows (());
|
||||
comBuf * newComBuf ()
|
||||
epicsThrows (( std::bad_alloc ));
|
||||
void clearUncommitted ()
|
||||
epicsThrows (());
|
||||
void copy_dbr_string ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_short ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_float ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_char ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_long ( const void *pValue, unsigned nElem );
|
||||
void copy_dbr_double ( const void *pValue, unsigned nElem );
|
||||
void pushComBuf ( comBuf & );
|
||||
comBuf * newComBuf ();
|
||||
void clearUncommitted ();
|
||||
|
||||
//
|
||||
// visual C++ versions 6 & 7 do not allow out of
|
||||
@@ -111,7 +87,6 @@ private:
|
||||
//
|
||||
template < class T >
|
||||
inline void push ( const T *pVal, const unsigned nElem )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
comBuf * pLastBuf = this->bufs.last ();
|
||||
unsigned nCopied;
|
||||
@@ -136,7 +111,6 @@ private:
|
||||
//
|
||||
template < class T >
|
||||
inline void push ( const T & val )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
comBuf * pComBuf = this->bufs.last ();
|
||||
if ( pComBuf && pComBuf->push ( val ) ) {
|
||||
@@ -147,14 +121,13 @@ private:
|
||||
this->pushComBuf ( *pComBuf );
|
||||
}
|
||||
|
||||
comQueSend ( const comQueSend & ) epicsThrows (());
|
||||
comQueSend & operator = ( const comQueSend & ) epicsThrows (());
|
||||
comQueSend ( const comQueSend & );
|
||||
comQueSend & operator = ( const comQueSend & );
|
||||
};
|
||||
|
||||
extern const char cacNillBytes[];
|
||||
|
||||
inline bool comQueSend::dbr_type_ok ( unsigned type )
|
||||
epicsThrows (())
|
||||
{
|
||||
if ( type >= ( sizeof ( this->dbrCopyVector ) / sizeof ( this->dbrCopyVector[0] ) ) ) {
|
||||
return false;
|
||||
@@ -166,31 +139,26 @@ inline bool comQueSend::dbr_type_ok ( unsigned type )
|
||||
}
|
||||
|
||||
inline void comQueSend::pushUInt16 ( const ca_uint16_t value )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
this->push ( value );
|
||||
}
|
||||
|
||||
inline void comQueSend::pushUInt32 ( const ca_uint32_t value )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
this->push ( value );
|
||||
}
|
||||
|
||||
inline void comQueSend::pushFloat32 ( const ca_float32_t value )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
this->push ( value );
|
||||
}
|
||||
|
||||
inline void comQueSend::pushString ( const char *pVal, unsigned nChar )
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
this->push ( pVal, nChar );
|
||||
}
|
||||
|
||||
inline void comQueSend::pushComBuf ( comBuf & cb )
|
||||
epicsThrows (())
|
||||
{
|
||||
this->bufs.add ( cb );
|
||||
if ( ! this->pFirstUncommited.valid() ) {
|
||||
@@ -199,25 +167,21 @@ inline void comQueSend::pushComBuf ( comBuf & cb )
|
||||
}
|
||||
|
||||
inline unsigned comQueSend::occupiedBytes () const
|
||||
epicsThrows (())
|
||||
{
|
||||
return this->nBytesPending;
|
||||
}
|
||||
|
||||
inline bool comQueSend::flushBlockThreshold ( unsigned nBytesThisMsg )
|
||||
const epicsThrows (())
|
||||
inline bool comQueSend::flushBlockThreshold ( unsigned nBytesThisMsg ) const
|
||||
{
|
||||
return ( this->nBytesPending + nBytesThisMsg > 16 * comBuf::capacityBytes () );
|
||||
}
|
||||
|
||||
inline bool comQueSend::flushEarlyThreshold ( unsigned nBytesThisMsg )
|
||||
const epicsThrows (())
|
||||
inline bool comQueSend::flushEarlyThreshold ( unsigned nBytesThisMsg ) const
|
||||
{
|
||||
return ( this->nBytesPending + nBytesThisMsg > 4 * comBuf::capacityBytes () );
|
||||
}
|
||||
|
||||
inline void comQueSend::beginMsg ()
|
||||
epicsThrows (())
|
||||
{
|
||||
if ( this->pFirstUncommited.valid() ) {
|
||||
this->clearUncommitted ();
|
||||
@@ -227,7 +191,6 @@ inline void comQueSend::beginMsg ()
|
||||
|
||||
// wrapping this with a function avoids WRS T2.2 Cygnus GNU compiler bugs
|
||||
inline comBuf * comQueSend::newComBuf ()
|
||||
epicsThrows (( std::bad_alloc ))
|
||||
{
|
||||
return new ( this->comBufMemMgr ) comBuf;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ void * msgForMultiplyDefinedPV::operator new ( size_t size,
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
void msgForMultiplyDefinedPV::operator delete ( void *pCadaver,
|
||||
tsFreeList < class msgForMultiplyDefinedPV, 16 > & freeList ) epicsThrows(())
|
||||
tsFreeList < class msgForMultiplyDefinedPV, 16 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver, sizeof ( msgForMultiplyDefinedPV ) );
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ inline void * nciu::operator new ( size_t size,
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void nciu::operator delete ( void * pCadaver,
|
||||
tsFreeList < class nciu, 1024 > & freeList ) epicsThrows(())
|
||||
tsFreeList < class nciu, 1024 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver, sizeof ( nciu ) );
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ inline void * netSubscription::operator new ( size_t size,
|
||||
|
||||
#if defined ( CXX_PLACEMENT_DELETE )
|
||||
inline void netSubscription::operator delete ( void *pCadaver,
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &freeList ) epicsThrows(())
|
||||
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
@@ -222,7 +222,7 @@ inline void * netReadNotifyIO::operator new ( size_t size,
|
||||
|
||||
#if defined ( CXX_PLACEMENT_DELETE )
|
||||
inline void netReadNotifyIO::operator delete ( void *pCadaver,
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > &freeList ) epicsThrows(())
|
||||
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > &freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
@@ -243,7 +243,7 @@ inline void * netWriteNotifyIO::operator new ( size_t size,
|
||||
|
||||
#if defined ( CXX_PLACEMENT_DELETE )
|
||||
inline void netWriteNotifyIO::operator delete ( void *pCadaver,
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > &freeList ) epicsThrows(())
|
||||
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > &freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ inline void * oldChannelNotify::operator new ( size_t size,
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void oldChannelNotify::operator delete ( void *pCadaver,
|
||||
tsFreeList < struct oldChannelNotify, 1024 > & freeList ) epicsThrows(())
|
||||
tsFreeList < struct oldChannelNotify, 1024 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
@@ -458,7 +458,7 @@ inline void * oldSubscription::operator new ( size_t size,
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void oldSubscription::operator delete ( void *pCadaver,
|
||||
tsFreeList < struct oldSubscription, 1024 > & freeList ) epicsThrows(())
|
||||
tsFreeList < struct oldSubscription, 1024 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
@@ -477,7 +477,7 @@ inline void * getCopy::operator new ( size_t size,
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void getCopy::operator delete ( void *pCadaver,
|
||||
tsFreeList < class getCopy, 1024 > & freeList ) epicsThrows(())
|
||||
tsFreeList < class getCopy, 1024 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
@@ -491,7 +491,7 @@ inline void * putCallback::operator new ( size_t size,
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void putCallback::operator delete ( void * pCadaver,
|
||||
tsFreeList < class putCallback, 1024 > & freeList ) epicsThrows(())
|
||||
tsFreeList < class putCallback, 1024 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
@@ -510,7 +510,7 @@ inline void * getCallback::operator new ( size_t size,
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void getCallback::operator delete ( void *pCadaver,
|
||||
tsFreeList < class getCallback, 1024 > & freeList ) epicsThrows(())
|
||||
tsFreeList < class getCallback, 1024 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ void * repeaterClient::operator new ( size_t size,
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
void repeaterClient::operator delete ( void *pCadaver,
|
||||
tsFreeList < repeaterClient, 0x20 > & freeList ) epicsThrows(())
|
||||
tsFreeList < repeaterClient, 0x20 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ inline void * CASG::operator new ( size_t size,
|
||||
|
||||
# if defined ( CXX_PLACEMENT_DELETE )
|
||||
inline void CASG::operator delete ( void * pCadaver,
|
||||
tsFreeList < struct CASG, 128 > & freeList ) epicsThrows(())
|
||||
tsFreeList < struct CASG, 128 > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ void * syncGroupReadNotify::operator new ( size_t size,
|
||||
|
||||
#if defined ( CXX_PLACEMENT_DELETE )
|
||||
void syncGroupReadNotify::operator delete ( void *pCadaver,
|
||||
tsFreeList < class syncGroupReadNotify, 128, epicsMutexNOOP > &freeList ) epicsThrows(())
|
||||
tsFreeList < class syncGroupReadNotify, 128, epicsMutexNOOP > &freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ void * syncGroupWriteNotify::operator new ( size_t size,
|
||||
|
||||
#if defined ( CXX_PLACEMENT_DELETE )
|
||||
void syncGroupWriteNotify::operator delete ( void *pCadaver,
|
||||
tsFreeList < class syncGroupWriteNotify, 128, epicsMutexNOOP > &freeList ) epicsThrows(())
|
||||
tsFreeList < class syncGroupWriteNotify, 128, epicsMutexNOOP > &freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ void tcpSendThread::run ()
|
||||
}
|
||||
|
||||
unsigned tcpiiu::sendBytes ( const void *pBuf,
|
||||
unsigned nBytesInBuf ) epicsThrows (())
|
||||
unsigned nBytesInBuf )
|
||||
{
|
||||
int status;
|
||||
unsigned nBytes = 0u;
|
||||
@@ -195,7 +195,7 @@ unsigned tcpiiu::sendBytes ( const void *pBuf,
|
||||
return nBytes;
|
||||
}
|
||||
|
||||
unsigned tcpiiu::recvBytes ( void * pBuf, unsigned nBytesInBuf ) epicsThrows (())
|
||||
unsigned tcpiiu::recvBytes ( void * pBuf, unsigned nBytesInBuf )
|
||||
{
|
||||
unsigned bytesAvailable = 0u;
|
||||
|
||||
|
||||
@@ -176,8 +176,8 @@ private:
|
||||
bool discardingPendingData;
|
||||
|
||||
bool processIncoming ( epicsGuard < callbackMutex > & );
|
||||
unsigned sendBytes ( const void *pBuf, unsigned nBytesInBuf ) epicsThrows (());
|
||||
unsigned recvBytes ( void *pBuf, unsigned nBytesInBuf ) epicsThrows (());
|
||||
unsigned sendBytes ( const void *pBuf, unsigned nBytesInBuf );
|
||||
unsigned recvBytes ( void *pBuf, unsigned nBytesInBuf );
|
||||
void connect ();
|
||||
const char * pHostName () const;
|
||||
void blockUntilBytesArePendingInOS ();
|
||||
|
||||
@@ -144,7 +144,7 @@ void * dbChannelIO::operator new ( size_t ) // X aCC 361
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
void dbChannelIO::operator delete ( void *pCadaver,
|
||||
tsFreeList < dbChannelIO > & freeList ) epicsThrows(())
|
||||
tsFreeList < dbChannelIO > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ void * dbPutNotifyBlocker::operator new ( size_t ) // X aCC 361
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
void dbPutNotifyBlocker::operator delete ( void *pCadaver,
|
||||
tsFreeList < dbPutNotifyBlocker > & freeList ) epicsThrows(())
|
||||
tsFreeList < dbPutNotifyBlocker > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ void * dbSubscriptionIO::operator new ( size_t size,
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
void dbSubscriptionIO::operator delete ( void * pCadaver,
|
||||
tsFreeList < dbSubscriptionIO > & freeList ) epicsThrows(())
|
||||
tsFreeList < dbSubscriptionIO > & freeList )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user