~info-martin-konrad/epics-gateway/putlog

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 Berliner Speicherring-Gesellschaft fuer Synchrotron-
* Strahlung mbH (BESSY).
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* This file is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution. 
\*************************************************************************/
#ifndef _GATEASYNCIO_H_
#define _GATEASYNCIO_H_

/*+*********************************************************************
 *
 * File:       gateAsyncIO.h
 * Project:    CA Proxy Gateway
 *
 * Descr.:     Asynchronous Read / Write / pvExistTest
 *
 * Author(s):  J. Kowalkowski, J. Anderson, K. Evans (APS)
 *             R. Lange (BESSY)
 *
 *********************************************************************-*/

#include "tsDLList.h"
#include "casdef.h"

class gateVcData;

// ---------------------- async exist test pending

class gateAsyncE : public casAsyncPVExistIO, public tsDLNode<gateAsyncE>
{
public:
	gateAsyncE(const casCtx &ctx, tsDLList<gateAsyncE> *eioIn) :
		casAsyncPVExistIO(ctx),eio(eioIn)
	{}

	virtual ~gateAsyncE(void);

	void removeFromQueue(void) {
		if(eio) {
			eio->remove(*this);
			eio=NULL;
		}
	}
private:
	tsDLList<gateAsyncE> *eio;
};

// ---------------------- async read pending

class gateAsyncR : public casAsyncReadIO, public tsDLNode<gateAsyncR>
{
public:
	gateAsyncR(const casCtx &ctx, gdd& ddIn, tsDLList<gateAsyncR> *rioIn) :
		casAsyncReadIO(ctx),dd(ddIn),rio(rioIn)
	{ dd.reference(); }

	virtual ~gateAsyncR(void);

	gdd& DD(void) const { return dd; }
	void removeFromQueue(void) {
		if(rio) {
			rio->remove(*this);
			rio=NULL;
		}
	}
private:
	gdd& dd;
	tsDLList<gateAsyncR> *rio;
};

// ---------------------- async write pending

class gateAsyncW : public casAsyncWriteIO, public tsDLNode<gateAsyncW>
{
public:
	gateAsyncW(const casCtx &ctx, const gdd& ddIn, tsDLList<gateAsyncW> *wioIn) :
	  casAsyncWriteIO(ctx),dd(ddIn),wio(wioIn)
	  { dd.reference(); }

	virtual ~gateAsyncW(void);

	const gdd& DD(void) const { return dd; }
	void removeFromQueue(void) {
		if(wio) {
			wio->remove(*this);
			wio=NULL;
		}
	}
private:
	const gdd& dd;
	tsDLList<gateAsyncW> *wio;
};

class gatePendingWrite : public casAsyncWriteIO
{
public:
	gatePendingWrite(gateVcData &wowner, const casCtx &ctx, const gdd& wdd) :
	  casAsyncWriteIO(ctx),
	  owner(wowner),
	  dd(wdd)
	  { dd.reference(); }
	
	virtual ~gatePendingWrite(void);
	
	const gdd &DD(void) const { return dd; }
private:
	gateVcData &owner;
	const gdd &dd;
};

#endif

/* **************************** Emacs Editing Sequences ***************** */
/* Local Variables: */
/* tab-width: 4 */
/* c-basic-offset: 4 */
/* c-comment-only-line-offset: 0 */
/* c-file-offsets: ((substatement-open . 0) (label . 0)) */
/* End: */