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
 

Detailed Description

Definition at line 30 of file ThreadQueue.h.

Constructor & Destructor Documentation

ThreadQueue::ThreadQueue ( )

Definition at line 15 of file ThreadQueue.cc.

17 {
18 }
static const int buf_depth
Definition: ThreadQueue.h:58
static const int buf_size
Definition: ThreadQueue.h:59
SingleConsumerQ m_buf
Definition: ThreadQueue.h:61
ThreadQueue::~ThreadQueue ( )
virtual

Definition at line 19 of file ThreadQueue.cc.

References produce().

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

Member Function Documentation

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

Definition at line 35 of file ThreadQueue.cc.

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

Referenced by produce().

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

Definition at line 23 of file ThreadQueue.cc.

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

Referenced by ~ThreadQueue().

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
OperateBuffer< ProducerType > ProducerBuffer
double b
Definition: hdecay.h:120
static const int buf_size
Definition: ThreadQueue.h:59
SingleConsumerQ m_buf
Definition: ThreadQueue.h:61

Member Data Documentation

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

Definition at line 58 of file ThreadQueue.h.

const int edm::service::ThreadQueue::buf_size
staticprivate
Initial value:
+ sizeof(void *)

Definition at line 59 of file ThreadQueue.h.

Referenced by consume(), and produce().

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

Definition at line 61 of file ThreadQueue.h.

Referenced by consume(), and produce().