\section{KNetwork::KDatagram\-Packet Class Reference}
\label{classKNetwork_1_1KDatagramPacket}\index{KNetwork::KDatagramPacket@{KNetwork::KDatagramPacket}}
one datagram  


{\tt \#include $<$kdatagramsocket.h$>$}

Collaboration diagram for KNetwork::KDatagram\-Packet:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=130pt]{classKNetwork_1_1KDatagramPacket__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KDatagram\-Packet} ()
\item 
{\bf KDatagram\-Packet} (const {\bf QByte\-Array} \&content)
\item 
{\bf KDatagram\-Packet} (const char $\ast$content, uint length)
\item 
{\bf KDatagram\-Packet} (const {\bf QByte\-Array} \&content, const {\bf KSocket\-Address} \&addr)
\item 
{\bf KDatagram\-Packet} (const char $\ast$content, uint length, const {\bf KSocket\-Address} \&addr)
\item 
{\bf KDatagram\-Packet} (const {\bf KDatagram\-Packet} \&other)
\item 
{\bf $\sim$KDatagram\-Packet} ()
\item 
const {\bf QByte\-Array} \& {\bf data} () const 
\item 
uint {\bf length} () const 
\item 
uint {\bf size} () const 
\item 
bool {\bf is\-Empty} () const 
\item 
bool {\bf is\-Null} () const 
\item 
const {\bf KSocket\-Address} \& {\bf address} () const 
\item 
void {\bf set\-Address} (const {\bf KSocket\-Address} \&addr)
\item 
void {\bf detach} ()
\item 
void {\bf set\-Data} (const {\bf QByte\-Array} \&data)
\item 
void {\bf set\-Data} (const char $\ast$data, uint length)
\end{CompactItemize}


\subsection{Detailed Description}
one datagram 

This object represents one datagram of data sent or received through a datagram socket (as {\bf KDatagram\-Socket}{\rm (p.\,\pageref{classKNetwork_1_1KDatagramSocket})} or derived classes). A datagram consists of data as well as a network address associated (whither to send the data or whence it came).

This is a lightweight class. Data is stored in a {\bf QByte\-Array}, which means that it is explicitly shared.

\begin{Desc}
\item[Author:]Thiago Macieira $<${\tt thiago.macieira@kdemail.net}$>$ \end{Desc}




Definition at line 51 of file kdatagramsocket.h.

\subsection{Constructor \& Destructor Documentation}
\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!KDatagramPacket@{KDatagramPacket}}
\index{KDatagramPacket@{KDatagramPacket}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KNetwork::KDatagram\-Packet::KDatagram\-Packet ()\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a0}


Default constructor. 



Definition at line 60 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!KDatagramPacket@{KDatagramPacket}}
\index{KDatagramPacket@{KDatagramPacket}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KNetwork::KDatagram\-Packet::KDatagram\-Packet (const {\bf QByte\-Array} \& {\em content})\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a1}


Constructs the datagram with the specified content. 



Definition at line 66 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!KDatagramPacket@{KDatagramPacket}}
\index{KDatagramPacket@{KDatagramPacket}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KNetwork::KDatagram\-Packet::KDatagram\-Packet (const char $\ast$ {\em content}, uint {\em length})\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a2}


Constructs the datagram with the specified content. 

\begin{Desc}
\item[See also:]{\bf set\-Data}{\rm (p.\,\pageref{classKNetwork_1_1KDatagramPacket_a15})} for information on {\bf data}{\rm (p.\,\pageref{classKNetwork_1_1KDatagramPacket_a7})} sharing. \end{Desc}


Definition at line 75 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!KDatagramPacket@{KDatagramPacket}}
\index{KDatagramPacket@{KDatagramPacket}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KNetwork::KDatagram\-Packet::KDatagram\-Packet (const {\bf QByte\-Array} \& {\em content}, const {\bf KSocket\-Address} \& {\em addr})\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a3}


Constructs the datagram with the specified content and address. 



Definition at line 81 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!KDatagramPacket@{KDatagramPacket}}
\index{KDatagramPacket@{KDatagramPacket}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KNetwork::KDatagram\-Packet::KDatagram\-Packet (const char $\ast$ {\em content}, uint {\em length}, const {\bf KSocket\-Address} \& {\em addr})\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a4}


Constructs the datagram with the specified content and address. 



Definition at line 88 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!KDatagramPacket@{KDatagramPacket}}
\index{KDatagramPacket@{KDatagramPacket}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KNetwork::KDatagram\-Packet::KDatagram\-Packet (const {\bf KDatagram\-Packet} \& {\em other})\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a5}


Copy constructor. 

Note that data is explicitly shared. 

Definition at line 95 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!~KDatagramPacket@{$\sim$KDatagramPacket}}
\index{~KDatagramPacket@{$\sim$KDatagramPacket}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KNetwork::KDatagram\-Packet::$\sim${\bf KDatagram\-Packet} ()\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a6}


Destructor. 

Non-virtual. 

Definition at line 101 of file kdatagramsocket.h.

\subsection{Member Function Documentation}
\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!data@{data}}
\index{data@{data}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QByte\-Array}\& KNetwork::KDatagram\-Packet::data () const\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a7}


Returns the data. 



Definition at line 107 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!length@{length}}
\index{length@{length}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KNetwork::KDatagram\-Packet::length () const\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a8}


Returns the data length. 



Definition at line 113 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!size@{size}}
\index{size@{size}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KNetwork::KDatagram\-Packet::size () const\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a9}


Returns the data length. 



Definition at line 119 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!isEmpty@{isEmpty}}
\index{isEmpty@{isEmpty}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KNetwork::KDatagram\-Packet::is\-Empty () const\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a10}


Returns true if this object is empty. 



Definition at line 125 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!isNull@{isNull}}
\index{isNull@{isNull}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KNetwork::KDatagram\-Packet::is\-Null () const\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a11}


Returns true if this object is null. 



Definition at line 131 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!address@{address}}
\index{address@{address}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KSocket\-Address}\& KNetwork::KDatagram\-Packet::address () const\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a12}


Returns the socket address. 



Definition at line 137 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!setAddress@{setAddress}}
\index{setAddress@{setAddress}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KDatagram\-Packet::set\-Address (const {\bf KSocket\-Address} \& {\em addr})\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a13}


Sets the address stored to the given value. 



Definition at line 143 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!detach@{detach}}
\index{detach@{detach}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KDatagram\-Packet::detach ()\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a14}


Detaches our data from a shared pool. 

\begin{Desc}
\item[See also:]QByte\-Array::detach \end{Desc}


Definition at line 150 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!setData@{setData}}
\index{setData@{setData}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KDatagram\-Packet::set\-Data (const {\bf QByte\-Array} \& {\em data})\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a15}


Sets the data to the given value. 

Data is explicitly shared. 

Definition at line 156 of file kdatagramsocket.h.\index{KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}!setData@{setData}}
\index{setData@{setData}!KNetwork::KDatagramPacket@{KNetwork::KDatagram\-Packet}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KDatagram\-Packet::set\-Data (const char $\ast$ {\em data}, uint {\em length})\hspace{0.3cm}{\tt  [inline]}}\label{classKNetwork_1_1KDatagramPacket_a16}


Sets the data to the given buffer and size. 



Definition at line 162 of file kdatagramsocket.h.

The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
kdatagramsocket.h\end{CompactItemize}
