CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

edm::service::ThreadQueue Class Reference

#include <ThreadQueue.h>

List of all members.

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 31 of file ThreadQueue.h.


Constructor & Destructor Documentation

ThreadQueue::ThreadQueue ( )

Definition at line 15 of file ThreadQueue.cc.

ThreadQueue::~ThreadQueue ( ) [virtual]

Definition at line 19 of file ThreadQueue.cc.

{}
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.

{
  SingleConsumerQ::ConsumerBuffer b(m_buf);  // Look -- CONSUMER buffer
  char * slot_p = static_cast<char *>(b.buffer());
  std::memcpy(&opcode , slot_p+0             , sizeof(MessageLoggerQ::OpCode));
  std::memcpy(&operand, slot_p+sizeof(MessageLoggerQ::OpCode), sizeof(void *));
  b.commit(buf_size);
}
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.

{
  SingleConsumerQ::ProducerBuffer b(m_buf);
  char * slot_p = static_cast<char *>(b.buffer());
  void * v = operand;
  std::memcpy(slot_p+0             , &o, sizeof(MessageLoggerQ::OpCode));
  std::memcpy(slot_p+sizeof(MessageLoggerQ::OpCode), &v, sizeof(void *));
  b.commit(buf_size);
} // runCommand

Member Data Documentation

const int edm::service::ThreadQueue::buf_depth = 500 [static, private]

Definition at line 59 of file ThreadQueue.h.

const int edm::service::ThreadQueue::buf_size [static, private]
Initial value:
 sizeof(MessageLoggerQ::OpCode)
                               + sizeof(void *)

Definition at line 60 of file ThreadQueue.h.

Referenced by consume(), and produce().

Definition at line 62 of file ThreadQueue.h.

Referenced by consume(), and produce().