18 #include "pandabase.h"
21 #include "typedWritable.h"
22 #include "typedWritableReferenceCount.h"
23 #include "pointerTo.h"
24 #include "datagramGenerator.h"
25 #include "datagramIterator.h"
26 #include "bamReaderParam.h"
28 #include "subfileInfo.h"
29 #include "loaderOptions.h"
31 #include "vector_int.h"
36 #include "pipelineCyclerBase.h"
37 #include "referenceCount.h"
43 #define READ_PTA(Manager, source, Read_func, array) \
46 if ((t = Manager->get_pta(source)) == (void*)NULL) \
48 array = Read_func(Manager, source); \
49 Manager->register_pta(array.get_void_ptr()); \
53 array.set_void_ptr(t); \
70 return get_class_type();
72 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
78 static void init_type() {
79 TypedReferenceCount::init_type();
80 register_type(_type_handle,
"BamReaderAuxData",
81 TypedReferenceCount::get_class_type());
142 INLINE
const Filename &get_filename()
const;
145 INLINE
void set_loader_options(
const LoaderOptions &options);
150 INLINE
bool is_eof()
const;
155 INLINE
int get_file_major_ver()
const;
156 INLINE
int get_file_minor_ver()
const;
157 INLINE BamEndian get_file_endian()
const;
158 INLINE
bool get_file_stdfloat_double()
const;
160 INLINE
int get_current_major_ver()
const;
161 INLINE
int get_current_minor_ver()
const;
176 void set_int_tag(
const string &tag,
int value);
177 int get_int_tag(
const string &tag)
const;
186 void register_change_this(ChangeThisFunc func,
TypedWritable *whom);
192 void register_pta(
void *ptr);
198 INLINE streampos get_file_pos();
203 INLINE
static void create_factory();
206 class PointerReference;
212 bool resolve_object_pointers(
TypedWritable *
object, PointerReference &pref);
213 bool resolve_cycler_pointers(
PipelineCyclerBase *cycler,
const vector_int &pointer_ids,
214 bool require_fully_complete);
217 INLINE
bool get_datagram(
Datagram &datagram);
235 bool _long_object_id;
240 typedef phash_map<int, TypeHandle, int_hash> IndexMap;
250 INLINE ~CreatedObj();
257 ChangeThisFunc _change_this;
258 ChangeThisRefFunc _change_this_ref;
260 typedef phash_map<int, CreatedObj, int_hash> CreatedObjs;
261 CreatedObjs _created_objs;
266 CreatedObjs::iterator _now_creating;
272 typedef phash_map<const TypedWritable *, vector_int, pointer_hash> CreatedObjsByPointer;
273 CreatedObjsByPointer _created_objs_by_pointer;
279 typedef phash_map<PipelineCyclerBase *, vector_int, pointer_hash> CyclerPointers;
282 class PointerReference {
285 CyclerPointers _cycler_pointers;
289 typedef phash_map<int, PointerReference, int_hash> ObjectPointers;
290 ObjectPointers _object_pointers;
296 int _num_extra_objects;
305 typedef phash_set<TypedWritable *, pointer_hash> Finalize;
306 Finalize _finalize_list;
310 typedef phash_map<int, void *, int_hash> PTAMap;
318 FileDataRecords _file_data_records;
324 typedef phash_set<TypeHandle> NewTypes;
325 static NewTypes _new_types;
329 typedef phash_map<TypedWritable *, AuxDataNames, pointer_hash> AuxDataTable;
330 AuxDataTable _aux_data;
332 int _file_major, _file_minor;
333 BamEndian _file_endian;
334 bool _file_stdfloat_double;
335 static const int _cur_major;
336 static const int _cur_minor;
349 #include "bamReader.I"
Keeps a reference-counted pointer to a file on disk.
Stores auxiliary data that may be piggybacked on the BamReader during each object's read pass...
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.
This is the trivial, non-threaded implementation of PipelineCyclerBase.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
The abstract base class for a file or directory within the VirtualFileSystem.
The name of a file, such as a texture file or an Egg file.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
A base class for all things that want to be reference-counted.
This class records a particular byte sub-range within an existing file on disk.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
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 ...