19 #define epicsAssertAuthor "Jeff Hill johill@lanl.gov" 28 CASG & sgIn, PRecycleFunc pRecycleFuncIn,
29 chid pChan,
void * pValueIn ) :
30 chan ( pChan ), pRecycleFunc ( pRecycleFuncIn ),
31 sg ( sgIn ), pValue ( pValueIn ),
32 magic ( CASG_MAGIC ), id ( 0u ),
42 this->ioComplete =
false;
44 this->chan->
read ( guard, type, count, *
this, &this->
id );
52 if ( this->idIsValid ) {
53 this->chan->
ioCancel ( callbackGuard, mutualExcusionGuard, this->
id );
54 this->idIsValid =
false;
62 return new ( freeList )
70 CASG & sgRef ( this->sg );
72 ( sgRef.*pRecycleFunc ) ( guard, *
this );
77 assert ( ! this->idIsValid );
84 if ( this->magic != CASG_MAGIC ) {
86 "cac: sync group io_complete(): bad sync grp op magic number?\n" );
92 memcpy ( this->pValue, pData, size );
95 this->idIsValid =
false;
96 this->ioComplete =
true;
99 void syncGroupReadNotify::exception (
103 if ( this->magic != CASG_MAGIC ) {
105 "cac: sync group io_complete(): bad sync grp op magic number?\n" );
108 this->idIsValid =
false;
109 this->sg.exception ( guard, status, pContext,
110 __FILE__, __LINE__, *this->chan, type, count,
CA_OP_GET );
121 ::printf (
"pending sg read op: pVal=%p\n", this->pValue );
123 ::printf (
"pending sg op: magic=%u sg=%p\n",
124 this->magic, static_cast < void * > ( & this->sg ) );
128 void syncGroupReadNotify::operator
delete (
void * )
135 errlogPrintf (
"%s:%d this compiler is confused about placement delete - memory was probably leaked",
136 __FILE__, __LINE__ );
139 void * syncGroupReadNotify::operator
new (
size_t size,
142 return freeList.allocate ( size );
145 #if defined ( CXX_PLACEMENT_DELETE ) 146 void syncGroupReadNotify::operator
delete (
void *pCadaver,
149 freeList.release ( pCadaver );
#define assert(exp)
Declare that a condition should be true.
static syncGroupReadNotify * factory(tsFreeList< class syncGroupReadNotify, 128, epicsMutexNOOP > &, CASG &, PRecycleFunc, chid, void *pValueIn)
void(CASG::* PRecycleFunc)(epicsGuard< epicsMutex > &, syncGroupReadNotify &)
syncGroupReadNotify(CASG &sgIn, PRecycleFunc, chid, void *pValueIn)
int errlogPrintf(const char *pFormat,...)
void cancel(CallbackGuard &cbGuard, epicsGuard< epicsMutex > &guard)
unsigned long arrayElementCount
virtual void completion(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pData)=0
void ioCancel(CallbackGuard &callbackGuard, epicsGuard< epicsMutex > &mutualExclusionGuard, const cacChannel::ioid &)
virtual ~syncGroupReadNotify()
#define dbr_size_n(TYPE, COUNT)
void destroy(CallbackGuard &cbGuard, epicsGuard< epicsMutex > &guard)
int printFormated(const char *pFormat,...)
void completionNotify(epicsGuard< epicsMutex > &, syncGroupNotify &)
void begin(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count)
void eliminateExcessiveSendBacklog(epicsGuard< epicsMutex > &)
void show(epicsGuard< epicsMutex > &, unsigned level) const
void read(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, cacReadNotify ¬ify, cacChannel::ioid *pId=0)