Panda3D
 All Classes Functions Variables Enumerations
cycleDataStageReader.h
1 // Filename: cycleDataStageReader.h
2 // Created by: drose (08Feb06)
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 #ifndef CYCLEDATASTAGEREADER_H
16 #define CYCLEDATASTAGEREADER_H
17 
18 #include "pandabase.h"
19 
20 #include "cycleData.h"
21 #include "pipelineCycler.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : CycleDataStageReader
25 // Description : This class is similar to CycleDataReader, except it
26 // allows reading from a particular stage of the
27 // pipeline.
28 ////////////////////////////////////////////////////////////////////
29 template<class CycleDataType>
31 public:
32  // By hiding this template from interrogate, we improve compile-time
33  // speed and memory utilization.
34 #ifndef CPPPARSER
36  int stage, Thread *current_thread = Thread::get_current_thread());
37  INLINE CycleDataStageReader(const CycleDataStageReader<CycleDataType> &copy);
38  INLINE void operator = (const CycleDataStageReader<CycleDataType> &copy);
39 
40  INLINE ~CycleDataStageReader();
41 
42  INLINE const CycleDataType *operator -> () const;
43  INLINE operator const CycleDataType * () const;
44 
45  INLINE Thread *get_current_thread() const;
46 
47 private:
48 #ifdef DO_PIPELINING
49  // This is the data stored for a real pipelining implementation.
50  const PipelineCycler<CycleDataType> *_cycler;
51  Thread *_current_thread;
52  const CycleDataType *_pointer;
53  int _stage;
54 #else // !DO_PIPELINING
55  // This is all we need for the trivial, do-nothing implementation.
56  const CycleDataType *_pointer;
57 #endif // DO_PIPELINING
58 #endif // CPPPARSER
59 };
60 
61 #include "cycleDataStageReader.I"
62 
63 #endif
This class maintains different copies of a page of data between stages of the graphics pipeline (or a...
const CycleDataType * operator->() const
This provides an indirect member access to the actual CycleData data.
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
Definition: thread.I:145
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...
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:51