Panda3D
 All Classes Functions Variables Enumerations
recorderHeader.h
1 // Filename: recorderHeader.h
2 // Created by: drose (29Jan04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef RECORDERHEADER_H
16 #define RECORDERHEADER_H
17 
18 #include "pandabase.h"
19 #include "recorderBase.h"
20 #include "typedWritable.h"
21 
22 #include <time.h>
23 
24 class BamWriter;
25 class BamReader;
26 class FactoryParams;
27 
28 ////////////////////////////////////////////////////////////////////
29 // Class : RecorderHeader
30 // Description : This object contains the header information written
31 // out at the beginning of a recorded session file.
32 ////////////////////////////////////////////////////////////////////
33 class EXPCL_PANDA_RECORDER RecorderHeader : public TypedWritable {
34 public:
35  INLINE RecorderHeader();
36  INLINE RecorderHeader(const RecorderHeader &copy);
37  INLINE void operator = (const RecorderHeader &copy);
38  INLINE ~RecorderHeader();
39 
40  time_t _start_time;
41  int _random_seed;
42 
43 public:
44  static void register_with_read_factory();
45  virtual void write_datagram(BamWriter *manager, Datagram &dg);
46 
47 protected:
48  static TypedWritable *make_from_bam(const FactoryParams &params);
49  void fillin(DatagramIterator &scan, BamReader *manager);
50 
51 public:
52  static TypeHandle get_class_type() {
53  return _type_handle;
54  }
55  static void init_type() {
56  TypedWritable::init_type();
57  register_type(_type_handle, "RecorderHeader",
58  TypedWritable::get_class_type());
59  }
60  virtual TypeHandle get_type() const {
61  return get_class_type();
62  }
63  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
64 
65 private:
66  static TypeHandle _type_handle;
67 };
68 
69 #include "recorderHeader.I"
70 
71 #endif
72 
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class&#39;s make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
This object contains the header information written out at the beginning of a recorded session file...
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43