Panda3D
 All Classes Functions Variables Enumerations
cyclerHolder.I
1 // Filename: cyclerHolder.I
2 // Created by: drose (09Feb06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: CyclerHolder::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE CyclerHolder::
22 CyclerHolder(PipelineCyclerBase &cycler) {
23 #ifdef DO_PIPELINING
24  _cycler = &cycler;
25  _cycler->acquire();
26 #endif
27 }
28 
29 ////////////////////////////////////////////////////////////////////
30 // Function: CyclerHolder::Destructor
31 // Access: Public
32 // Description:
33 ////////////////////////////////////////////////////////////////////
34 INLINE CyclerHolder::
35 ~CyclerHolder() {
36 #ifdef DO_PIPELINING
37  _cycler->release();
38 #endif
39 }
40 
41 ////////////////////////////////////////////////////////////////////
42 // Function: CyclerHolder::Copy Constructor
43 // Access: Private
44 // Description: Do not attempt to copy CyclerHolders.
45 ////////////////////////////////////////////////////////////////////
46 INLINE CyclerHolder::
47 CyclerHolder(const CyclerHolder &copy) {
48  nassertv(false);
49 }
50 
51 ////////////////////////////////////////////////////////////////////
52 // Function: CyclerHolder::Copy Assignment Operator
53 // Access: Private
54 // Description: Do not attempt to copy CyclerHolders.
55 ////////////////////////////////////////////////////////////////////
56 INLINE void CyclerHolder::
57 operator = (const CyclerHolder &copy) {
58  nassertv(false);
59 }
A lightweight C++ object whose constructor calls acquire() and whose destructor calls release() on a ...
Definition: cyclerHolder.h:28
This is the trivial, non-threaded implementation of PipelineCyclerBase.
void acquire(Thread *current_thread=NULL)
Grabs an overall lock on the cycler.