This is Unofficial EPICS BASE Doxygen Site
msgForMultiplyDefinedPV.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  *
12  *
13  * L O S A L A M O S
14  * Los Alamos National Laboratory
15  * Los Alamos, New Mexico 87545
16  *
17  * Copyright, 1986, The Regents of the University of California.
18  *
19  *
20  * Author Jeffrey O. Hill
21  * johill@lanl.gov
22  * 505 665 1831
23  */
24 
25 #include <string>
26 #include <stdexcept>
27 
28 #define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
29 
30 #include "errlog.h"
31 
32 #include "iocinf.h"
34 #include "cac.h"
35 #include "caerr.h" // for ECA_DBLCHNL
36 
38  ipAddrToAsciiEngine & engine,
40  const char * pChannelName, const char * pAcc ) :
41  dnsTransaction ( engine.createTransaction () ), cb ( cbIn )
42 {
43  strncpy ( this->acc, pAcc, sizeof ( this->acc ) );
44  this->acc[ sizeof ( this->acc ) - 1 ] = '\0';
45  strncpy ( this->channel, pChannelName, sizeof ( this->channel ) );
46  this->channel[ sizeof ( this->channel ) - 1 ] = '\0';
47 }
48 
50 {
51  this->dnsTransaction.release ();
52 }
53 
54 void msgForMultiplyDefinedPV::transactionComplete ( const char * pHostNameRej )
55 {
56  // calls into cac for the notification
57  // the msg object (= this) is being deleted as part of the notification
58  this->cb.pvMultiplyDefinedNotify ( *this, this->channel, this->acc, pHostNameRej );
59  // !! dont touch 'this' pointer after this point because object has been deleted !!
60 }
61 
62 void * msgForMultiplyDefinedPV::operator new ( size_t size,
64 {
65  return freeList.allocate ( size );
66 }
67 
68 #ifdef CXX_PLACEMENT_DELETE
69 void msgForMultiplyDefinedPV::operator delete ( void *pCadaver,
71 {
72  freeList.release ( pCadaver, sizeof ( msgForMultiplyDefinedPV ) );
73 }
74 #endif
75 
76 void msgForMultiplyDefinedPV::operator delete ( void * )
77 {
78  // Visual C++ .net appears to require operator delete if
79  // placement operator delete is defined? I smell a ms rat
80  // because if I declare placement new and delete, but
81  // comment out the placement delete definition there are
82  // no undefined symbols.
83  errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked",
84  __FILE__, __LINE__ );
85 }
86 
88 {
89 }
90 
91 
virtual void pvMultiplyDefinedNotify(class msgForMultiplyDefinedPV &, const char *pChannelName, const char *pAcc, const char *pRej)=0
msgForMultiplyDefinedPV(ipAddrToAsciiEngine &engine, callbackForMultiplyDefinedPV &, const char *pChannelName, const char *pAcc)
epicsPlacementDeleteOperator((void *, tsFreeList< class msgForMultiplyDefinedPV, 16 > &)) private cha channel)[64]
callbackForMultiplyDefinedPV & cb
ipAddrToAsciiTransaction & dnsTransaction
int errlogPrintf(const char *pFormat,...)
Definition: errlog.c:105
virtual void release()=0
void transactionComplete(const char *pHostName)