|
|
|
The principle public interface to reading and writing Bam disk files.
More...
#include "bamFile.h"
List of all members.
Public Member Functions |
| void | close () |
| | Closes the input or output stream.
|
| int | get_current_major_ver () |
| | Returns the system current major version number.
|
| int | get_current_minor_ver () |
| | Returns the system current minor version number.
|
| BamEndian | get_file_endian () const |
| | Returns the endian preference indicated by the Bam file currently being read or written.
|
| int | get_file_major_ver () |
| | Returns the major version number of the file currently being read, or the system current major version number if no file is currently open for reading.
|
| int | get_file_minor_ver () |
| | Returns the minor version number of the file currently being read, or the system current minor version number if no file is currently open for reading.
|
| BamReader * | get_reader () |
| | Returns the BamReader in charge of performing the read operations.
|
| BamWriter * | get_writer () |
| | Returns the BamWriter in charge of performing the write operations.
|
| bool | is_eof () const |
| | Returns true if the reader has reached end-of-file, false otherwise.
|
| bool | is_valid_read () const |
| | Returns true if the Bam file is open and ready for reading with no errors so far detected, or false otherwise.
|
| bool | is_valid_write () const |
| | Returns true if the Bam file is open and ready for writing with no errors so far detected, or false otherwise.
|
| bool | open_read (istream &in, const string &bam_filename="stream", bool report_errors=true) |
| | Attempts to open the indicated stream for reading.
|
| bool | open_read (const Filename &bam_filename, bool report_errors=true) |
| | Attempts to open the indicated filename for reading.
|
| bool | open_write (ostream &out, const string &bam_filename="stream", bool report_errors=true) |
| | Attempts to open the indicated stream for writing.
|
| bool | open_write (const Filename &bam_filename, bool report_errors=true) |
| | Attempts to open the indicated file for writing.
|
|
| PT (PandaNode) read_node(bool report_errors |
| TypedWritable * | read_object () |
| | Reads and returns the next object from the Bam file, or NULL if the end of the file has been reached, or if there is an error condition.
|
| bool | resolve () |
| | This must be called after one or more objects have been read via calls to read_object() in order to resolve all internal pointer references in the objects read and make all the pointers valid.
|
| bool | write_object (const TypedWritable *object) |
| | Writes the indicated object to the Bam file.
|
Detailed Description
The principle public interface to reading and writing Bam disk files.
See also BamReader and BamWriter, the more general implementation of this class.
Bam files are most often used to store scene graphs or subgraphs, and by convention they are given filenames ending in the extension ".bam" when they are used for this purpose. However, a Bam file may store any arbitrary list of TypedWritable objects; in this more general usage, they are given filenames ending in ".boo" to differentiate them from the more common scene graph files.
Definition at line 45 of file bamFile.h.
Member Function Documentation
| int BamFile::get_current_major_ver |
( |
| ) |
|
Returns the system current major version number.
This is the version number that will be assigned to any generated Bam files.
Definition at line 354 of file bamFile.cxx.
| int BamFile::get_current_minor_ver |
( |
| ) |
|
Returns the system current minor version number.
This is the version number that will be assigned to any generated Bam files.
Definition at line 366 of file bamFile.cxx.
| BamFile::BamEndian BamFile::get_file_endian |
( |
| ) |
const |
| int BamFile::get_file_major_ver |
( |
| ) |
|
Returns the major version number of the file currently being read, or the system current major version number if no file is currently open for reading.
Definition at line 305 of file bamFile.cxx.
References BamReader::get_file_major_ver().
| int BamFile::get_file_minor_ver |
( |
| ) |
|
Returns the minor version number of the file currently being read, or the system current minor version number if no file is currently open for reading.
Definition at line 321 of file bamFile.cxx.
References BamReader::get_file_minor_ver().
| bool BamFile::is_eof |
( |
| ) |
const |
| bool BamFile::is_valid_read |
( |
| ) |
const [inline] |
Returns true if the Bam file is open and ready for reading with no errors so far detected, or false otherwise.
Definition at line 24 of file bamFile.I.
| bool BamFile::is_valid_write |
( |
| ) |
const [inline] |
Returns true if the Bam file is open and ready for writing with no errors so far detected, or false otherwise.
Definition at line 37 of file bamFile.I.
| bool BamFile::open_read |
( |
const Filename & |
bam_filename, |
|
|
bool |
report_errors = true |
|
) |
| |
| bool BamFile::open_read |
( |
istream & |
in, |
|
|
const string & |
bam_filename = "stream", |
|
|
bool |
report_errors = true |
|
) |
| |
Attempts to open the indicated stream for reading.
The filename is just for information purposes only. Returns true if successful, false on error.
Definition at line 77 of file bamFile.cxx.
References close(), and DatagramInputFile::open().
| bool BamFile::open_write |
( |
const Filename & |
bam_filename, |
|
|
bool |
report_errors = true |
|
) |
| |
| bool BamFile::open_write |
( |
ostream & |
out, |
|
|
const string & |
bam_filename = "stream", |
|
|
bool |
report_errors = true |
|
) |
| |
Attempts to open the indicated stream for writing.
The filename is just for information purposes only. Returns true if successful, false on error.
Definition at line 244 of file bamFile.cxx.
References close(), and DatagramOutputFile::open().
Reads and returns the next object from the Bam file, or NULL if the end of the file has been reached, or if there is an error condition.
Use is_eof() to differentiate these two cases.
The pointers returned by this method will not be valid for use until resolve() is subsequently called.
Definition at line 99 of file bamFile.cxx.
References BamReader::read_object().
| bool BamFile::resolve |
( |
| ) |
|
This must be called after one or more objects have been read via calls to read_object() in order to resolve all internal pointer references in the objects read and make all the pointers valid.
It returns true if all objects are successfully resolved, or false if some have not been (in which case you must call resolve() again later).
Definition at line 131 of file bamFile.cxx.
References BamReader::resolve().
The documentation for this class was generated from the following files:
| | |