Go to the documentation of this file.
25 _events.reserve(_events.size() + other._events.size());
26 Events::const_iterator ei;
27 for (ei = other._events.begin(); ei != other._events.end(); ++ei) {
28 _events.push_back(*ei);
38 Events::const_iterator ei;
39 for (ei = _events.begin(); ei != _events.end(); ++ei) {
40 (*ei).update_mods(mods);
47 void ButtonEventList::
48 output(std::ostream &out)
const {
49 if (_events.empty()) {
50 out <<
"(no buttons)";
52 Events::const_iterator ei;
56 while (ei != _events.end()) {
67 void ButtonEventList::
68 write(std::ostream &out,
int indent_level)
const {
69 indent(out, indent_level) << _events.size() <<
" events:\n";
70 Events::const_iterator ei;
71 for (ei = _events.begin(); ei != _events.end(); ++ei) {
72 indent(out, indent_level + 2) << (*ei) <<
"\n";
93 Events::const_iterator ei;
94 for (ei = _events.begin(); ei != _events.end(); ++ei) {
95 (*ei).write_datagram(dg);
111 list->
fillin(scan, manager);
130 _events.reserve(num_events);
131 for (
int i = 0; i < num_events; i++) {
134 _events.push_back(event);
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
A class to retrieve the individual data elements previously stored in a Datagram.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
Base class for objects that can be written to and read from Bam files.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
TypeHandle is the identifier used to differentiate C++ class types.
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
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 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.
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...
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...