26 #ifndef INC_comQueSend_H 27 #define INC_comQueSend_H 34 #define comQueSendCopyDispatchSize 39 58 unsigned occupiedBytes ()
const;
59 bool flushEarlyThreshold (
unsigned nBytesThisMsg )
const;
60 bool flushBlockThreshold ()
const;
64 void pushString (
const char *pVal,
unsigned nChar );
65 void insertRequestHeader (
69 void insertRequestWithPayLoad (
72 const void * pPayload,
bool v49Ok );
73 comBuf * popNextComBufToSend ();
79 unsigned nBytesPending;
81 typedef void (
comQueSend::*copyScalarFunc_t ) (
82 const void * pValue );
84 void copy_dbr_string (
const void * pValue );
85 void copy_dbr_short (
const void * pValue );
86 void copy_dbr_float (
const void * pValue );
87 void copy_dbr_char (
const void * pValue );
88 void copy_dbr_long (
const void * pValue );
89 void copy_dbr_double (
const void * pValue );
90 void copy_dbr_invalid (
const void * pValue );
92 typedef void (
comQueSend::*copyVectorFunc_t ) (
93 const void * pValue,
unsigned nElem );
95 void copy_dbr_string (
const void *pValue,
unsigned nElem );
96 void copy_dbr_short (
const void *pValue,
unsigned nElem );
97 void copy_dbr_float (
const void *pValue,
unsigned nElem );
98 void copy_dbr_char (
const void *pValue,
unsigned nElem );
99 void copy_dbr_long (
const void *pValue,
unsigned nElem );
100 void copy_dbr_double (
const void *pValue,
unsigned nElem );
101 void copy_dbr_invalid (
const void * pValue,
unsigned nElem );
103 void pushComBuf (
comBuf & );
108 void clearUncommitedMsg ();
117 inline void push (
const T *pVal,
const unsigned nElem )
122 nCopied = pLastBuf->
push ( pVal, nElem );
127 while ( nElem > nCopied ) {
128 comBuf * pComBuf = newComBuf ();
129 nCopied += pComBuf->
push 130 ( &pVal[nCopied], nElem - nCopied );
131 this->pushComBuf ( *pComBuf );
140 inline void push (
const T & val )
143 if ( pComBuf && pComBuf->
push ( val ) ) {
146 pComBuf = newComBuf ();
147 bool success = pComBuf->
push ( val );
149 this->pushComBuf ( *pComBuf );
153 inline void push (
const T * );
163 pSendQue ( & sendQueIn )
165 sendQueIn.beginMsg ();
170 if ( this->pSendQue ) {
171 this->pSendQue->clearUncommitedMsg ();
177 if ( this->pSendQue ) {
178 this->pSendQue->commitMsg ();
183 inline void comQueSend::beginMsg ()
185 this->pFirstUncommited = this->bufs.
lastIter ();
190 this->push ( value );
195 this->push ( value );
200 this->push ( value );
205 this->push ( pVal, nChar );
208 inline void comQueSend::pushComBuf (
comBuf & cb )
210 this->bufs.
add ( cb );
211 if ( ! this->pFirstUncommited.
valid() ) {
212 this->pFirstUncommited = this->bufs.
lastIter ();
218 return this->nBytesPending;
232 inline comBuf * comQueSend::newComBuf ()
234 return new ( this->comBufMemMgr )
comBuf;
237 #endif // ifndef INC_comQueSend_H
void pushUInt32(const ca_uint32_t value)
comQueSendMsgMinder(class comQueSend &, epicsGuard< epicsMutex > &)
#define assert(exp)
Declare that a condition should be true.
void pushString(const char *pVal, unsigned nChar)
void pushUInt16(const ca_uint16_t value)
bool flushEarlyThreshold(unsigned nBytesThisMsg) const
unsigned short ca_uint16_t
void pushFloat32(const ca_float32_t value)
unsigned occupiedBytes() const
bool flushBlockThreshold() const
unsigned long arrayElementCount
const char cacNillBytes[]
static unsigned capacityBytes()
tsDLIterConst< T > lastIter() const
#define comQueSendCopyDispatchSize