This is Unofficial EPICS BASE Doxygen Site
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
autoPtrRecycle.h
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 Versions 3.13.7
7
* and higher are distributed subject to a Software License Agreement found
8
* in file LICENSE that is included with this distribution.
9
\*************************************************************************/
10
11
/*
12
*
13
*
14
* L O S A L A M O S
15
* Los Alamos National Laboratory
16
* Los Alamos, New Mexico 87545
17
*
18
* Copyright, The Regents of the University of California.
19
*
20
*
21
* Author Jeffrey O. Hill
22
* johill@lanl.gov
23
* 505 665 1831
24
*/
25
26
#ifndef autoPtrRecycleh
27
#define autoPtrRecycleh
28
29
template
<
class
T >
30
class
autoPtrRecycle
{
31
public
:
32
autoPtrRecycle
(
33
epicsGuard < epicsMutex >
&,
chronIntIdResTable < baseNMIU >
&,
34
cacRecycle
&, T * );
35
~autoPtrRecycle
();
36
T &
operator *
()
const
;
37
T *
operator ->
()
const
;
38
T *
get
()
const
;
39
T *
release
();
40
private
:
41
T * p;
42
cacRecycle
& r;
43
chronIntIdResTable < baseNMIU >
& ioTable;
44
epicsGuard < epicsMutex >
& guard;
45
// not implemented
46
autoPtrRecycle
(
const
autoPtrRecycle
& );
47
autoPtrRecycle
& operator = (
const
autoPtrRecycle
& );
48
};
49
50
template
<
class
T >
51
inline
autoPtrRecycle<T>::autoPtrRecycle
(
52
epicsGuard < epicsMutex >
& guardIn,
chronIntIdResTable < baseNMIU >
& tbl,
53
cacRecycle
& rIn, T * pIn ) :
54
p ( pIn ), r ( rIn ), ioTable ( tbl ), guard ( guardIn ) {}
55
56
template
<
class
T >
57
inline
autoPtrRecycle<T>::~autoPtrRecycle
()
58
{
59
if
( this->p ) {
60
baseNMIU
*pb = this->p;
61
this->ioTable.
remove
( *pb );
62
pb->
destroy
( this->guard, this->r );
63
}
64
}
65
66
template
<
class
T >
67
inline
T &
autoPtrRecycle<T>::operator *
()
const
68
{
69
return
* this->p;
70
}
71
72
template
<
class
T >
73
inline
T *
autoPtrRecycle<T>::operator ->
()
const
74
{
75
return
this->p;
76
}
77
78
template
<
class
T >
79
inline
T *
autoPtrRecycle<T>::get
()
const
80
{
81
return
this->p;
82
}
83
84
template
<
class
T >
85
inline
T *
autoPtrRecycle<T>::release
()
86
{
87
T *pTmp = this->p;
88
this->p = 0;
89
return
pTmp;
90
}
91
92
#endif // #ifdef autoPtrRecycleh
autoPtrRecycle::operator*
T & operator*() const
Definition:
autoPtrRecycle.h:67
epicsGuard< epicsMutex >
chronIntIdResTable< baseNMIU >
baseNMIU
Definition:
netIO.h:44
cacRecycle
Definition:
cac.h:50
autoPtrRecycle::release
T * release()
Definition:
autoPtrRecycle.h:85
baseNMIU::destroy
virtual void destroy(epicsGuard< epicsMutex > &, class cacRecycle &)=0
resTable::remove
T * remove(const ID &idIn)
Definition:
resourceLib.h:297
autoPtrRecycle
Definition:
autoPtrRecycle.h:30
autoPtrRecycle::get
T * get() const
Definition:
autoPtrRecycle.h:79
autoPtrRecycle::~autoPtrRecycle
~autoPtrRecycle()
Definition:
autoPtrRecycle.h:57
autoPtrRecycle::autoPtrRecycle
autoPtrRecycle(epicsGuard< epicsMutex > &, chronIntIdResTable< baseNMIU > &, cacRecycle &, T *)
Definition:
autoPtrRecycle.h:51
autoPtrRecycle::operator->
T * operator->() const
Definition:
autoPtrRecycle.h:73
modules
ca
src
client
autoPtrRecycle.h
Generated by
1.8.11