Panda3D
cycleDataStageReader.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file cycleDataStageReader.h
10  * @author drose
11  * @date 2006-02-08
12  */
13 
14 #ifndef CYCLEDATASTAGEREADER_H
15 #define CYCLEDATASTAGEREADER_H
16 
17 #include "pandabase.h"
18 
19 #include "cycleData.h"
20 #include "pipelineCycler.h"
21 
22 /**
23  * This class is similar to CycleDataReader, except it allows reading from a
24  * particular stage of the pipeline.
25  */
26 template<class CycleDataType>
28 public:
29  // By hiding this template from interrogate, we improve compile-time speed
30  // and memory utilization.
31 #ifndef CPPPARSER
33  int stage, Thread *current_thread = Thread::get_current_thread());
35  INLINE void operator = (const CycleDataStageReader<CycleDataType> &copy);
36 
37  INLINE ~CycleDataStageReader();
38 
39  INLINE const CycleDataType *operator -> () const;
40  INLINE operator const CycleDataType * () const;
41 
42  INLINE Thread *get_current_thread() const;
43 
44 private:
45 #ifdef DO_PIPELINING
46  // This is the data stored for a real pipelining implementation.
47  const PipelineCycler<CycleDataType> *_cycler;
48  Thread *_current_thread;
49  const CycleDataType *_pointer;
50  int _stage;
51 #else // !DO_PIPELINING
52  // This is all we need for the trivial, do-nothing implementation.
53  const CycleDataType *_pointer;
54 #endif // DO_PIPELINING
55 #endif // CPPPARSER
56 };
57 
58 #include "cycleDataStageReader.I"
59 
60 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class maintains different copies of a page of data between stages of the graphics pipeline (or a...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
const CycleDataType * operator ->() const
This provides an indirect member access to the actual CycleData data.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is similar to CycleDataReader, except it allows reading from a particular stage of the pip...
A thread; that is, a lightweight process.
Definition: thread.h:46
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...