Panda3D
|
This object is used by the RecorderController to write (and read) a record of the set of recorders in use to the bam file. More...
#include "recorderTable.h"
Public Types | |
typedef pmap< string, PT(RecorderBase) > | Recorders |
Public Member Functions | |
RecorderTable (const RecorderTable ©) | |
void | add_recorder (const string &name, RecorderBase *recorder) |
Adds the named recorder to the set of recorders. | |
virtual TypeHandle | force_init_type () |
RecorderBase * | get_recorder (const string &name) const |
Returns the recorder with the indicated name, or NULL if there is no such recorder. | |
virtual TypeHandle | get_type () const |
void | merge_from (const RecorderTable &other) |
Combines the data in the current table (presumably just read from disk, and matching exactly with the disk data) with the data in the indicated table, specified by the user (which may not exactly match the disk data). | |
void | operator= (const RecorderTable ©) |
bool | remove_recorder (const string &name) |
Removes the named recorder from the table. | |
void | write (ostream &out, int indent_level) const |
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 | |
bool | _error |
Recorders | _recorders |
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 RecorderTable. | |
Static Protected Member Functions | |
static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type Lens is encountered in the Bam file. |
This object is used by the RecorderController to write (and read) a record of the set of recorders in use to the bam file.
Do not attempt to use it directly.
Definition at line 35 of file recorderTable.h.
void RecorderTable::add_recorder | ( | const string & | name, |
RecorderBase * | recorder | ||
) |
Adds the named recorder to the set of recorders.
Definition at line 79 of file recorderTable.cxx.
Referenced by RecorderController::add_recorder().
void RecorderTable::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 RecorderTable.
Reimplemented from TypedWritable.
Definition at line 194 of file recorderTable.cxx.
References RecorderController::get_factory(), DatagramIterator::get_string(), DatagramIterator::get_uint16(), and BamReader::read_handle().
Referenced by make_from_bam().
RecorderBase * RecorderTable::get_recorder | ( | const string & | name | ) | const |
Returns the recorder with the indicated name, or NULL if there is no such recorder.
Definition at line 90 of file recorderTable.cxx.
Referenced by RecorderController::get_recorder(), RecorderController::has_recorder(), and RecorderController::remove_recorder().
static void RecorderTable::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 recorderTable.h.
References TypedWritable::init_type().
TypedWritable * RecorderTable::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 175 of file recorderTable.cxx.
References fillin().
Referenced by register_with_read_factory().
void RecorderTable::merge_from | ( | const RecorderTable & | other | ) |
Combines the data in the current table (presumably just read from disk, and matching exactly with the disk data) with the data in the indicated table, specified by the user (which may not exactly match the disk data).
Definition at line 34 of file recorderTable.cxx.
Referenced by RecorderController::play_frame().
void RecorderTable::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type Lens.
Definition at line 141 of file recorderTable.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
bool RecorderTable::remove_recorder | ( | const string & | name | ) |
Removes the named recorder from the table.
Returns true if successful, false if there was no such recorder.
Definition at line 106 of file recorderTable.cxx.
Referenced by RecorderController::remove_recorder().
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from TypedWritable.
Definition at line 152 of file recorderTable.cxx.
References Datagram::add_string(), Datagram::add_uint16(), BamWriter::write_handle(), and RecorderBase::write_recorder().