Panda3D

Loading...
Searching...
No Matches
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>
27 class CycleDataStageReader {
28 public:
29 // By hiding this template from interrogate, we improve compile-time speed
30 // and memory utilization.
31#ifndef CPPPARSER
32 INLINE CycleDataStageReader(const PipelineCycler<CycleDataType> &cycler,
33 int stage, Thread *current_thread = Thread::get_current_thread());
34 INLINE CycleDataStageReader(const CycleDataStageReader<CycleDataType> &copy);
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
CycleDataStageReader::get_current_thread
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...
Definition cycleDataStageReader.I:162
CycleDataStageReader::operator->
const CycleDataType * operator->() const
This provides an indirect member access to the actual CycleData data.
Definition cycleDataStageReader.I:142
Thread
A thread; that is, a lightweight process.
Definition thread.h:46
Thread::get_current_thread
get_current_thread
Returns a pointer to the currently-executing Thread object.
Definition thread.h:109
cycleDataStageReader.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
cycleData.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pipelineCycler.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PipelineCycler
This class maintains different copies of a page of data between stages of the graphics pipeline (or a...
Definition pipelineCycler.h:46