17 INLINE BamReaderAuxData::
36 get_filename()
const {
37 if (_source !=
nullptr) {
40 static const Filename empty_filename;
41 return empty_filename;
49 get_loader_options()
const {
50 return _loader_options;
58 _loader_options = options;
67 nassertr(_source !=
nullptr,
true);
68 return _source->is_eof();
93 INLINE BamReader::BamEndian BamReader::
94 get_file_endian()
const {
103 INLINE
bool BamReader::
104 get_file_stdfloat_double()
const {
105 return _file_stdfloat_double;
134 nassertr(_source !=
nullptr,
nullptr);
144 nassertr(_source !=
nullptr,
nullptr);
158 nassertr(_source !=
nullptr, 0);
178 if (_factory ==
nullptr) {
187 INLINE
void BamReader::
196 INLINE
bool BamReader::
198 nassertr(_source !=
nullptr,
false);
199 if (_source->is_error()) {
203 if (!_source->get_datagram(datagram)) {
214 INLINE BamReader::AuxData::
221 INLINE BamReader::CreatedObj::
226 _change_this(nullptr),
227 _change_this_ref(nullptr)
234 INLINE BamReader::CreatedObj::
236 set_ptr(
nullptr,
nullptr);
249 INLINE
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();
Keeps a reference-counted pointer to a file on disk.
A Factory can be used to create an instance of a particular subclass of some general base class.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Specifies parameters that may be passed to the loader.
Base class for objects that can be written to and read from Bam files.
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 abstract base class for a file or directory within the VirtualFileSystem.
FactoryParam * get_param(int n) const
Returns the nth parameter that has been added to the set.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
set_loader_options
Specifies the LoaderOptions for this BamReader.
int get_file_major_ver() const
Returns the major version number of the Bam file currently being read.
void set_stdfloat_double(bool stdfloat_double)
Changes the stdfloat_double flag, which defines the operation performed by add_stdfloat() and Datagra...
The name of a file, such as a texture file or an Egg file.
virtual const FileReference * get_file()
Returns the FileReference that provides the source for these datagrams, if any, or NULL if the datagr...
const FileReference * get_file()
Returns the FileReference that provides the source for these datagrams, if any, or NULL if the datagr...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
virtual VirtualFile * get_vfile()
Returns the VirtualFile that provides the source for these datagrams, if any, or NULL if the datagram...
void ref() const
Explicitly increments the reference count.
int get_current_minor_ver() const
Returns the minor version number of Bam files supported by the current code base.
A base class for all things that want to be reference-counted.
VirtualFile * get_vfile()
Returns the VirtualFile that provides the source for these datagrams, if any, or NULL if the datagram...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
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...
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...
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
The parameters that are passed through the Factory to any object constructing itself from a Bam file.
This class defines the abstract interace to any source of datagrams, whether it be from a file or fro...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void unref_delete(RefCountType *ptr)
This global helper function will unref the given ReferenceCount object, and if the reference count re...
virtual const Filename & get_filename()
Returns the filename that provides the source for these datagrams, if any, or empty string if the dat...
bool is_eof() const
Returns true if the reader has reached end-of-file, false otherwise.
int get_current_major_ver() const
Returns the major version number of Bam files supported by the current code base.
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...