Qore Programming Language
0.8.7
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
include
qore
AutoVLock.h
1
/* -*- mode: c++; indent-tabs-mode: nil -*- */
2
/*
3
AutoVLock.h
4
5
Qore Programming Language
6
7
Copyright 2003 - 2013 David Nichols
8
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Lesser General Public
11
License as published by the Free Software Foundation; either
12
version 2.1 of the License, or (at your option) any later version.
13
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
18
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
*/
23
24
#ifndef _QORE_AUTOVLOCK_H
25
26
#define _QORE_AUTOVLOCK_H
27
28
class
AbstractSmartLock;
29
31
33
class
AutoVLock
{
34
private
:
35
// pointer to lock currently held
36
QoreThreadLock
* m;
37
38
// pointer to object to dereference
39
QoreObject
* o;
40
41
public
:
42
// pointer to ExceptionSink object for use with object notifications
43
ExceptionSink
* xsink;
44
45
private
:
47
struct
qore_avl_private* priv;
48
50
DLLLOCAL
AutoVLock
(
const
AutoVLock
&);
52
DLLLOCAL AutoVLock& operator=(
const
AutoVLock&);
54
DLLLOCAL
void
*
operator
new
(size_t);
55
56
public
:
58
60
DLLEXPORT AutoVLock(
ExceptionSink
* n_xsink);
61
63
DLLEXPORT
~AutoVLock
();
64
66
DLLEXPORT
operator
bool()
const
;
67
69
DLLEXPORT
void
del
();
70
72
DLLLOCAL
void
set
(
QoreThreadLock
* n_m);
73
75
DLLLOCAL
void
set
(
QoreObject
* n_o,
QoreThreadLock
* n_m);
76
78
DLLLOCAL
QoreThreadLock
*
get
()
const
;
79
81
DLLLOCAL
QoreObject
*
getObject
()
const
;
82
84
DLLLOCAL
void
clear
();
85
87
90
DLLLOCAL
void
addMemberNotification
(
QoreObject
* o,
const
char
* member);
91
};
92
93
#endif