ThreadQueue.h
Go to the documentation of this file.
1 #ifndef messagefacility_MessageService_ThreadQueue_h
2 #define messagefacility_MessageService_ThreadQueue_h
3 
6 
7 namespace mf {
8  namespace service {
9 
10  class ThreadQueue {
11 
12  public:
13  ThreadQueue();
14  virtual ~ThreadQueue() = default;
15 
16  // --- obtain a message from the queue:
17  void consume(OpCode& opcode, void*& operand);
18 
19  // --- place a message onto the queue:
20  void produce(OpCode opcode, void* operand);
21 
22  ThreadQueue(ThreadQueue const&) = delete;
23  ThreadQueue& operator=(ThreadQueue const&) = delete;
24 
25  private:
26  // --- buffer parameters: (were private but needed by MainThreadMLscribe)
27  static constexpr int buf_depth{500};
28  static constexpr int buf_size{sizeof(OpCode) + sizeof(void*)};
30  };
31 
32  } // end namespace service
33 } // end namespace mf
34 
35 #endif /* messagefacility_MessageService_ThreadQueue_h */
36 
37 // Local Variables:
38 // mode: c++
39 // End:
static constexpr int buf_size
Definition: ThreadQueue.h:28
SingleConsumerQ m_buf
Definition: ThreadQueue.h:29
static constexpr int buf_depth
Definition: ThreadQueue.h:27
virtual ~ThreadQueue()=default
void produce(OpCode opcode, void *operand)
Definition: ThreadQueue.cc:10
void consume(OpCode &opcode, void *&operand)
Definition: ThreadQueue.cc:21
ThreadQueue & operator=(ThreadQueue const &)=delete