The Micro C++ Library
|
The Datagram class implements an unrelated network packet for any unreliable transmission protocol (e.g. UDP). More...
#include <micxx.hxx>
Inherits micxx::Buffer.
Inherited by micxx::InetDatagram.
Public Member Functions | |
Datagram (std::size_t size=0) | |
Create an empty Datagram with initial size and capacity size. | |
Datagram (const Datagram &right) | |
Create a copy of Datagram right. | |
virtual | ~Datagram () |
Deallocate the addresses and the inherited Buffer. | |
virtual SocketAddress * | getDstAddress () |
The optionally available destination address this datagram was addressed to. | |
virtual const SocketAddress * | getDstAddress () const |
The const version of getDstAddress(). | |
virtual SocketAddress * | getSrcAddress () |
The optionally available source address this datagram was sent from. | |
virtual const SocketAddress * | getSrcAddress () const |
The const version of getSrcAddress(). | |
virtual unsigned long long | getTimestamp () const |
The timestamp in milli seconds set by setTimestamp(unsigned long long). | |
virtual Datagram & | operator= (const Datagram &right) |
Make this a copy of Datagram right . | |
virtual void | setDstAddress (const SocketAddress *adstAddress) |
(Re)set the destination address of this Datagram. | |
virtual void | setSrcAddress (const SocketAddress *asrcAddress) |
(Re)set the source address of this Datagram. | |
virtual void | setTimestamp (unsigned long long millis) |
(Re)set the timestamp for this Datagram. | |
virtual std::string | toString () const |
A string representation describing this Datagram. |
The Datagram class implements an unrelated network packet for any unreliable transmission protocol (e.g. UDP).
A Datagram is a Buffer that optionally may have a source and destination address and a timestamp.
micxx::Datagram::Datagram | ( | std::size_t | size = 0 | ) |
Create an empty Datagram with initial size and capacity size.
size | The initial size and capacity. |
micxx::Datagram::Datagram | ( | const Datagram & | right | ) |
virtual micxx::Datagram::~Datagram | ( | ) | [virtual] |
Deallocate the addresses and the inherited Buffer.
virtual SocketAddress* micxx::Datagram::getDstAddress | ( | ) | [virtual] |
The optionally available destination address this datagram was addressed to.
0
otherwise. virtual const SocketAddress* micxx::Datagram::getDstAddress | ( | ) | const [virtual] |
The const
version of getDstAddress().
virtual const SocketAddress* micxx::Datagram::getSrcAddress | ( | ) | const [virtual] |
The const
version of getSrcAddress().
virtual SocketAddress* micxx::Datagram::getSrcAddress | ( | ) | [virtual] |
The optionally available source address this datagram was sent from.
0
otherwise. virtual unsigned long long micxx::Datagram::getTimestamp | ( | ) | const [virtual] |
The timestamp in milli seconds set by setTimestamp(unsigned long long).
0
otherwise. virtual void micxx::Datagram::setDstAddress | ( | const SocketAddress * | adstAddress | ) | [virtual] |
(Re)set the destination address of this Datagram.
adstAddress | The address to be stored (as a copy), or 0 to reset the destination address to 0 . |
Reimplemented in micxx::InetDatagram.
virtual void micxx::Datagram::setSrcAddress | ( | const SocketAddress * | asrcAddress | ) | [virtual] |
(Re)set the source address of this Datagram.
asrcAddress | The address to be stored (as a copy), or 0 to reset the source address to 0 . |
Reimplemented in micxx::InetDatagram.
virtual void micxx::Datagram::setTimestamp | ( | unsigned long long | millis | ) | [virtual] |
(Re)set the timestamp for this Datagram.
millis | the timestamp in milli seconds to be stored |
virtual std::string micxx::Datagram::toString | ( | ) | const [virtual] |
A string representation describing this Datagram.
Reimplemented from micxx::Buffer.