Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions
RecorderFrame Class Reference

This object represents one frame of data in the recorded session file. More...

#include "recorderFrame.h"

Inheritance diagram for RecorderFrame:
TypedWritable TypedObject MemoryBase

List of all members.

Public Member Functions

 RecorderFrame (double timestamp, int frame, bool table_changed, RecorderTable *table)
virtual int complete_pointers (TypedWritable **plist, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
virtual TypeHandle force_init_type ()
virtual TypeHandle get_type () const
void play_frame (BamReader *manager)
 Once the raw data has been read in from the session file, and the table has been decoded, decode the raw data and call play_frame on each recorder.
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.
static void register_with_read_factory ()
 Tells the BamReader how to create objects of type Lens.

Public Attributes

Datagram _data
size_t _data_pos
int _frame
RecorderTable_table
bool _table_changed
double _timestamp

Protected Member Functions

void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new RecorderFrame.

Static Protected Member Functions

static TypedWritablemake_from_bam (const FactoryParams &params)
 This function is called by the BamReader's factory when a new object of type Lens is encountered in the Bam file.

Detailed Description

This object represents one frame of data in the recorded session file.

One of these is repeatedly created and destructed in recording and playback, respectively.

Definition at line 35 of file recorderFrame.h.


Member Function Documentation

int RecorderFrame::complete_pointers ( TypedWritable **  p_list,
BamReader manager 
) [virtual]

Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

Returns the number of pointers processed.

This is the callback function that is made by the BamReader at some later point, after all of the required pointers have been filled in. It is necessary because there might be forward references in a bam file; when we call read_pointer() in fillin(), the object may not have been read from the file yet, so we do not have a pointer available at that time. Thus, instead of returning a pointer, read_pointer() simply reserves a later callback. This function provides that callback. The calling object is responsible for keeping track of the number of times it called read_pointer() and extracting the same number of pointers out of the supplied vector, and storing them appropriately within the object.

Reimplemented from TypedWritable.

Definition at line 113 of file recorderFrame.cxx.

void RecorderFrame::fillin ( DatagramIterator scan,
BamReader manager 
) [protected, virtual]

This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new RecorderFrame.

Reimplemented from TypedWritable.

Definition at line 151 of file recorderFrame.cxx.

References DatagramIterator::get_bool(), DatagramIterator::get_current_index(), DatagramIterator::get_datagram(), DatagramIterator::get_float64(), DatagramIterator::get_uint32(), and BamReader::read_pointer().

Referenced by make_from_bam().

static void RecorderFrame::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from TypedWritable.

Definition at line 68 of file recorderFrame.h.

References TypedWritable::init_type().

TypedWritable * RecorderFrame::make_from_bam ( const FactoryParams params) [static, protected]

This function is called by the BamReader's factory when a new object of type Lens is encountered in the Bam file.

It should create the Lens and extract its information from the file.

Definition at line 132 of file recorderFrame.cxx.

References fillin().

Referenced by register_with_read_factory().

void RecorderFrame::play_frame ( BamReader manager)

Once the raw data has been read in from the session file, and the table has been decoded, decode the raw data and call play_frame on each recorder.

Definition at line 31 of file recorderFrame.cxx.

References DatagramIterator::get_remaining_size(), and RecorderBase::play_frame().

Referenced by RecorderController::play_frame().

Tells the BamReader how to create objects of type Lens.

Definition at line 53 of file recorderFrame.cxx.

References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().

void RecorderFrame::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual]

Writes the contents of this object to the datagram for shipping out to a Bam file.

Reimplemented from TypedWritable.

Definition at line 64 of file recorderFrame.cxx.

References Datagram::add_bool(), Datagram::add_float64(), Datagram::add_uint32(), RecorderBase::record_frame(), and BamWriter::write_pointer().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations