WvStreams
wvmagiccircle.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4 *
5 * A circular queue that can be accessed across fork().
6 */
7#ifndef __WVMAGICCIRCLE_H
8#define __WVMAGICCIRCLE_H
9
10#include "wvshmzone.h"
11
12
15{
16public:
22 WvMagicCircle(size_t size);
24
25protected:
26 WvShmZone shm;
27
28 volatile int &head, &tail;
29 int size;
30 char *circle;
31
32public:
33 size_t used();
34 size_t left()
35 { return size - used() - 1; }
36 size_t put(const void *data, size_t len);
37 size_t get(void *data, size_t len);
38 size_t skip(size_t len);
39
40public:
41 const char *wstype() const { return "WvMagicCircle"; }
42};
43
44
45#endif // __WVMAGICCIRCLE_H
A class for managing error numbers and strings.
Definition wverror.h:24
A circular queue that can be accessed across fork().
Represents a shared-memory zone via mmap().
Definition wvshmzone.h:21