CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
edm::service::MainThreadMLscribe Class Reference

#include <MainThreadMLscribe.h>

Inheritance diagram for edm::service::MainThreadMLscribe:
edm::service::AbstractMLscribe

Public Member Functions

 MainThreadMLscribe (boost::shared_ptr< ThreadQueue > tqp)
 
virtual void runCommand (MessageLoggerQ::OpCode opcode, void *operand)
 
virtual ~MainThreadMLscribe ()
 
- Public Member Functions inherited from edm::service::AbstractMLscribe
 AbstractMLscribe ()
 
virtual ~AbstractMLscribe ()
 

Static Public Member Functions

static ErrorLoggetErrorLog_ptr ()
 

Private Attributes

boost::shared_ptr< ThreadQueuem_queue
 

Static Private Attributes

static ErrorLogstatic_errorlog_p
 

Detailed Description

Definition at line 39 of file MainThreadMLscribe.h.

Constructor & Destructor Documentation

edm::service::MainThreadMLscribe::MainThreadMLscribe ( boost::shared_ptr< ThreadQueue tqp)

Definition at line 16 of file MainThreadMLscribe.cc.

17  : m_queue(tqp)
18 {
19 }
boost::shared_ptr< ThreadQueue > m_queue
edm::service::MainThreadMLscribe::~MainThreadMLscribe ( )
virtual

Definition at line 21 of file MainThreadMLscribe.cc.

21 {}

Member Function Documentation

static ErrorLog* edm::service::MainThreadMLscribe::getErrorLog_ptr ( )
inlinestatic

Definition at line 52 of file MainThreadMLscribe.h.

References static_errorlog_p.

52 {return static_errorlog_p;}
void edm::service::MainThreadMLscribe::runCommand ( MessageLoggerQ::OpCode  opcode,
void *  operand 
)
virtual

Reimplemented from edm::service::AbstractMLscribe.

Definition at line 25 of file MainThreadMLscribe.cc.

References edm::ConfigurationHandshake::c, edm::ConfigurationHandshake::epp, h, edm::MessageLoggerQ::handshaked(), edm::ConfigurationHandshake::m, m_queue, and v.

26 {
27  if (MessageLoggerQ::handshaked(opcode)) {
29  ConfigurationHandshake h(operand,epp);
30  void * v(static_cast<void *>(&h));
32  {
33  boost::mutex::scoped_lock sl(h.m); // get lock
34  m_queue->produce (opcode, v);
35  // wait for result to appear (in epp)
36  h.c.wait(sl); // c.wait(sl) unlocks the scoped lock and sleeps till notified
37  // ... and once the MessageLoggerScribe does h.c.notify_all() ...
38  ep = *h.epp;
39  // finally, release the scoped lock by letting it go out of scope
40  }
41  if ( ep ) {
42  edm::Exception ex(*ep);
43  throw ex;
44  }
45  } else {
46  m_queue->produce (opcode, operand);
47  }
48 } // runCommand
static bool handshaked(const OpCode &op)
boost::shared_ptr< edm::Exception > Pointer_to_new_exception_on_heap
boost::shared_ptr< Pointer_to_new_exception_on_heap > Place_for_passing_exception_ptr
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
mathSSE::Vec4< T > v
boost::shared_ptr< ThreadQueue > m_queue

Member Data Documentation

boost::shared_ptr<ThreadQueue> edm::service::MainThreadMLscribe::m_queue
private

Definition at line 57 of file MainThreadMLscribe.h.

Referenced by runCommand().

ErrorLog* edm::service::MainThreadMLscribe::static_errorlog_p
staticprivate

Definition at line 56 of file MainThreadMLscribe.h.

Referenced by getErrorLog_ptr().