VR-Exchange 2.5 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
smSubscribableMessageQueue.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2016 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <portal/messageQueue.h>
13 #include <vlutil/vlShmPool.h>
14 
15 namespace MAKVrExchange
16 {
17 
18  struct DtQueueHeader;
19  struct DtBucketHeader;
20 
35  {
36  public:
37 
39  static const unsigned int theMaxSubscribers = 256;
40 
43  static unsigned long theLockFailureTimeoutMs;
44 
45  public:
46 
56  DtSubscribableMessageQueue( const DtString& name, DtU8 subscriberId );
57 
59  virtual ~DtSubscribableMessageQueue();
60 
62  virtual bool isEmpty();
63 
65  virtual bool isSubscribed( DtU8 subscriberId ) const;
66 
69  virtual DtU32 subscriberDrops( DtU8 subscriberId ) const;
70 
76  virtual void sendMessage( const void* message, unsigned int size,
77  bool global = false );
78 
82  virtual void* message( unsigned int* outSize = 0 );
83 
89  virtual void unsubscribe( DtU8 id );
90 
96  void subscribe( DtU8 id );
97 
101  virtual void resetQueue( DtU32 numberOfBuckets, DtU32 payloadSize );
102 
104  virtual std::ostream& printDataToStream( std::ostream& str ) const;
105 
109  static unsigned int poolSize( DtU32 numberOfBuckets, DtU32 payloadSize );
110 
112  virtual DtString name() const;
113 
115  DtQueueHeader* queueHeader() const;
116 
118  DtU32 numberOfBuckets() const;
119 
121  DtU32 payloadSize() const;
122 
125  virtual char* payloadInBucket( unsigned int bucketNum ) const;
126 
128  virtual DtBucketHeader* bucketHeader( unsigned int bucketNum ) const;
129 
131  virtual int usedBucketCount() const;
132 
133  private:
134 
137 
139  DtSubscribableMessageQueue& operator = (const DtSubscribableMessageQueue& other );
140 
141  protected:
142 
143  std::vector<char> myReadBuffer;
146 
147  DtSharedMemoryPoolClient* myShmPool;
148 
149  };
150 
151 }

Document ID: Generated on Wed Dec 21 15:05:11 EST 2016 from SVN revision 171891
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)