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
edm::service::MessageServicePresence Class Reference

#include <MessageServicePresence.h>

Inheritance diagram for edm::service::MessageServicePresence:
edm::Presence

Public Member Functions

 MessageServicePresence ()
 
 ~MessageServicePresence ()
 
- Public Member Functions inherited from edm::Presence
 Presence ()
 
virtual ~Presence ()=0
 

Private Member Functions

 MessageServicePresence (MessageServicePresence const &)
 
void operator= (MessageServicePresence const &)
 

Private Attributes

boost::shared_ptr< ThreadQueuem_queue
 
boost::thread m_scribeThread
 

Detailed Description

Definition at line 16 of file MessageServicePresence.h.

Constructor & Destructor Documentation

edm::service::MessageServicePresence::MessageServicePresence ( )

Definition at line 52 of file MessageServicePresence.cc.

References m_queue, and edm::MessageLoggerQ::setMLscribe_ptr().

53  : Presence()
54  , m_queue (new ThreadQueue)
56  ( ( (void) MessageLoggerQ::instance() // ensure Q's static data init'd
57  , boost::bind(&runMessageLoggerScribe, m_queue)
58  // start a new thread, run rMLS(m_queue)
59  // ChangeLog 2
60  ) )
61  // Note that m_scribeThread, which is a boost::thread, has a single-argument ctor -
62  // just the function to be run. But we need to do something first, namely,
63  // ensure that the MessageLoggerQ is in a valid state - and that requires
64  // a statement. So we bundle that statement in parenthesis, separated by
65  // a comma, with the argument we really want (runMessageLoggerScribe). This
66  // creates a single argument, wheich evaluates to runMessageLoggerScribe after
67  // first executing the before-the-comma statement.
68 {
70  boost::shared_ptr<edm::service::AbstractMLscribe>
71  (new MainThreadMLscribe(m_queue)));
72  // change log 3
73  //std::cout << "MessageServicePresence ctor\n";
74 }
static void setMLscribe_ptr(boost::shared_ptr< edm::service::AbstractMLscribe > m)
static MessageLoggerQ * instance()
boost::shared_ptr< ThreadQueue > m_queue
edm::service::MessageServicePresence::~MessageServicePresence ( )

Definition at line 77 of file MessageServicePresence.cc.

References m_scribeThread, edm::MessageLoggerQ::MLqEND(), and edm::MessageLoggerQ::setMLscribe_ptr().

78 {
80  m_scribeThread.join();
82  (boost::shared_ptr<edm::service::AbstractMLscribe>()); // change log 3
83 }
static void setMLscribe_ptr(boost::shared_ptr< edm::service::AbstractMLscribe > m)
static void MLqEND()
edm::service::MessageServicePresence::MessageServicePresence ( MessageServicePresence const &  )
private

Member Function Documentation

void edm::service::MessageServicePresence::operator= ( MessageServicePresence const &  )
private

Member Data Documentation

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

Definition at line 29 of file MessageServicePresence.h.

Referenced by MessageServicePresence().

boost::thread edm::service::MessageServicePresence::m_scribeThread
private

Definition at line 30 of file MessageServicePresence.h.

Referenced by ~MessageServicePresence().