CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
edm::service::ThreadQueue Class Reference

#include <ThreadQueue.h>

Public Member Functions

void consume (MessageLoggerQ::OpCode &opcode, void *&operand)
 
void produce (MessageLoggerQ::OpCode opcode, void *operand)
 
 ThreadQueue ()
 
virtual ~ThreadQueue ()
 

Private Member Functions

const ThreadQueueoperator= (const ThreadQueue &)=delete
 
 ThreadQueue (const ThreadQueue &)=delete
 

Private Attributes

SingleConsumerQ m_buf
 

Static Private Attributes

static const int buf_depth = 500
 
static const int buf_size = sizeof(MessageLoggerQ::OpCode) + sizeof(void*)
 

Detailed Description

Definition at line 27 of file ThreadQueue.h.

Constructor & Destructor Documentation

ThreadQueue::ThreadQueue ( )

Definition at line 15 of file ThreadQueue.cc.

static const int buf_depth
Definition: ThreadQueue.h:52
static const int buf_size
Definition: ThreadQueue.h:53
SingleConsumerQ m_buf
Definition: ThreadQueue.h:54
ThreadQueue::~ThreadQueue ( )
virtual

Definition at line 16 of file ThreadQueue.cc.

16 {}
edm::service::ThreadQueue::ThreadQueue ( const ThreadQueue )
privatedelete

Member Function Documentation

void ThreadQueue::consume ( MessageLoggerQ::OpCode opcode,
void *&  operand 
)

Definition at line 27 of file ThreadQueue.cc.

References b, buf_size, edm::SingleConsumerQ::OperateBuffer< T >::buffer(), edm::SingleConsumerQ::OperateBuffer< T >::commit(), and m_buf.

27  {
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  }
OperateBuffer< ConsumerType > ConsumerBuffer
double b
Definition: hdecay.h:118
static const int buf_size
Definition: ThreadQueue.h:53
SingleConsumerQ m_buf
Definition: ThreadQueue.h:54
const ThreadQueue& edm::service::ThreadQueue::operator= ( const ThreadQueue )
privatedelete
void ThreadQueue::produce ( MessageLoggerQ::OpCode  opcode,
void *  operand 
)

Definition at line 18 of file ThreadQueue.cc.

References b, buf_size, edm::SingleConsumerQ::OperateBuffer< T >::buffer(), edm::SingleConsumerQ::OperateBuffer< T >::commit(), m_buf, and findQualityFiles::v.

18  {
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
OperateBuffer< ProducerType > ProducerBuffer
double b
Definition: hdecay.h:118
static const int buf_size
Definition: ThreadQueue.h:53
SingleConsumerQ m_buf
Definition: ThreadQueue.h:54

Member Data Documentation

const int edm::service::ThreadQueue::buf_depth = 500
staticprivate

Definition at line 52 of file ThreadQueue.h.

const int edm::service::ThreadQueue::buf_size = sizeof(MessageLoggerQ::OpCode) + sizeof(void*)
staticprivate

Definition at line 53 of file ThreadQueue.h.

Referenced by consume(), and produce().

SingleConsumerQ edm::service::ThreadQueue::m_buf
private

Definition at line 54 of file ThreadQueue.h.

Referenced by consume(), and produce().