15 #include "socketStreamRecorder.h" 16 #include "recorderController.h" 17 #include "bamReader.h" 18 #include "bamWriter.h" 33 bool SocketStreamRecorder::
49 bool got_data =
false;
50 if (_stream != (SocketStream *)NULL) {
51 got_data = _stream->receive_datagram(dg);
54 if (got_data && is_recording()) {
71 void SocketStreamRecorder::
73 nassertv(is_recording());
76 for (Data::iterator di = _data.begin(); di != _data.end(); ++di) {
89 void SocketStreamRecorder::
91 nassertv(is_playing());
95 for (
int i = 0; i < num_packets; i++) {
107 void SocketStreamRecorder::
108 register_with_read_factory() {
122 void SocketStreamRecorder::
136 SocketStreamRecorder *node =
new SocketStreamRecorder;
140 parse_params(params, scan, manager);
141 node->fillin_recorder(scan, manager);
153 void SocketStreamRecorder::
155 RecorderBase::fillin_recorder(scan, manager);
158 #endif // HAVE_OPENSSL bool get_bool()
Extracts a boolean value.
void add_string(const string &str)
Adds a variable-length string to the datagram.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
static RecorderFactory * get_factory()
Returns the global RecorderFactory for generating TypedWritable objects.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
string get_string()
Extracts a variable-length string.
PN_uint16 get_uint16()
Extracts an unsigned 16-bit integer.
void add_bool(bool value)
Adds a boolean value to the datagram.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This is the base class to a number of objects that record particular kinds of user input (like a Mous...
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.
virtual void write_recorder(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for encoding in the session 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 ...