This is Unofficial EPICS BASE Doxygen Site
netReadNotifyIO.cpp
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 /*
10  *
11  * L O S A L A M O S
12  * Los Alamos National Laboratory
13  * Los Alamos, New Mexico 87545
14  *
15  * Copyright, 1986, The Regents of the University of California.
16  *
17  * Author: Jeff Hill
18  */
19 
20 #include <string>
21 #include <stdexcept>
22 
23 #include "errlog.h"
24 
25 #define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
26 
27 #include "iocinf.h"
28 #include "nciu.h"
29 #include "cac.h"
30 
32  privateInterfaceForIO & ioComplIntfIn,
33  cacReadNotify & notify ) :
34  notify ( notify ), privateChanForIO ( ioComplIntfIn )
35 {
36 }
37 
39 {
40 }
41 
42 void netReadNotifyIO::show ( unsigned /* level */ ) const
43 {
44  ::printf ( "netReadNotifyIO at %p\n",
45  static_cast < const void * > ( this ) );
46 }
47 
49  epicsGuard < epicsMutex > &, unsigned level ) const
50 {
51  this->show ( level );
52 }
53 
55  epicsGuard < epicsMutex > & guard, cacRecycle & recycle )
56 {
57  this->~netReadNotifyIO ();
58  recycle.recycleReadNotifyIO ( guard, *this );
59 }
60 
61 void netReadNotifyIO::completion (
63  cacRecycle & recycle, unsigned type,
64  arrayElementCount count, const void * pData )
65 {
66  //guard.assertIdenticalMutex ( this->mutex );
67  this->privateChanForIO.ioCompletionNotify ( guard, *this );
68  this->notify.completion ( guard, type, count, pData );
69  this->~netReadNotifyIO ();
70  recycle.recycleReadNotifyIO ( guard, *this );
71 }
72 
73 void netReadNotifyIO::completion (
75  cacRecycle & recycle )
76 {
77  //guard.assertIdenticalMutex ( this->mutex );
78  //this->chan.getClient().printf ( "Read response w/o data ?\n" );
79  this->privateChanForIO.ioCompletionNotify ( guard, *this );
80  this->~netReadNotifyIO ();
81  recycle.recycleReadNotifyIO ( guard, *this );
82 }
83 
84 void netReadNotifyIO::exception (
86  cacRecycle & recycle,
87  int status, const char *pContext )
88 {
89  //guard.assertIdenticalMutex ( this->mutex );
90  this->privateChanForIO.ioCompletionNotify ( guard, *this );
91  this->notify.exception (
92  guard, status, pContext, UINT_MAX, 0u );
93  this->~netReadNotifyIO ();
94  recycle.recycleReadNotifyIO ( guard, *this );
95 }
96 
97 void netReadNotifyIO::exception (
99  cacRecycle & recycle,
100  int status, const char *pContext,
101  unsigned type, arrayElementCount count )
102 {
103  //guard.assertIdenticalMutex ( this->mutex )
104  this->privateChanForIO.ioCompletionNotify ( guard, *this );
105  this->notify.exception (
106  guard, status, pContext, type, count );
107  this->~netReadNotifyIO ();
108  recycle.recycleReadNotifyIO ( guard, *this );
109 }
110 
111 class netSubscription * netReadNotifyIO::isSubscription ()
112 {
113  return 0;
114 }
115 
116 void netReadNotifyIO::forceSubscriptionUpdate (
118 {
119 }
120 
121 void netReadNotifyIO::operator delete ( void * )
122 {
123  // Visual C++ .net appears to require operator delete if
124  // placement operator delete is defined? I smell a ms rat
125  // because if I declare placement new and delete, but
126  // comment out the placement delete definition there are
127  // no undefined symbols.
128  errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked",
129  __FILE__, __LINE__ );
130 }
131 
132 
133 
netReadNotifyIO(privateInterfaceForIO &, cacReadNotify &)
virtual void ioCompletionNotify(epicsGuard< epicsMutex > &, class baseNMIU &)=0
void show(unsigned level) const
#define printf
Definition: epicsStdio.h:41
virtual void recycleReadNotifyIO(epicsGuard< epicsMutex > &, netReadNotifyIO &io)=0
Definition: cac.h:50
int errlogPrintf(const char *pFormat,...)
Definition: errlog.c:105
virtual void destroy(epicsGuard< epicsMutex > &, class cacRecycle &)=0
unsigned long arrayElementCount
Definition: cacIO.h:57
virtual void completion(epicsGuard< epicsMutex > &, unsigned type, arrayElementCount count, const void *pData)=0
Definition: nciu.h:127