34 _is_registered(false),
35 _transforms(copy._transforms)
44 nassertv(!_is_registered);
45 _transforms = copy._transforms;
63 nassertv(!_is_registered);
64 nassertv(n < _transforms.size());
65 _transforms[n] = transform;
78 nassertv(!_is_registered);
79 if (n > _transforms.size()) {
80 n = _transforms.size();
82 _transforms.insert(_transforms.begin() + n, transform);
90 nassertv(!_is_registered);
91 nassertv(n < _transforms.size());
92 _transforms.erase(_transforms.begin() + n);
104 nassertr(!_is_registered, -1);
105 size_t new_index = _transforms.size();
106 _transforms.push_back(transform);
113 void TransformTable::
114 write(std::ostream &out)
const {
115 for (
size_t i = 0; i < _transforms.size(); ++i) {
116 out << i <<
". " << *_transforms[i] <<
"\n";
123 void TransformTable::
125 nassertv(!_is_registered);
127 Transforms::iterator ti;
128 for (ti = _transforms.begin(); ti != _transforms.end(); ++ti) {
130 bool inserted = transform->_tables.insert(
this).second;
133 _is_registered =
true;
140 void TransformTable::
142 nassertv(_is_registered);
144 Transforms::iterator ti;
145 for (ti = _transforms.begin(); ti != _transforms.end(); ++ti) {
147 transform->_tables.erase(
this);
149 _is_registered =
false;
169 for (Transforms::const_iterator ti = _transforms.begin();
170 ti != _transforms.end();
186 for (Transforms::iterator ti = _transforms.begin();
187 ti != _transforms.end();
207 object->fillin(scan, manager);
216 void TransformTable::
221 _transforms.reserve(num_transforms);
222 for (
size_t i = 0; i < num_transforms; ++i) {
224 _transforms.push_back(
nullptr);
235 return new CData(*
this);
242 void TransformTable::CData::
250 void TransformTable::CData::
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
void read_cdata(DatagramIterator &scan, PipelineCyclerBase &cycler)
Reads in the indicated CycleData object.
A single page of data maintained by a PipelineCycler.
Base class for objects that can be written to and read from Bam files.
void write_cdata(Datagram &packet, const PipelineCyclerBase &cycler)
Writes out the indicated CycleData object.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
get_current_thread
Returns a pointer to the currently-executing Thread object.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
A thread; that is, a lightweight process.
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
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.
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.