This object represents one frame of data in the recorded session file. More...
#include "recorderFrame.h"
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 ©) | |
virtual ReferenceCount * | as_reference_count () |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More... | |
vector_uchar | encode_to_bam_stream () const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object. More... | |
bool | encode_to_bam_stream (vector_uchar &data, BamWriter *writer=nullptr) 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 ©) |
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 ©)=default | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_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... | |
TypedObject & | operator= (const TypedObject ©)=default |
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, vector_uchar data, BamReader *reader=nullptr) |
Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts the single object on those bytes. 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 |
Public Attributes inherited from TypedObject | |
get_type | |
Additional Inherited Members | |
Static Public Attributes inherited from TypedWritable | |
static TypedWritable *const | Null = nullptr |
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 32 of file recorderFrame.h.
|
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 83 of file recorderFrame.cxx.
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 27 of file recorderFrame.cxx.
References RecorderTable::play_frame().
Referenced by RecorderController::play_frame().
|
static |
Tells the BamReader how to create objects of type Lens.
Definition at line 39 of file recorderFrame.cxx.
References BamReader::get_factory(), and Factory< Type >::register_factory().
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from TypedWritable.
Definition at line 48 of file recorderFrame.cxx.
References Datagram::add_bool(), Datagram::add_float64(), Datagram::add_uint32(), RecorderTable::record_frame(), TypedWritable::write_datagram(), and BamWriter::write_pointer().