cycleDataWriter.I 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Filename: cycleDataWriter.I
  2. // Created by: drose (21Feb02)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. ////////////////////////////////////////////////////////////////////
  19. // Function: CycleDataWriter::Constructor
  20. // Access: Public
  21. // Description:
  22. ////////////////////////////////////////////////////////////////////
  23. template<class CycleDataType>
  24. INLINE CycleDataWriter<CycleDataType>::
  25. CycleDataWriter(PipelineCycler<CycleDataType> &cycler) :
  26. _cycler(cycler)
  27. {
  28. _pointer = _cycler.write();
  29. }
  30. ////////////////////////////////////////////////////////////////////
  31. // Function: CycleDataWriter::Copy Constructor
  32. // Access: Public
  33. // Description:
  34. ////////////////////////////////////////////////////////////////////
  35. template<class CycleDataType>
  36. INLINE CycleDataWriter<CycleDataType>::
  37. CycleDataWriter(const CycleDataWriter<CycleDataType> &copy) :
  38. _cycler(copy._cycler),
  39. _pointer(copy._pointer)
  40. {
  41. _cycler.increment_write(_pointer);
  42. }
  43. ////////////////////////////////////////////////////////////////////
  44. // Function: CycleDataWriter::Destructor
  45. // Access: Public
  46. // Description:
  47. ////////////////////////////////////////////////////////////////////
  48. template<class CycleDataType>
  49. INLINE CycleDataWriter<CycleDataType>::
  50. ~CycleDataWriter() {
  51. _cycler.release_write(_pointer);
  52. }
  53. ////////////////////////////////////////////////////////////////////
  54. // Function: CycleDataWriter::operator ->
  55. // Access: Public
  56. // Description: This provides an indirect member access to the actual
  57. // CycleData data.
  58. ////////////////////////////////////////////////////////////////////
  59. template<class CycleDataType>
  60. INLINE CycleDataType *CycleDataWriter<CycleDataType>::
  61. operator -> () {
  62. return _pointer;
  63. }
  64. ////////////////////////////////////////////////////////////////////
  65. // Function: CycleDataWriter::operator ->
  66. // Access: Public
  67. // Description: This provides an indirect member access to the actual
  68. // CycleData data.
  69. ////////////////////////////////////////////////////////////////////
  70. template<class CycleDataType>
  71. INLINE const CycleDataType *CycleDataWriter<CycleDataType>::
  72. operator -> () const {
  73. return _pointer;
  74. }