WvStreams
wvmagicloopback.h
1 /* -*- Mode: C++ -*-
2  * Worldvisions Weaver Software:
3  * Copyright (C) 1997-2004 Net Integration Technologies, Inc.
4  */
5 #ifndef __WVMAGICLOOPBACK_H
6 #define __WVMAGICLOOPBACK_H
7 
8 #include "wvmagiccircle.h"
9 #include "wvloopback.h"
10 
11 class WvMagicLoopback : public WvStream
12 {
13 public:
14 
15  WvMagicLoopback(size_t size);
16 
17  virtual void pre_select(SelectInfo &si);
18  virtual bool post_select(SelectInfo &si);
19 
20  virtual size_t uread(void *buf, size_t len);
21  virtual size_t uwrite(const void *buf, size_t len);
22 
23 private:
24 
25  WvMagicCircle circle;
26  WvLoopback loop;
27 
28 public:
29  const char *wstype() const { return "WvMagicLoopback"; }
30 };
31 
32 #endif // __WVMAGICLOOPBACK_H
WvMagicLoopback::pre_select
virtual void pre_select(SelectInfo &si)
pre_select() sets up for eventually calling ::select().
Definition: wvmagicloopback.cc:14
WvMagicCircle
A circular queue that can be accessed across fork().
Definition: wvmagiccircle.h:14
WvMagicLoopback::post_select
virtual bool post_select(SelectInfo &si)
post_select() is called after ::select(), and returns true if this object is now ready.
Definition: wvmagicloopback.cc:26
IWvStream::SelectInfo
the data structure used by pre_select()/post_select() and internally by select().
Definition: iwvstream.h:50
WvStream
Unified support for streams, that is, sequences of bytes that may or may not be ready for read/write ...
Definition: wvstream.h:24
WvMagicLoopback::uwrite
virtual size_t uwrite(const void *buf, size_t len)
unbuffered I/O functions; these ignore the buffer, which is handled by write().
Definition: wvmagicloopback.cc:44
WvMagicLoopback::uread
virtual size_t uread(void *buf, size_t len)
unbuffered I/O functions; these ignore the buffer, which is handled by read().
Definition: wvmagicloopback.cc:38
WvMagicLoopback
Definition: wvmagicloopback.h:11
WvLoopback
Implementation of a WvLoopback stream.
Definition: wvloopback.h:16