VR-Link API Documentation for HLA 1.3
vlShmWriter.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  ** Copyright (c) 1992-2010 VT MAK
00003  ** All rights reserved.
00004  *********************************************************************/
00008 #pragma once
00009 
00010 #include "vlShmQueue.h"
00011 
00012 #ifdef DtUSE_UTILITIES_NAMESPACE
00013 namespace DtUSE_UTILITIES_NAMESPACE
00014 {
00015 #endif
00016 
00017 #define DEBUG 0
00018 
00019    class DT_DLL_VLUTIL DtClientServerWriter
00020    {
00021    public:
00022       DtClientServerWriter() {};
00023       virtual ~DtClientServerWriter() {};
00024 
00025       virtual int Write (char *buf, size_t size) = 0;
00026       virtual int Writev (char **buflist, size_t *sizelist, int n) = 0;
00027 
00028    };
00029 
00030    class DT_DLL_VLUTIL DtShmMsgQueueWriter : public DtClientServerWriter
00031    {
00032    public:
00033 
00034       DtShmMsgQueueWriter(DtShmMsgQueue *q, int size, int sem, int firstSem,
00035                           bool wait, bool pleaseInit, bool dropOldest = true);
00036 
00037       virtual ~DtShmMsgQueueWriter() {}
00038 
00039       virtual int Write (char *buf, size_t size);
00040       virtual int Writev (char **buflist, size_t *sizelist, int n);
00041 
00042       void setInternal(int mode) {qManager.setInternal(mode); }
00043       void setGoAway(int mode) {qManager.setGoAway(mode); }
00044       int newDropped() { return newLost; }
00045       int oldDropped() { return oldLost; }
00046       int msgsSent()   { return notLost; }
00047 
00048       DtShmMsgQueueManager qManager;
00049       bool resourceWait;
00050       int queueBack;
00051 
00052    private:
00053 
00054       int enqueuev (char **buflist, size_t *sizelist, int n, int totalSize);
00055       void copyv(char **buflist, size_t *sizelist, int n, int endSize);
00056       int findSpace(int start, int request, int *available);
00057       void moveFront(void);
00058 
00059       int newLost;
00060       int oldLost;
00061       int notLost;
00062 
00065       int verifyQueue(void); 
00066 #if DEBUG
00067 #endif
00068 
00069 
00070    };
00071 
00072 #ifdef DtUSE_UTILITIES_NAMESPACE
00073 } 
00074 #endif
00075 
00076 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)