15 #include "buttonEventList.h"
16 #include "modifierButtons.h"
29 _events.reserve(_events.size() + other._events.size());
30 Events::const_iterator ei;
31 for (ei = other._events.begin(); ei != other._events.end(); ++ei) {
32 _events.push_back(*ei);
45 Events::const_iterator ei;
46 for (ei = _events.begin(); ei != _events.end(); ++ei) {
47 (*ei).update_mods(mods);
56 void ButtonEventList::
57 output(ostream &out)
const {
58 if (_events.empty()) {
59 out <<
"(no buttons)";
61 Events::const_iterator ei;
65 while (ei != _events.end()) {
78 void ButtonEventList::
79 write(ostream &out,
int indent_level)
const {
80 indent(out, indent_level) << _events.size() <<
" events:\n";
81 Events::const_iterator ei;
82 for (ei = _events.begin(); ei != _events.end(); ++ei) {
83 indent(out, indent_level + 2) << (*ei) <<
"\n";
109 Events::const_iterator ei;
110 for (ei = _events.begin(); ei != _events.end(); ++ei) {
111 (*ei).write_datagram(dg);
129 parse_params(params, scan, manager);
130 list->
fillin(scan, manager);
153 _events.reserve(num_events);
154 for (
int i = 0; i < num_events; i++) {
157 _events.push_back(event);
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Base class for objects that can be written to and read from Bam files.
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...
PN_uint16 get_uint16()
Extracts an unsigned 16-bit integer.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
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)
Registers a new kind of thing the Factory will be able to create.
void add_uint16(PN_uint16 value)
Adds an unsigned 16-bit integer to the datagram.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
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 ...