00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef RECORDERBASE_H
00016 #define RECORDERBASE_H
00017
00018 #include "pandabase.h"
00019 #include "referenceCount.h"
00020
00021 class BamReader;
00022 class BamWriter;
00023 class Datagram;
00024 class DatagramIterator;
00025 class TypedWritable;
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 class EXPCL_PANDA_RECORDER RecorderBase : virtual public ReferenceCount {
00051 protected:
00052 RecorderBase();
00053
00054 PUBLISHED:
00055 virtual ~RecorderBase();
00056
00057 INLINE bool is_recording() const;
00058 INLINE bool is_playing() const;
00059
00060 public:
00061 virtual void record_frame(BamWriter *manager, Datagram &dg);
00062 virtual void play_frame(DatagramIterator &scan, BamReader *manager);
00063
00064 virtual void write_recorder(BamWriter *manager, Datagram &dg);
00065
00066 protected:
00067 void fillin_recorder(DatagramIterator &scan, BamReader *manager);
00068
00069 private:
00070 enum Flags {
00071 F_recording = 0x0001,
00072 F_playing = 0x0002,
00073 };
00074 short _flags;
00075
00076 public:
00077 static TypeHandle get_class_type() {
00078 return _type_handle;
00079 }
00080 static void init_type() {
00081 ReferenceCount::init_type();
00082 register_type(_type_handle, "RecorderBase",
00083 ReferenceCount::get_class_type());
00084 }
00085 virtual TypeHandle get_type() const {
00086 return get_class_type();
00087 }
00088
00089 private:
00090 static TypeHandle _type_handle;
00091
00092 friend class RecorderController;
00093 };
00094
00095 #include "recorderBase.I"
00096
00097 #endif
00098