Panda3D
Loading...
Searching...
No Matches
cycleDataStageWriter.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 cycleDataStageWriter.h
10 * @author drose
11 * @date 2006-02-06
12 */
13
14#ifndef CYCLEDATASTAGEWRITER_H
15#define CYCLEDATASTAGEWRITER_H
16
17#include "pandabase.h"
18
19#include "cycleData.h"
20#include "pipelineCycler.h"
22
23/**
24 * This class is similar to CycleDataWriter, except it allows writing to a
25 * particular stage of the pipeline. Usually this is used to implement
26 * writing directly to an upstream pipeline value, to recompute a cached value
27 * there (otherwise, the cached value would go away with the next pipeline
28 * cycle).
29 */
30template<class CycleDataType>
32public:
33 // By hiding this template from interrogate, we improve compile-time speed
34 // and memory utilization.
35#ifndef CPPPARSER
37 Thread *current_thread = Thread::get_current_thread());
39 bool force_to_0, Thread *current_thread = Thread::get_current_thread());
40
43
48 bool force_to_0);
49
50 INLINE ~CycleDataStageWriter();
51
52 INLINE void operator = (const CycleDataStageWriter<CycleDataType> &copy);
53 INLINE void operator = (CycleDataStageWriter<CycleDataType> &&from) noexcept;
54
55 INLINE CycleDataType *operator -> ();
56 INLINE const CycleDataType *operator -> () const;
57
58 INLINE operator CycleDataType * ();
59
60 INLINE Thread *get_current_thread() const;
61
62private:
63#ifdef DO_PIPELINING
64 // This is the data stored for a real pipelining implementation.
66 Thread *_current_thread;
67 CycleDataType *_pointer;
68 int _stage;
69#else // !DO_PIPELINING
70 // This is all we need for the trivial, do-nothing implementation.
71 CycleDataType *_pointer;
72#endif // DO_PIPELINING
73#endif // CPPPARSER
74};
75
77
78#endif
This class is similar to CycleDataLockedReader, except it allows reading from a particular stage of t...
This class is similar to CycleDataWriter, except it allows writing to a particular stage of the pipel...
Thread * get_current_thread() const
Returns the Thread pointer of the currently-executing thread, as passed to the constructor of this ob...
CycleDataType * operator->()
This provides an indirect member access to the actual CycleData data.
A thread; that is, a lightweight process.
Definition thread.h:46
get_current_thread
Returns a pointer to the currently-executing Thread object.
Definition thread.h:109
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...