Panda3D
|
This represents the in-memory index that records the list of files stored in the BamCache. More...
#include "bamCacheIndex.h"
Public Member Functions | |
virtual TypeHandle | force_init_type () |
virtual TypeHandle | get_type () const |
void | write (ostream &out, int indent_level=0) 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 BamCacheRecord. | |
Protected Member Functions | |
virtual int | complete_pointers (TypedWritable **plist, BamReader *manager) |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). | |
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 BamCacheIndex. | |
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 BamCacheIndex is encountered in the Bam file. | |
Friends | |
class | BamCache |
This represents the in-memory index that records the list of files stored in the BamCache.
Since the memory is also flushed to disk from time to time, this class is a TypedWritable object.
For the most part, this class is used only by the BamCache class.
Definition at line 37 of file bamCacheIndex.h.
int BamCacheIndex::complete_pointers | ( | TypedWritable ** | p_list, |
BamReader * | manager | ||
) | [protected, virtual] |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
Returns the number of pointers processed.
Reimplemented from TypedWritable.
Definition at line 247 of file bamCacheIndex.cxx.
References BamCacheRecord::get_source_pathname().
void BamCacheIndex::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 BamCacheIndex.
Reimplemented from TypedWritable.
Definition at line 278 of file bamCacheIndex.cxx.
References DatagramIterator::get_uint32(), and BamReader::read_pointer().
static void BamCacheIndex::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 77 of file bamCacheIndex.h.
References TypedWritable::init_type().
TypedWritable * BamCacheIndex::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type BamCacheIndex is encountered in the Bam file.
It should create the BamCacheIndex and extract its information from the file.
Definition at line 228 of file bamCacheIndex.cxx.
Referenced by register_with_read_factory().
void BamCacheIndex::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type BamCacheRecord.
Definition at line 198 of file bamCacheIndex.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
void BamCacheIndex::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 209 of file bamCacheIndex.cxx.
References Datagram::add_uint32(), and BamWriter::write_pointer().