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

std::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 50 of file MessageServicePresence.cc.

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

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

Definition at line 74 of file MessageServicePresence.cc.

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

75 {
77  m_scribeThread.join();
79  (std::shared_ptr<edm::service::AbstractMLscribe>()); // change log 3
80 }
static void MLqEND()
static void setMLscribe_ptr(std::shared_ptr< edm::service::AbstractMLscribe > m)
edm::service::MessageServicePresence::MessageServicePresence ( MessageServicePresence const &  )
private

Member Function Documentation

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

Member Data Documentation

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