42 #define READ_PTA(Manager, source, Read_func, array) \ 45 if ((t = Manager->get_pta(source)) == nullptr) \ 47 array = Read_func(Manager, source); \ 48 Manager->register_pta(array.get_void_ptr()); \ 52 array.set_void_ptr(t); \ 67 return get_class_type();
69 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
75 static void init_type() {
76 TypedReferenceCount::init_type();
78 TypedReferenceCount::get_class_type());
130 INLINE
const Filename &get_filename()
const;
133 INLINE
void set_loader_options(
const LoaderOptions &options);
138 INLINE
bool is_eof()
const;
143 INLINE
int get_file_major_ver()
const;
144 INLINE
int get_file_minor_ver()
const;
145 INLINE BamEndian get_file_endian()
const;
146 INLINE
bool get_file_stdfloat_double()
const;
148 INLINE
int get_current_major_ver()
const;
149 INLINE
int get_current_minor_ver()
const;
151 EXTENSION(PyObject *get_file_version()
const);
154 MAKE_PROPERTY(source, get_source, set_source);
155 MAKE_PROPERTY(filename, get_filename);
156 MAKE_PROPERTY(loader_options, get_loader_options, set_loader_options);
158 MAKE_PROPERTY(file_version, get_file_version);
159 MAKE_PROPERTY(file_endian, get_file_endian);
160 MAKE_PROPERTY(file_stdfloat_double, get_file_stdfloat_double);
175 void set_int_tag(
const std::string &tag,
int value);
176 int get_int_tag(
const std::string &tag)
const;
185 void register_change_this(ChangeThisFunc func,
TypedWritable *whom);
191 void register_pta(
void *ptr);
197 INLINE std::streampos get_file_pos();
200 INLINE
static void register_factory(
TypeHandle type, WritableFactory::CreateFunc *func,
201 void *user_data =
nullptr);
205 EXTENSION(
static void register_factory(
TypeHandle handle, PyObject *func));
208 INLINE
static void create_factory();
211 class PointerReference;
217 bool resolve_object_pointers(
TypedWritable *
object, PointerReference &pref);
218 bool resolve_cycler_pointers(
PipelineCyclerBase *cycler,
const vector_int &pointer_ids,
219 bool require_fully_complete);
222 INLINE
bool get_datagram(
Datagram &datagram);
240 bool _long_object_id;
245 typedef phash_map<int, TypeHandle, int_hash> IndexMap;
255 INLINE ~CreatedObj();
262 ChangeThisFunc _change_this;
263 ChangeThisRefFunc _change_this_ref;
265 typedef phash_map<int, CreatedObj, int_hash> CreatedObjs;
266 CreatedObjs _created_objs;
271 CreatedObjs::iterator _now_creating;
277 typedef phash_map<const TypedWritable *, vector_int, pointer_hash> CreatedObjsByPointer;
278 CreatedObjsByPointer _created_objs_by_pointer;
284 typedef phash_map<PipelineCyclerBase *, vector_int, pointer_hash> CyclerPointers;
287 class PointerReference {
290 CyclerPointers _cycler_pointers;
294 typedef phash_map<int, PointerReference, int_hash> ObjectPointers;
295 ObjectPointers _object_pointers;
300 int _num_extra_objects;
309 typedef phash_set<TypedWritable *, pointer_hash> Finalize;
310 Finalize _finalize_list;
314 typedef phash_map<int, void *, int_hash> PTAMap;
322 FileDataRecords _file_data_records;
327 typedef phash_set<TypeHandle> NewTypes;
328 static NewTypes _new_types;
331 typedef pmap<std::string, PT(AuxData)> AuxDataNames;
332 typedef phash_map<TypedWritable *, AuxDataNames, pointer_hash> AuxDataTable;
333 AuxDataTable _aux_data;
335 int _file_major, _file_minor;
336 BamEndian _file_endian;
337 bool _file_stdfloat_double;
338 static const int _cur_major;
339 static const int _cur_minor;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Keeps a reference-counted pointer to a file on disk.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the trivial, non-threaded implementation of PipelineCyclerBase.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The abstract base class for a file or directory within the VirtualFileSystem.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.