VR-Link API Documentation for DIS
vlShmWriter.h
Go to the documentation of this file.
1 /*********************************************************************
2  ** Copyright (c) 1992-2010 VT MAK
3  ** All rights reserved.
4  *********************************************************************/
8 #pragma once
9 
10 #include "vlShmQueue.h"
11 
12 #ifdef DtUSE_UTILITIES_NAMESPACE
13 namespace DtUSE_UTILITIES_NAMESPACE
14 {
15 #endif
16 
17 #define DEBUG 0
18 
20  {
21  public:
23  virtual ~DtClientServerWriter() {};
24 
25  virtual int Write (char *buf, size_t size) = 0;
26  virtual int Writev (char **buflist, size_t *sizelist, int n) = 0;
27 
28  };
29 
31  {
32  public:
33 
34  DtShmMsgQueueWriter(DtShmMsgQueue *q, int size, int sem, int firstSem,
35  bool wait, bool pleaseInit, bool dropOldest = true);
36 
37  virtual ~DtShmMsgQueueWriter() {}
38 
39  virtual int Write (char *buf, size_t size);
40  virtual int Writev (char **buflist, size_t *sizelist, int n);
41 
42  void setInternal(int mode) {qManager.setInternal(mode); }
43  void setGoAway(int mode) {qManager.setGoAway(mode); }
44  int newDropped() { return newLost; }
45  int oldDropped() { return oldLost; }
46  int msgsSent() { return notLost; }
47 
50  int queueBack;
51 
52  private:
53 
54  int enqueuev (char **buflist, size_t *sizelist, int n, int totalSize);
55  void copyv(char **buflist, size_t *sizelist, int n, int endSize);
56  int findSpace(int start, int request, int *available);
57  void moveFront(void);
58 
59  int newLost;
60  int oldLost;
61  int notLost;
62 
65  int verifyQueue(void);
66 #if DEBUG
67 #endif
68 
69 
70  };
71 
72 #ifdef DtUSE_UTILITIES_NAMESPACE
73 }
74 #endif
75 
76 

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)