This is Unofficial EPICS BASE Doxygen Site
netWriteNotifyIO.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 & ioComplIntf, cacWriteNotify & notifyIn ) :
33  notify ( notifyIn ), privateChanForIO ( ioComplIntf )
34 {
35 }
36 
38 {
39 }
40 
41 void netWriteNotifyIO::show ( unsigned /* level */ ) const
42 {
43  ::printf ( "read write notify IO at %p\n",
44  static_cast < const void * > ( this ) );
45 }
46 
49  unsigned level ) const
50 {
51  this->show ( level );
52 }
53 
54 void netWriteNotifyIO::destroy (
56  cacRecycle & recycle )
57 {
58  this->~netWriteNotifyIO ();
59  recycle.recycleWriteNotifyIO ( guard, *this );
60 }
61 
62 void netWriteNotifyIO::completion (
64  cacRecycle & recycle )
65 {
66  this->privateChanForIO.ioCompletionNotify ( guard, *this );
67  this->notify.completion ( guard );
68  this->~netWriteNotifyIO ();
69  recycle.recycleWriteNotifyIO ( guard, *this );
70 }
71 
72 void netWriteNotifyIO::completion (
74  cacRecycle & recycle,
75  unsigned /* type */, arrayElementCount /* count */,
76  const void * /* pData */ )
77 {
78  //this->chan.getClient().printf ( "Write response with data ?\n" );
79  this->privateChanForIO.ioCompletionNotify ( guard, *this );
80  this->~netWriteNotifyIO ();
81  recycle.recycleWriteNotifyIO ( guard, *this );
82 }
83 
84 void netWriteNotifyIO::exception (
86  cacRecycle & recycle,
87  int status, const char * pContext )
88 {
89  this->privateChanForIO.ioCompletionNotify ( guard, *this );
90  this->notify.exception (
91  guard, status, pContext, UINT_MAX, 0u );
92  this->~netWriteNotifyIO ();
93  recycle.recycleWriteNotifyIO ( guard, *this );
94 }
95 
96 void netWriteNotifyIO::exception (
98  cacRecycle & recycle,
99  int status, const char *pContext,
100  unsigned type, arrayElementCount count )
101 {
102  this->privateChanForIO.ioCompletionNotify ( guard, *this );
103  this->notify.exception (
104  guard, status, pContext, type, count );
105  this->~netWriteNotifyIO ();
106  recycle.recycleWriteNotifyIO ( guard, *this );
107 }
108 
110 {
111  return 0;
112 }
113 
114 void netWriteNotifyIO::forceSubscriptionUpdate (
116 {
117 }
118 
119 void netWriteNotifyIO::operator delete ( void * )
120 {
121  // Visual C++ .net appears to require operator delete if
122  // placement operator delete is defined? I smell a ms rat
123  // because if I declare placement new and delete, but
124  // comment out the placement delete definition there are
125  // no undefined symbols.
126  errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked",
127  __FILE__, __LINE__ );
128 }
129 
virtual void ioCompletionNotify(epicsGuard< epicsMutex > &, class baseNMIU &)=0
#define printf
Definition: epicsStdio.h:41
virtual void recycleWriteNotifyIO(epicsGuard< epicsMutex > &, netWriteNotifyIO &io)=0
Definition: cac.h:50
int errlogPrintf(const char *pFormat,...)
Definition: errlog.c:105
virtual class netSubscription * isSubscription()=0
unsigned long arrayElementCount
Definition: cacIO.h:57
void show(unsigned level) const
virtual void completion(epicsGuard< epicsMutex > &)=0
netWriteNotifyIO(privateInterfaceForIO &, cacWriteNotify &)
Definition: nciu.h:127