test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
 ThreadQueue (const ThreadQueue &)
 

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.

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

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.

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 )
private
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(), m_buf, and findQualityFiles::v.

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().