29 bool SocketStreamRecorder::
44 bool got_data =
false;
45 if (_stream !=
nullptr) {
46 got_data = _stream->receive_datagram(dg);
49 if (got_data && is_recording()) {
63 void SocketStreamRecorder::
65 nassertv(is_recording());
68 for (Data::iterator di = _data.begin(); di != _data.end(); ++di) {
78 void SocketStreamRecorder::
80 nassertv(is_playing());
84 for (
int i = 0; i < num_packets; i++) {
92 void SocketStreamRecorder::
93 register_with_read_factory() {
104 void SocketStreamRecorder::
115 SocketStreamRecorder *node =
new SocketStreamRecorder;
120 node->fillin_recorder(scan, manager);
129 void SocketStreamRecorder::
131 RecorderBase::fillin_recorder(scan, manager);
134 #endif // HAVE_OPENSSL bool get_bool()
Extracts a boolean value.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 ...
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,...
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
void add_bool(bool value)
Adds a boolean value to the datagram.
void add_string(const std::string &str)
Adds a variable-length string to the datagram.
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.
This is the base class to a number of objects that record particular kinds of user input (like a Mous...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_recorder(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for encoding in the session file.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
vector_uchar get_blob()
Extracts a variable-length binary blob.
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.