/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Attributes
Dyb::IMessageSvcHolder Class Reference

get a IMessageSvc* on 1st use (if not set) and release it on ~ More...

#include <getMessageSvc.h>

List of all members.

Public Member Functions

 IMessageSvcHolder ()
 will take the IMessageSvc* lazily from getMessageSvc() in get() Slow, but useful for classes without direct access to IMessageSvc*
 IMessageSvcHolder (const Options::CreateOptions o)
 allows to get the IMessageSvc immediately
 IMessageSvcHolder (IMessageSvc *ims)
 IMessageSvcHolder (const IMessageSvcHolder &)
 behaves like the constructor taking an IMessageSvc *
IMessageSvcHolderoperator= (const IMessageSvcHolder &)
 ~IMessageSvcHolder ()
 releases the IMessageSvc
IMessageSvc * get () const
 upon first access sets m_ims as needed
 operator const IMessageSvc * () const
 conversion to IMessageSvc*, same as get
 operator IMessageSvc * ()
 conversion to IMessageSvc*, same as get

Private Attributes

IMessageSvc * m_ims

Detailed Description

get a IMessageSvc* on 1st use (if not set) and release it on ~

Definition at line 34 of file getMessageSvc.h.


Constructor & Destructor Documentation

Dyb::IMessageSvcHolder::IMessageSvcHolder ( ) [inline]

will take the IMessageSvc* lazily from getMessageSvc() in get() Slow, but useful for classes without direct access to IMessageSvc*

Definition at line 38 of file getMessageSvc.h.

: m_ims() {}
IMessageSvcHolder::IMessageSvcHolder ( const Options::CreateOptions  o)

allows to get the IMessageSvc immediately

Parameters:
o,:if o is Dyb::Options::Eager it will create a MessageSvc instance there and then.

Definition at line 43 of file getMessageSvc.cc.

                                                                     :
  m_ims(0)
{
  if (opt == Dyb::Options::Eager) m_ims = getMessageSvc(opt);
}
IMessageSvcHolder::IMessageSvcHolder ( IMessageSvc *  ims)

Definition at line 22 of file getMessageSvc.cc.

                                                     : m_ims(ims) {
  assert(m_ims);
  m_ims->addRef(); //take ownership till we go out of scope
}
IMessageSvcHolder::IMessageSvcHolder ( const IMessageSvcHolder rhs)

behaves like the constructor taking an IMessageSvc *

Definition at line 27 of file getMessageSvc.cc.

                                                                 :
  m_ims(rhs.m_ims) 
{
  if (m_ims) m_ims->addRef(); //take ownership till we go out of scope
}
IMessageSvcHolder::~IMessageSvcHolder ( )

releases the IMessageSvc

Definition at line 49 of file getMessageSvc.cc.

                                      {
  if (m_ims) m_ims->release();
}

Member Function Documentation

IMessageSvcHolder & IMessageSvcHolder::operator= ( const IMessageSvcHolder rhs)

Definition at line 34 of file getMessageSvc.cc.

                                                         {
  if (this != & rhs && m_ims != rhs.m_ims) {
    if (m_ims) m_ims->release(); //give up our IMessageSvc*
    m_ims = rhs.m_ims;
    if (m_ims) m_ims->addRef(); //take ownership till we go out of scope
  }
  return *this;
}
IMessageSvc * IMessageSvcHolder::get ( ) const

upon first access sets m_ims as needed

Definition at line 54 of file getMessageSvc.cc.

                             {
  if (!m_ims) m_ims = getMessageSvc();
  return m_ims;
}
Dyb::IMessageSvcHolder::operator const IMessageSvc * ( ) const [inline]

conversion to IMessageSvc*, same as get

Definition at line 61 of file getMessageSvc.h.

{ return this->get(); }
Dyb::IMessageSvcHolder::operator IMessageSvc * ( ) [inline]

conversion to IMessageSvc*, same as get

Definition at line 63 of file getMessageSvc.h.

{ return this->get(); }

Member Data Documentation

IMessageSvc* Dyb::IMessageSvcHolder::m_ims [mutable, private]

Definition at line 65 of file getMessageSvc.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:57:56 for DybKernel by doxygen 1.7.4