23 #define epicsAssertAuthor "Jeff Hill johill@lanl.gov" 29 comBufMemMgr ( comBufMemoryManagerIn ), nBytesPending ( 0u )
41 while ( ( pBuf = this->bufs.
get () ) ) {
43 this->comBufMemMgr.
release ( pBuf );
45 this->nBytesPending = 0u;
50 unsigned totalBytes = 0u;
54 this->nBytesPending -= totalBytes;
57 totalBytes += pComBuf->
copyOutBytes ( &pBuf[totalBytes], nBytes - totalBytes );
59 this->bufs.
remove ( *pComBuf );
61 this->comBufMemMgr.
release ( pComBuf );
64 while ( totalBytes < nBytes );
65 this->nBytesPending -= totalBytes;
71 unsigned totalBytes = 0u;
72 unsigned bytesLeft = nBytes;
76 this->nBytesPending -= totalBytes;
79 unsigned nBytesThisTime = pComBuf->
removeBytes ( bytesLeft );
81 this->bufs.
remove ( *pComBuf );
83 this->comBufMemMgr.
release ( pComBuf );
85 if ( nBytesThisTime == 0u) {
88 totalBytes += nBytesThisTime;
89 bytesLeft = nBytes - totalBytes;
91 this->nBytesPending -= totalBytes;
97 for (
unsigned i = 0u;
i <
sizeof ( *pStr );
i++ ) {
109 this->nBytesPending += pComBuf->
push ( bufIn );
115 this->nBytesPending += bufBytes;
116 this->bufs.
add ( bufIn );
120 this->comBufMemMgr.
release ( & bufIn );
133 tmp = static_cast <
epicsUInt16> ( ( byte1 << 8u ) | byte2 );
157 ( ( byte1 << 24u ) | ( byte2 << 16u ) |
158 ( byte3 << 8u ) | byte4 );
167 void comQueRecv::removeAndDestroyBuf (
comBuf & buf )
169 this->bufs.
remove ( buf );
171 this->comBufMemMgr.
release ( & buf );
186 this->removeAndDestroyBuf ( *pComBuf );
188 this->nBytesPending--;
204 this->removeAndDestroyBuf ( *pComBuf );
208 return this->multiBufferPopUInt16 ();
223 this->removeAndDestroyBuf ( *pComBuf );
227 return this->multiBufferPopUInt32 ();
238 if ( avail >=
sizeof (
caHdr ) ) {
241 pComBuf->
pop ( smallPostsize );
245 pComBuf->
pop ( smallCount );
249 this->nBytesPending -=
sizeof (
caHdr );
250 if ( avail ==
sizeof (
caHdr ) ) {
251 this->removeAndDestroyBuf ( *pComBuf );
char epicsOldString[MAX_STRING_SIZE]
unsigned short epicsUInt16
bool popOldMsgHeader(struct caHdrLargeArray &)
unsigned short ca_uint16_t
comQueRecv(comBufMemoryManager &)
unsigned removeBytes(unsigned nBytes)
unsigned occupiedBytes() const
unsigned occupiedBytes() const
unsigned copyOutBytes(void *pBuf, unsigned nBytes)
unsigned removeBytes(unsigned nBytes)
static void throwInsufficentBytesException()
void popString(epicsOldString *)
unsigned copyOutBytes(epicsInt8 *pBuf, unsigned nBytes)
unsigned unoccupiedBytes() const
void pushLastComBufReceived(comBuf &)
virtual void release(void *)=0