CMS 3D CMS Logo

ThreadQueue.cc
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 //
3 // ThreadQueue.cc
4 //
5 // Changes:
6 //
7 //
8 
10 #include <cstring>
11 
12 namespace edm {
13 namespace service {
14 
16  : m_buf (buf_size, buf_depth)
17 {
18 }
20 
21 void
24 {
26  char * slot_p = static_cast<char *>(b.buffer());
27  void * v = operand;
28  std::memcpy(slot_p+0 , &o, sizeof(MessageLoggerQ::OpCode));
29  std::memcpy(slot_p+sizeof(MessageLoggerQ::OpCode), &v, sizeof(void *));
30  b.commit(buf_size);
31 } // runCommand
32 
33 void
35 consume( MessageLoggerQ::OpCode & opcode, void * & operand )
36 {
37  SingleConsumerQ::ConsumerBuffer b(m_buf); // Look -- CONSUMER buffer
38  char * slot_p = static_cast<char *>(b.buffer());
39  std::memcpy(&opcode , slot_p+0 , sizeof(MessageLoggerQ::OpCode));
40  std::memcpy(&operand, slot_p+sizeof(MessageLoggerQ::OpCode), sizeof(void *));
41  b.commit(buf_size);
42 }
43 
44 
45 
46 
47 } // end of namespace service
48 } // end of namespace edm
double b
Definition: hdecay.h:120
void consume(MessageLoggerQ::OpCode &opcode, void *&operand)
Definition: ThreadQueue.cc:35
HLT enums.
void produce(MessageLoggerQ::OpCode opcode, void *operand)
Definition: ThreadQueue.cc:23
static const int buf_size
Definition: ThreadQueue.h:59
SingleConsumerQ m_buf
Definition: ThreadQueue.h:61