00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef RECORDERFRAME_H
00016 #define RECORDERFRAME_H
00017
00018 #include "pandabase.h"
00019 #include "recorderBase.h"
00020 #include "typedWritable.h"
00021 #include "recorderTable.h"
00022 #include "datagram.h"
00023
00024 class BamWriter;
00025 class BamReader;
00026 class FactoryParams;
00027
00028
00029
00030
00031
00032
00033
00034
00035 class EXPCL_PANDA_RECORDER RecorderFrame : public TypedWritable {
00036 public:
00037 INLINE RecorderFrame();
00038 INLINE RecorderFrame(double timestamp, int frame,
00039 bool table_changed, RecorderTable *table);
00040 INLINE ~RecorderFrame();
00041
00042 void play_frame(BamReader *manager);
00043
00044 double _timestamp;
00045 int _frame;
00046 bool _table_changed;
00047 RecorderTable *_table;
00048
00049 Datagram _data;
00050 size_t _data_pos;
00051
00052 private:
00053 RecorderTable _local_table;
00054
00055 public:
00056 static void register_with_read_factory();
00057 virtual void write_datagram(BamWriter *manager, Datagram &dg);
00058 virtual int complete_pointers(TypedWritable **plist, BamReader *manager);
00059
00060 protected:
00061 static TypedWritable *make_from_bam(const FactoryParams ¶ms);
00062 void fillin(DatagramIterator &scan, BamReader *manager);
00063
00064 public:
00065 static TypeHandle get_class_type() {
00066 return _type_handle;
00067 }
00068 static void init_type() {
00069 TypedWritable::init_type();
00070 register_type(_type_handle, "RecorderFrame",
00071 TypedWritable::get_class_type());
00072 }
00073 virtual TypeHandle get_type() const {
00074 return get_class_type();
00075 }
00076 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00077
00078 private:
00079 static TypeHandle _type_handle;
00080 };
00081
00082 #include "recorderFrame.I"
00083
00084 #endif
00085