|
|
@@ -16,9 +16,12 @@
|
|
|
//
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
+#ifdef DO_PIPELINING
|
|
|
+// This is the implementation for full support of pipelining (as well
|
|
|
+// as the sanity-check only implementation).
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: CycleDataWriter::Constructor
|
|
|
+// Function: CycleDataWriter::Constructor (full)
|
|
|
// Access: Public
|
|
|
// Description:
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
@@ -31,7 +34,7 @@ CycleDataWriter(PipelineCycler<CycleDataType> &cycler) :
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: CycleDataWriter::Constructor
|
|
|
+// Function: CycleDataWriter::Constructor (full)
|
|
|
// Access: Public
|
|
|
// Description: This is a lot like a copy constructor, in that the
|
|
|
// new CycleDataWriter object gets a handle to the same
|
|
|
@@ -51,7 +54,7 @@ CycleDataWriter(PipelineCycler<CycleDataType> &cycler,
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: CycleDataWriter::Constructor
|
|
|
+// Function: CycleDataWriter::Constructor (full)
|
|
|
// Access: Public
|
|
|
// Description: This flavor of the constructor elevates the pointer
|
|
|
// from the CycleDataReader from a read to a write
|
|
|
@@ -67,7 +70,7 @@ CycleDataWriter(PipelineCycler<CycleDataType> &cycler,
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: CycleDataWriter::Destructor
|
|
|
+// Function: CycleDataWriter::Destructor (full)
|
|
|
// Access: Public
|
|
|
// Description:
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
@@ -80,7 +83,7 @@ INLINE CycleDataWriter<CycleDataType>::
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: CycleDataWriter::operator ->
|
|
|
+// Function: CycleDataWriter::operator -> (full)
|
|
|
// Access: Public
|
|
|
// Description: This provides an indirect member access to the actual
|
|
|
// CycleData data.
|
|
|
@@ -93,7 +96,7 @@ operator -> () {
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: CycleDataWriter::operator ->
|
|
|
+// Function: CycleDataWriter::operator -> (full)
|
|
|
// Access: Public
|
|
|
// Description: This provides an indirect member access to the actual
|
|
|
// CycleData data.
|
|
|
@@ -106,7 +109,7 @@ operator -> () const {
|
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: CycleDataWriter::Typecast pointer
|
|
|
+// Function: CycleDataWriter::Typecast pointer (full)
|
|
|
// Access: Public
|
|
|
// Description: This allows the CycleDataWriter to be passed to any
|
|
|
// function that expects a CycleDataType pointer.
|
|
|
@@ -117,3 +120,97 @@ operator CycleDataType * () {
|
|
|
nassertr(_pointer != (CycleDataType *)NULL, _cycler.cheat());
|
|
|
return _pointer;
|
|
|
}
|
|
|
+
|
|
|
+#else // !DO_PIPELINING
|
|
|
+// This is the trivial, do-nothing implementation.
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: CycleDataWriter::Constructor (trivial)
|
|
|
+// Access: Public
|
|
|
+// Description:
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+template<class CycleDataType>
|
|
|
+INLINE CycleDataWriter<CycleDataType>::
|
|
|
+CycleDataWriter(PipelineCycler<CycleDataType> &cycler) {
|
|
|
+ _pointer = cycler.write();
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: CycleDataWriter::Constructor (trivial)
|
|
|
+// Access: Public
|
|
|
+// Description: This is a lot like a copy constructor, in that the
|
|
|
+// new CycleDataWriter object gets a handle to the same
|
|
|
+// pointer held by the old CycleDataWriter object.
|
|
|
+// However, since only one write pointer may be active
|
|
|
+// at a time, this invalidates the old object.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+template<class CycleDataType>
|
|
|
+INLINE CycleDataWriter<CycleDataType>::
|
|
|
+CycleDataWriter(PipelineCycler<CycleDataType> &,
|
|
|
+ CycleDataWriter<CycleDataType> &take_from) :
|
|
|
+ _pointer(take_from.take_pointer())
|
|
|
+{
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: CycleDataWriter::Constructor (trivial)
|
|
|
+// Access: Public
|
|
|
+// Description: This flavor of the constructor elevates the pointer
|
|
|
+// from the CycleDataReader from a read to a write
|
|
|
+// pointer (and invalidates the reader).
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+template<class CycleDataType>
|
|
|
+INLINE CycleDataWriter<CycleDataType>::
|
|
|
+CycleDataWriter(PipelineCycler<CycleDataType> &,
|
|
|
+ CycleDataReader<CycleDataType> &take_from) :
|
|
|
+ _pointer((CycleDataType *)take_from.take_pointer())
|
|
|
+{
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: CycleDataWriter::Destructor (trivial)
|
|
|
+// Access: Public
|
|
|
+// Description:
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+template<class CycleDataType>
|
|
|
+INLINE CycleDataWriter<CycleDataType>::
|
|
|
+~CycleDataWriter() {
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: CycleDataWriter::operator -> (trivial)
|
|
|
+// Access: Public
|
|
|
+// Description: This provides an indirect member access to the actual
|
|
|
+// CycleData data.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+template<class CycleDataType>
|
|
|
+INLINE CycleDataType *CycleDataWriter<CycleDataType>::
|
|
|
+operator -> () {
|
|
|
+ return _pointer;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: CycleDataWriter::operator -> (trivial)
|
|
|
+// Access: Public
|
|
|
+// Description: This provides an indirect member access to the actual
|
|
|
+// CycleData data.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+template<class CycleDataType>
|
|
|
+INLINE const CycleDataType *CycleDataWriter<CycleDataType>::
|
|
|
+operator -> () const {
|
|
|
+ return _pointer;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: CycleDataWriter::Typecast pointer (trivial)
|
|
|
+// Access: Public
|
|
|
+// Description: This allows the CycleDataWriter to be passed to any
|
|
|
+// function that expects a CycleDataType pointer.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+template<class CycleDataType>
|
|
|
+INLINE CycleDataWriter<CycleDataType>::
|
|
|
+operator CycleDataType * () {
|
|
|
+ return _pointer;
|
|
|
+}
|
|
|
+
|
|
|
+#endif // DO_PIPELINING
|