QCopChannel Class Reference
The QCopChannel class provides communication capabilities between
several clients.
More...
#include <qcopchannel_qws.h>
Inherits QObject.
List of all member functions.
Public Members
QCopChannel ( const QCString & channel, QObject * parent = 0, const char * name = 0 )
virtual void
receive ( const QCString & msg, const QByteArray & data )
Signals
void
received ( const QCString & msg, const QByteArray & data )
Static Public Members
bool
send ( const QCString & channel, const QCString & msg )
bool
send ( const QCString & channel, const QCString & msg, const QByteArray & data )
Detailed Description
The QCopChannel class provides communication capabilities between
several clients.
The Qt Cop (QCOP) is a COmmunication Protocol, allowing clients to
communicate both within the same address space and between different
processes.
Currently, this facility is only available on Qt/Embedded. On X11
and Windows we are exploring the use of existing standards such as
DCOP and COM.
QCopChannel provides send() and isRegistered() which are static
functions that are usable without an object.
The channel() function returns the name of the channel.
In order to listen to the traffic on a channel, you should either
subclass QCopChannel and reimplement receive(), or connect() to the
received() signal.
Member Function Documentation
QCopChannel::QCopChannel ( const QCString & channel, QObject * parent = 0, const char * name = 0 )
Constructs a QCop channel and registers it with the server using the name
channel. The standard parent and name arguments are passed on
to the QObject constructor.
QCopChannel::~QCopChannel () [virtual]
Destroys the client's end of the channel and notifies the server
that the client has closed its connection. The server will keep the
channel open until the last registered client detaches.
QCString QCopChannel::channel () const
Returns the name of the channel.
bool QCopChannel::isRegistered ( const QCString & channel ) [static]
Queries the server for the existance of channel.
Returns TRUE if channel is registered.
void QCopChannel::receive ( const QCString & msg, const QByteArray & data ) [virtual]
This virtual function allows subclasses of QCopChannel to
process data received from their channel.
The default implementation emits the received() signal.
Note that the format of data has to be well defined in order to
extract the information it contains.
See also send().
void QCopChannel::received ( const QCString & msg, const QByteArray & data ) [signal]
This signal is emitted whenever the receive() function gets incoming
data.
bool QCopChannel::send ( const QCString & channel, const QCString & msg ) [static]
Send the message msg on channel channel. The message will be
distributed to all clients subscribed to the channel.
See also receive().
bool QCopChannel::send ( const QCString & channel, const QCString & msg, const QByteArray & data ) [static]
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Same as above function except the additional data parameter.
Note that QDataStream provides a convenient way to fill the byte array
with auxiliary data.
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit,
copyright © 1995-2001
Trolltech, all rights reserved.
Copyright © 2001 Trolltech | Trademarks
| Qt version 3.0.0-beta1-beta1
|