14#ifndef DATAGRAMBUFFER_H
15#define DATAGRAMBUFFER_H
40 virtual void flush()
override;
42 bool read_header(std::string &header,
size_t num_bytes);
44 virtual bool is_eof()
override;
48 INLINE
const vector_uchar &
get_data()
const;
49 INLINE
void set_data(vector_uchar data);
50 INLINE
void swap_data(vector_uchar &other);
58 bool _wrote_first_datagram;
59 bool _read_first_datagram;
virtual bool is_error() override
Returns true if the buffer has reached an error condition.
bool read_header(std::string &header, size_t num_bytes)
Reads a sequence of bytes from the beginning of the datagram file.
set_data
Replaces the data in the internal buffer.
virtual bool put_datagram(const Datagram &data) override
Writes the given datagram to the file.
virtual bool get_datagram(Datagram &data) override
Reads the next datagram from the file.
void clear()
Clears the internal buffer.
virtual void flush() override
This does absolutely nothing.
get_data
Returns the internal buffer.
bool write_header(const std::string &header)
Writes a sequence of bytes to the beginning of the datagram file.
void swap_data(vector_uchar &other)
Swaps the data in the internal buffer with that of the other buffer.
DatagramBuffer()
Initializes an empty datagram buffer.
virtual bool is_eof() override
Returns true if the buffer has reached the end-of-buffer.
DatagramGenerator()
Does nothing since this is class is just the definition of an interface.
DatagramSink()
Does nothing since this is class is just the definition of an interface.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.