FX::QLocalPipe Class Reference
[Synchronous i/o devices]

#include <QLocalPipe.h>

Inheritance diagram for FX::QLocalPipe:

FX::QIODeviceS FX::QIODevice List of all members.

Detailed Description

A process-local pipe.

This is a synchronous pipe i/o device operated completely within the local process and is intended as the primary method for threads to communicate with each other. It is extremely efficient, threadsafe and has no effective pipe buffer length as it uses the freestore.

See FX::QPipe for more information about how such objects work. One difference that there is no create(), instead there is an otherEnd() method which returns an instance of QLocalPipe reflecting the other end of the local pipe.

Note that on some platforms FX::QLocalPipe can appear to be slower than a system pipe (the i/o test shows this). I can't explain this except to say that if you set the granularity to 512Kb you get the same speed but at 1Mb sequential performance suddenly doubles - so I'm assuming that the MSVC6 STL <vector> implementation is crossing over some boundary where it reallocates every time. One thing my tests do confirm is that QLocalPipe has a much lower latency than FX::QPipe which means anything working without a sliding window will benefit a lot.

Definition at line 58 of file QLocalPipe.h.

Public Types

typedef FXfval Offset
 Default
 Unix
 MacOS
 MSDOS
 NoTranslation
 UTF8
 UTF16
 UTF16LE
 UTF32
 UTF32LE
enum  CRLFType { Default, Unix, MacOS, MSDOS }
enum  UnicodeType {
  NoTranslation, UTF8, UTF16, UTF16LE,
  UTF32, UTF32LE
}

Public Member Functions

 QLocalPipe ()
 QLocalPipe (const QLocalPipe &o)
 ~QLocalPipe ()
FXuval granularity () const
void setGranularity (FXuval newval)
QLocalPipe clientEnd () const
bool create (FXuint mode=IO_ReadWrite)
bool open (FXuint mode=IO_ReadWrite)
void close ()
void flush ()
bool atEnd () const
FXfval size () const
void truncate (FXfval size)
FXfval at () const
bool at (FXfval newpos)
FXuval readBlock (char *data, FXuval maxlen)
FXuval writeBlock (const char *data, FXuval maxlen)
int ungetch (int)
virtual bool isSynchronous () const
virtual FXuval readBlockFrom (char *data, FXuval maxlen, FXfval pos)
FXuval readBlockFrom (FXuchar *data, FXuval maxlen, FXfval pos)
virtual FXuval writeBlockTo (FXfval pos, const char *data, FXuval maxlen)
FXuval writeBlockTo (FXfval pos, const FXuchar *data, FXuval maxlen)
FXuint flags () const
FXuint mode () const
FXuint state () const
CRLFType crlfFormat () const
void setCRLFFormat (CRLFType type)
UnicodeType unicodeTranslation () const
void setUnicodeTranslation (UnicodeType type)
bool isBuffered () const
bool isRaw () const
bool isTranslated () const
bool isUTF16Translated () const
bool isUTF32Translated () const
bool isReadable () const
bool isWriteable () const
bool isWritable () const
bool isReadWrite () const
bool isClosed () const
bool isInactive () const
bool isOpen () const
virtual const FXACLpermissions () const
virtual void setPermissions (const FXACL &)
FXuval readBlock (FXuchar *data, FXuval maxlen)
FXuval writeBlock (const FXuchar *data, FXuval maxlen)
virtual FXuval readLine (char *data, FXuval maxlen)
virtual int getch ()
virtual int putch (int c)
FXfval shredData (FXfval offset, FXfval len=(FXfval)-1)

Static Public Member Functions

static bool waitForData (QIODeviceS **signalled, FXuint no, QIODeviceS **list, FXuint waitfor=FXINFINITE)
static FXuint waitForDataMax () throw ()
static UnicodeType determineUnicodeType (FXuchar *data, FXuval len) throw ()
static FXuval applyCRLF (FXuchar *FXRESTRICT output, const FXuchar *FXRESTRICT input, FXuval outputlen, FXuval &inputlen, CRLFType crlftype=Default, UnicodeType utftype=NoTranslation)
static FXuval removeCRLF (FXuchar *FXRESTRICT output, const FXuchar *FXRESTRICT input, FXuval outputlen, FXuval &inputlen, UnicodeType utftype=NoTranslation)

Protected Member Functions

void setFlags (int f)
void setMode (int m)
void setState (int s)

Protected Attributes

FXfval ioIndex

Friends

struct QLocalPipePrivate
FXAPI FXStreamoperator<< (FXStream &s, QIODevice &i)
FXAPI FXStreamoperator>> (FXStream &s, QIODevice &i)


The documentation for this class was generated from the following file:
(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:37:41 2009 for TnFOX by doxygen v1.4.7