00001 // Filename: cycleData.h 00002 // Created by: drose (21Feb02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef CYCLEDATA_H 00020 #define CYCLEDATA_H 00021 00022 #include "pandabase.h" 00023 00024 #include "referenceCount.h" 00025 00026 class BamWriter; 00027 class BamReader; 00028 class TypedWritable; 00029 class Datagram; 00030 class DatagramIterator; 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Class : CycleData 00034 // Description : A single page of data maintained by a PipelineCycler. 00035 // Normally you should inherit from this class to define 00036 // the data structures that are important to protect 00037 // between stages of a pipeline. See PipelineCycler. 00038 //////////////////////////////////////////////////////////////////// 00039 #ifdef DO_PIPELINING 00040 00041 // If we are compiling in pipelining support, we maintain a pointer to 00042 // a CycleData object in each containing class, instead of the object 00043 // itself. Thus, it should be a ReferenceCount object. 00044 class EXPCL_PANDA CycleData : public ReferenceCount 00045 00046 #else // !DO_PIPELINING 00047 00048 // If we are *not* compiling in pipelining support, the CycleData 00049 // object is stored directly within its containing classes, and hence 00050 // should not be a ReferenceCount object. 00051 class EXPCL_PANDA CycleData 00052 00053 #endif // DO_PIPELINING 00054 { 00055 public: 00056 INLINE CycleData(); 00057 virtual ~CycleData(); 00058 00059 virtual CycleData *make_copy() const=0; 00060 00061 virtual void write_datagram(BamWriter *, Datagram &) const; 00062 virtual int complete_pointers(TypedWritable **p_list, BamReader *manager); 00063 virtual void fillin(DatagramIterator &scan, BamReader *manager); 00064 }; 00065 00066 #include "cycleData.I" 00067 00068 #endif 00069