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 &)=delete
 
void operator= (MessageServicePresence const &)=delete
 
std::shared_ptr< ThreadQueue
const > 
queue () const
 
std::shared_ptr< ThreadQueue > & queue ()
 

Private Attributes

edm::propagate_const
< std::shared_ptr< ThreadQueue > > 
m_queue
 
boost::thread m_scribeThread
 

Detailed Description

Definition at line 17 of file MessageServicePresence.h.

Constructor & Destructor Documentation

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

Definition at line 50 of file MessageServicePresence.cc.

References 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, 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>(queue())));
69  // change log 3
70  //std::cout << "MessageServicePresence ctor\n";
71 }
std::shared_ptr< ThreadQueue const > queue() const
static MessageLoggerQ * instance()
static void setMLscribe_ptr(std::shared_ptr< edm::service::AbstractMLscribe > m)
edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue
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 &  )
privatedelete

Member Function Documentation

void edm::service::MessageServicePresence::operator= ( MessageServicePresence const &  )
privatedelete
std::shared_ptr<ThreadQueue const> edm::service::MessageServicePresence::queue ( ) const
inlineprivate

Definition at line 29 of file MessageServicePresence.h.

References edm::get_underlying_safe(), and m_queue.

Referenced by MessageServicePresence().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue
std::shared_ptr<ThreadQueue>& edm::service::MessageServicePresence::queue ( )
inlineprivate

Definition at line 30 of file MessageServicePresence.h.

References edm::get_underlying_safe(), and m_queue.

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue

Member Data Documentation

edm::propagate_const<std::shared_ptr<ThreadQueue> > edm::service::MessageServicePresence::m_queue
private

Definition at line 33 of file MessageServicePresence.h.

Referenced by queue().

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

Definition at line 34 of file MessageServicePresence.h.

Referenced by ~MessageServicePresence().