Panda3D
 All Classes Functions Variables Enumerations
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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

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(). More...
 
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. More...
 
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file. More...
 
- Public Member Functions inherited from TypedWritable
 TypedWritable (const TypedWritable &copy)
 
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More...
 
string encode_to_bam_stream () const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. More...
 
bool encode_to_bam_stream (string &data, BamWriter *writer=NULL) const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More...
 
virtual void finalize (BamReader *manager)
 Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed. More...
 
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter. More...
 
void mark_bam_modified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More...
 
void operator= (const TypedWritable &copy)
 
virtual bool require_fully_complete () const
 Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. More...
 
virtual void update_bam_nested (BamWriter *manager)
 Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates. More...
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
void operator= (const TypedObject &copy)
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
static void register_with_read_factory ()
 Tells the BamReader how to create objects of type Lens. More...
 
- Static Public Member Functions inherited from TypedWritable
static bool decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, const string &data, BamReader *reader=NULL)
 Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string. More...
 
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
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. More...
 

Public Attributes

Datagram _data
 
size_t _data_pos
 
int _frame
 
RecorderTable_table
 
bool _table_changed
 
double _timestamp
 

Additional Inherited Members

- Static Public Attributes inherited from TypedWritable
static TypedWritable *const Null = (TypedWritable*)0L
 

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 100 of file recorderFrame.cxx.

References TypedWritable::complete_pointers().

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 RecorderTable::play_frame().

Referenced by RecorderController::play_frame().

void RecorderFrame::register_with_read_factory ( )
static

Tells the BamReader how to create objects of type Lens.

Definition at line 46 of file recorderFrame.cxx.

References BamReader::get_factory(), 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 57 of file recorderFrame.cxx.

References Datagram::add_bool(), Datagram::add_float64(), Datagram::add_uint32(), RecorderTable::record_frame(), TypedWritable::write_datagram(), and BamWriter::write_pointer().


The documentation for this class was generated from the following files: