• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

  • KNetwork
  • KDatagramPacket
Public Member Functions | List of all members
KNetwork::KDatagramPacket Class Reference

#include <kdatagramsocket.h>

Public Member Functions

 KDatagramPacket ()
 
 KDatagramPacket (const TQByteArray &content)
 
 KDatagramPacket (const char *content, uint length)
 
 KDatagramPacket (const TQByteArray &content, const KSocketAddress &addr)
 
 KDatagramPacket (const char *content, uint length, const KSocketAddress &addr)
 
 KDatagramPacket (const KDatagramPacket &other)
 
 ~KDatagramPacket ()
 
const TQByteArray & data () const
 
uint length () const
 
uint size () const
 
bool isEmpty () const
 
bool isNull () const
 
const KSocketAddress & address () const
 
void setAddress (const KSocketAddress &addr)
 
void detach ()
 
void setData (const TQByteArray &data)
 
void setData (const char *data, uint length)
 

Detailed Description

one datagram

This object represents one datagram of data sent or received through a datagram socket (as KDatagramSocket 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 TQByteArray, which means that it is explicitly shared.

Author
Thiago Macieira thiag.nosp@m.o.ma.nosp@m.cieir.nosp@m.a@kd.nosp@m.email.nosp@m..net

Definition at line 51 of file kdatagramsocket.h.

Constructor & Destructor Documentation

KNetwork::KDatagramPacket::KDatagramPacket ( )
inline

Default constructor.

Definition at line 60 of file kdatagramsocket.h.

KNetwork::KDatagramPacket::KDatagramPacket ( const TQByteArray &  content)
inline

Constructs the datagram with the specified content.

Definition at line 66 of file kdatagramsocket.h.

KNetwork::KDatagramPacket::KDatagramPacket ( const char *  content,
uint  length 
)
inline

Constructs the datagram with the specified content.

See Also
setData for information on data sharing.

Definition at line 75 of file kdatagramsocket.h.

KNetwork::KDatagramPacket::KDatagramPacket ( const TQByteArray &  content,
const KSocketAddress &  addr 
)
inline

Constructs the datagram with the specified content and address.

Definition at line 81 of file kdatagramsocket.h.

KNetwork::KDatagramPacket::KDatagramPacket ( const char *  content,
uint  length,
const KSocketAddress &  addr 
)
inline

Constructs the datagram with the specified content and address.

Definition at line 88 of file kdatagramsocket.h.

KNetwork::KDatagramPacket::KDatagramPacket ( const KDatagramPacket &  other)
inline

Copy constructor.

Note that data is explicitly shared.

Definition at line 95 of file kdatagramsocket.h.

KNetwork::KDatagramPacket::~KDatagramPacket ( )
inline

Destructor.

Non-virtual.

Definition at line 101 of file kdatagramsocket.h.

Member Function Documentation

const KSocketAddress& KNetwork::KDatagramPacket::address ( ) const
inline

Returns the socket address.

Definition at line 137 of file kdatagramsocket.h.

const TQByteArray& KNetwork::KDatagramPacket::data ( ) const
inline

Returns the data.

Definition at line 107 of file kdatagramsocket.h.

void KNetwork::KDatagramPacket::detach ( )
inline

Detaches our data from a shared pool.

See Also
TQByteArray::detach

Definition at line 150 of file kdatagramsocket.h.

bool KNetwork::KDatagramPacket::isEmpty ( ) const
inline

Returns true if this object is empty.

Definition at line 125 of file kdatagramsocket.h.

bool KNetwork::KDatagramPacket::isNull ( ) const
inline

Returns true if this object is null.

Definition at line 131 of file kdatagramsocket.h.

uint KNetwork::KDatagramPacket::length ( ) const
inline

Returns the data length.

Definition at line 113 of file kdatagramsocket.h.

void KNetwork::KDatagramPacket::setAddress ( const KSocketAddress &  addr)
inline

Sets the address stored to the given value.

Definition at line 143 of file kdatagramsocket.h.

void KNetwork::KDatagramPacket::setData ( const TQByteArray &  data)
inline

Sets the data to the given value.

Data is explicitly shared.

Definition at line 156 of file kdatagramsocket.h.

void KNetwork::KDatagramPacket::setData ( const char *  data,
uint  length 
)
inline

Sets the data to the given buffer and size.

Definition at line 162 of file kdatagramsocket.h.

uint KNetwork::KDatagramPacket::size ( ) const
inline

Returns the data length.

Definition at line 119 of file kdatagramsocket.h.


The documentation for this class was generated from the following file:
  • kdatagramsocket.h

kdecore

Skip menu "kdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |