![]() |
VR-Link API Documentation for DIS
|
00001 /********************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *********************************************************************/ 00008 #pragma once 00009 00010 #include "vlShmQueue.h" 00011 00012 #define DEBUG 0 00013 00014 #define DtCsStatusMessageReceived 0 00015 #define DtCsStatusWouldResourceBlock 1 00016 #define DtCsStatusWouldBlock 2 00017 #define DtCsStatusClosing 3 00018 #define DtCsStatusExtCliQuota 4 00019 #define DtCsStatusTryAgain 5 //! no packet returned, 00020 00021 #define DtCsStatusMessageReceived 0 00022 #define DtCsStatusWouldResourceBlock 1 00023 #define DtCsStatusWouldBlock 2 00024 #define DtCsStatusClosing 3 00025 #define DtCsStatusExtCliQuota 4 00026 00027 #ifdef DtUSE_UTILITIES_NAMESPACE 00028 namespace DtUSE_UTILITIES_NAMESPACE 00029 { 00030 #endif 00031 00033 00034 class DT_DLL_VLUTIL DtClientServerReader 00035 { 00036 public: 00037 DtClientServerReader() {}; 00038 virtual ~DtClientServerReader() {}; 00039 00040 virtual int Read(char *buf, size_t size, char *status) = 0; 00041 }; 00042 00043 class DT_DLL_VLUTIL DtShmMsgQueueReader : public DtClientServerReader 00044 { 00045 public: 00046 00047 DtShmMsgQueueManager qManager; 00048 00049 DtShmMsgQueueReader(DtShmMsgQueue *q, int size, int sem, int firstSem, 00050 bool wait, bool pleaseInit, bool dropOldest = true); 00051 00052 virtual ~DtShmMsgQueueReader() {} 00053 00054 int Read(char *buf, size_t size, char *status); 00055 00056 bool isInternal() { return qManager.isInternal(); } 00057 int msgsRcvd() { return msgsRead; } 00058 00059 bool resourceWait; 00060 00061 private: 00062 00063 int msgsRead; 00064 00065 #if DEBUG 00066 int verifyQueue(void); 00067 #endif 00068 00069 }; 00070 00071 #ifdef DtUSE_UTILITIES_NAMESPACE 00072 } 00073 #endif 00074