CPN
Computational Process Networks
MirrorBufferSet.h
Go to the documentation of this file.
1 //=============================================================================
2 // $Id: MirrorBufferSet.h,v 1.1 2006/06/12 20:21:44 gallen Exp $
3 //-----------------------------------------------------------------------------
4 // A set of "mirrored" buffers
5 //=============================================================================
6 
7 
8 #ifndef MirrorBufferSet_h
9 #define MirrorBufferSet_h
10 #pragma once
11 #include "common_priv.h"
12 
13 //-----------------------------------------------------------------------------
14 // Implementation notes:
15 //
16 // +------------------+------------+------------------+------------+
17 // | bufferSize | mirrorSize | bufferSize | mirrorSize | ...
18 // +------------------+------------+------------------+------------+
19 //
20 // Each buffer has its first mirrorSize bytes mirrored by the VM system.
21 // There are numBuffers contiguous buffers.
22 // bufferSize and mirrorSize are multiples of the VM page size.
23 // mirrorSize <= bufferSize
24 //-----------------------------------------------------------------------------
25 
26 
28  public:
29  typedef unsigned long ulong;
30 
31  MirrorBufferSet(ulong bufferSz, ulong mirrorSz, int nBuffers = 1);
32  ~MirrorBufferSet(void);
33 
34  ulong BufferSize(void) const { return bufferSize; }
35  ulong MirrorSize(void) const { return mirrorSize; }
36  ulong NumBuffers(void) const { return numBuffers; }
37 
39 
40  static int Supported(void);
41  static ulong PageSize(void);
42 
43  operator void* (void) const { return bufferBase; }
44 
45  protected:
46  int GetFileDescriptor(void);
47 
48  void* bufferBase;
52  char fileName[112];
53 };
54 
55 
56 #endif
ulong NumBuffers(void) const
int GetFileDescriptor(void)
static int Supported(void)
ulong MirrorSize(void) const
unsigned long ulong
char fileName[112]
static ulong PageSize(void)
ulong BufferSize(void) const
MirrorBufferSet(ulong bufferSz, ulong mirrorSz, int nBuffers=1)