Jack2: JackActivationCount.h Source File

Jack2 1.9.12

JackActivationCount.h
1 /*
2 Copyright (C) 2004-2008 Grame
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 */
19
20 #ifndef __JackActivationCount__
21 #define __JackActivationCount__
22
23 #include "JackPlatformPlug.h"
24 #include "JackTime.h"
25 #include "JackTypes.h"
26
27 namespace Jack
28 {
29
30 struct JackClientControl;
31
36 PRE_PACKED_STRUCTURE
37 class JackActivationCount
38 {
39
40 private:
41
42 SInt32 fValue;
43 SInt32 fCount;
44
45 public:
46
47 JackActivationCount(): fValue(0), fCount(0)
48 {}
49
50 bool Signal(JackSynchro* synchro, JackClientControl* control);
51
52 inline void Reset()
53 {
54 fValue = fCount;
55 }
56
57 inline void SetValue(int val)
58 {
59 fCount = val;
60 }
61
62 inline void IncValue()
63 {
64 fCount++;
65 }
66
67 inline void DecValue()
68 {
69 fCount--;
70 }
71
72 inline int GetValue() const
73 {
74 return fValue;
75 }
76
77 } POST_PACKED_STRUCTURE;
78
79 } // end of namespace
80
81
82 #endif
Jack::JackActivationCount
Client activation counter.
Definition: JackActivationCount.h:37
Jack::JackPosixSemaphore
Inter process synchronization using POSIX semaphore.
Definition: JackPosixSemaphore.h:36
Jack::JackClientControl
Client control possibly in shared memory.
Definition: JackClientControl.h:38