hamcast  Version 0.7
Public Member Functions | List of all members
hamcast::multicast_packet Class Reference

#include <multicast_packet.hpp>

Public Member Functions

 multicast_packet ()
 
 multicast_packet (const uri &source, boost::uint32_t size, void *buf)
 
const urifrom () const
 
const void * data () const
 
boost::uint32_t size () const
 
bool empty () const
 

Detailed Description

Describes a received multicast packet.

Examples:
simple_receiver.cpp.

Constructor & Destructor Documentation

hamcast::multicast_packet::multicast_packet ( )

Construct an empty multicast packet.

hamcast::multicast_packet::multicast_packet ( const uri source,
boost::uint32_t  size,
void *  buf 
)

Construct a new multicast packet.

Parameters
sourcethe source of this packet
sizethe size of buf
bufthe data of this packet
Warning
multicast_packet takes ownership of buf.

Member Function Documentation

const void * hamcast::multicast_packet::data ( ) const

Get the content/data of the packet.

Returns
A pointer to the internal C-buffer.
Examples:
simple_receiver.cpp.
bool hamcast::multicast_packet::empty ( ) const

Check if this packet is empty.

Returns
true if size() == 0; otherwise false.
const uri & hamcast::multicast_packet::from ( ) const

Get the source of this packet.

Returns
The source group as uri object.
boost::uint32_t hamcast::multicast_packet::size ( ) const

Get the size of data().

Returns
The size of data() in bytes.
Examples:
simple_receiver.cpp.

The documentation for this class was generated from the following files: