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 
15  ThreadQueue::ThreadQueue() : m_buf(buf_size, buf_depth) {}
17 
20  char *slot_p = static_cast<char *>(b.buffer());
21  void *v = operand;
22  std::memcpy(slot_p + 0, &o, sizeof(MessageLoggerQ::OpCode));
23  std::memcpy(slot_p + sizeof(MessageLoggerQ::OpCode), &v, sizeof(void *));
24  b.commit(buf_size);
25  } // runCommand
26 
27  void ThreadQueue::consume(MessageLoggerQ::OpCode &opcode, void *&operand) {
28  SingleConsumerQ::ConsumerBuffer b(m_buf); // Look -- CONSUMER buffer
29  char *slot_p = static_cast<char *>(b.buffer());
30  std::memcpy(&opcode, slot_p + 0, sizeof(MessageLoggerQ::OpCode));
31  std::memcpy(&operand, slot_p + sizeof(MessageLoggerQ::OpCode), sizeof(void *));
32  b.commit(buf_size);
33  }
34 
35  } // end of namespace service
36 } // end of namespace edm
service
Definition: service.py:1
edm
HLT enums.
Definition: AlignableModifier.h:19
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::SingleConsumerQ::OperateBuffer
Definition: SingleConsumerQ.h:68
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
ThreadQueue.h
b
double b
Definition: hdecay.h:118
edm::service::ThreadQueue::~ThreadQueue
virtual ~ThreadQueue()
Definition: ThreadQueue.cc:16
edm::service::ThreadQueue::consume
void consume(MessageLoggerQ::OpCode &opcode, void *&operand)
Definition: ThreadQueue.cc:27
edm::service::ThreadQueue::m_buf
SingleConsumerQ m_buf
Definition: ThreadQueue.h:54
edm::service::ThreadQueue::ThreadQueue
ThreadQueue()
Definition: ThreadQueue.cc:15
edm::service::ThreadQueue::produce
void produce(MessageLoggerQ::OpCode opcode, void *operand)
Definition: ThreadQueue.cc:18
edm::service::ThreadQueue::buf_size
static const int buf_size
Definition: ThreadQueue.h:53
edm::MessageLoggerQ::OpCode
OpCode
Definition: MessageLoggerQ.h:26