17INLINE BamReaderAuxData::
37 if (_source !=
nullptr) {
40 static const Filename empty_filename;
41 return empty_filename;
50 return _loader_options;
58 _loader_options = options;
67 nassertr(_source !=
nullptr,
true);
68 return _source->is_eof();
105 return _file_stdfloat_double;
134 nassertr(_source !=
nullptr,
nullptr);
144 nassertr(_source !=
nullptr,
nullptr);
158 nassertr(_source !=
nullptr, 0);
178 if (_factory ==
nullptr) {
187INLINE
void BamReader::
196INLINE
bool BamReader::
198 nassertr(_source !=
nullptr,
false);
199 if (_source->is_error()) {
203 if (!_source->get_datagram(datagram)) {
214INLINE BamReader::AuxData::
221INLINE BamReader::CreatedObj::
226 _change_this(nullptr),
227 _change_this_ref(nullptr)
234INLINE BamReader::CreatedObj::
236 set_ptr(
nullptr,
nullptr);
249INLINE
void BamReader::CreatedObj::
252 if (_ref_ptr !=
nullptr) {
253 nassertv(_ref_ptr != ref_ptr);
260 if (_ref_ptr !=
nullptr) {
264 nassertv(_ref_ptr == ref_ptr);
279 scan = param->get_iterator();
280 manager = param->get_manager();
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
The parameters that are passed through the Factory to any object constructing itself from a Bam file.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
bool is_eof() const
Returns true if the reader has reached end-of-file, false otherwise.
int get_current_minor_ver() const
Returns the minor version number of Bam files supported by the current code base.
const FileReference * get_file()
Returns the FileReference that provides the source for these datagrams, if any, or NULL if the datagr...
get_file_stdfloat_double
Returns true if the file stores all "standard" floats as 64-bit doubles, or false if they are 32-bit ...
get_source
Returns the current source of the BamReader as set by set_source() or the constructor.
int get_file_major_ver() const
Returns the major version number of the Bam file currently being read.
get_filename
If a BAM is a file, then the BamReader should contain the name of the file.
static void register_factory(TypeHandle type, WritableFactory::CreateFunc *func, void *user_data=nullptr)
Registers a factory function that is called when an object of the given type is encountered within th...
std::streampos get_file_pos()
Returns the current file position within the data stream, if any, or 0 if the file position is not me...
set_loader_options
Specifies the LoaderOptions for this BamReader.
VirtualFile * get_vfile()
Returns the VirtualFile that provides the source for these datagrams, if any, or NULL if the datagram...
get_loader_options
Returns the LoaderOptions passed to the loader when the model was requested, if any.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
get_file_endian
Returns the endian preference indicated by the Bam file currently being read.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
int get_current_major_ver() const
Returns the major version number of Bam files supported by the current code base.
This class defines the abstract interace to any source of datagrams, whether it be from a file or fro...
virtual std::streampos get_file_pos()
Returns the current file position within the data stream, if any, or 0 if the file position is not me...
virtual const FileReference * get_file()
Returns the FileReference that provides the source for these datagrams, if any, or NULL if the datagr...
virtual const Filename & get_filename()
Returns the filename that provides the source for these datagrams, if any, or empty string if the dat...
virtual VirtualFile * get_vfile()
Returns the VirtualFile that provides the source for these datagrams, if any, or NULL if the datagram...
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void set_stdfloat_double(bool stdfloat_double)
Changes the stdfloat_double flag, which defines the operation performed by add_stdfloat() and Datagra...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
FactoryParam * get_param(int n) const
Returns the nth parameter that has been added to the set.
A Factory can be used to create an instance of a particular subclass of some general base class.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
Keeps a reference-counted pointer to a file on disk.
The name of a file, such as a texture file or an Egg file.
Specifies parameters that may be passed to the loader.
A base class for all things that want to be reference-counted.
void ref() const
Explicitly increments the reference count.
TypeHandle is the identifier used to differentiate C++ class types.
Base class for objects that can be written to and read from Bam files.
The abstract base class for a file or directory within the VirtualFileSystem.
void unref_delete(RefCountType *ptr)
This global helper function will unref the given ReferenceCount object, and if the reference count re...