LibreOffice Module comphelper (master)  1
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
comphelper::ComponentBase Class Reference

#include <componentbase.hxx>

Inheritance diagram for comphelper::ComponentBase:
[legend]
Collaboration diagram for comphelper::ComponentBase:
[legend]

Classes

struct  GuardAccess
 helper struct to grant access to selected public methods to the ComponentMethodGuard class More...
 
struct  NoInitializationNeeded
 

Public Member Functions

::osl::Mutex & getMutex (GuardAccess)
 retrieves the component's mutex More...
 
void checkDisposed (GuardAccess) const
 checks whether the component is already disposed, throws a DisposedException if so. More...
 
void checkInitialized (GuardAccess) const
 checks whether the component is already initialized, throws a NotInitializedException if not. More...
 

Protected Member Functions

 ComponentBase (::cppu::OBroadcastHelper &_rBHelper)
 creates a ComponentBase instance More...
 
 ComponentBase (::cppu::OBroadcastHelper &_rBHelper, NoInitializationNeeded)
 creates a ComponentBase instance More...
 
 ~ComponentBase () COVERITY_NOEXCEPT_FALSE
 
void setInitialized ()
 marks the instance as initialized More...
 
::cppu::OBroadcastHelpergetBroadcastHelper ()
 retrieves the component's broadcast helper More...
 
::osl::Mutex & getMutex ()
 retrieves the component's mutex More...
 
bool impl_isDisposed () const
 determines whether the instance is already disposed More...
 
bool impl_isInitialized_nothrow () const
 determines whether the component is already initialized More...
 

Static Protected Member Functions

static css::uno::Reference< css::uno::XInterface > getComponent ()
 returns the context to be used when throwing exceptions More...
 

Private Attributes

::cppu::OBroadcastHelperm_rBHelper
 
bool m_bInitialized
 

Detailed Description

Definition at line 33 of file componentbase.hxx.

Constructor & Destructor Documentation

comphelper::ComponentBase::ComponentBase ( ::cppu::OBroadcastHelper _rBHelper)
inlineprotected

creates a ComponentBase instance

The instance is not initialized. As a consequence, every ComponentMethodGuard instantiated for this component will throw a css::lang::NotInitializedException, until ->setInitialized() is called.

Definition at line 42 of file componentbase.hxx.

comphelper::ComponentBase::ComponentBase ( ::cppu::OBroadcastHelper _rBHelper,
NoInitializationNeeded   
)
inlineprotected

creates a ComponentBase instance

The instance is already initialized, so there's no need to call setInitialized later on. Use this constructor for component implementations which do not require explicit initialization.

Definition at line 55 of file componentbase.hxx.

comphelper::ComponentBase::~ComponentBase ( )
inlineprotected

Definition at line 61 of file componentbase.hxx.

Member Function Documentation

void comphelper::ComponentBase::checkDisposed ( GuardAccess  ) const

checks whether the component is already disposed, throws a DisposedException if so.

Definition at line 36 of file componentbase.cxx.

References cppu::OBroadcastHelperVar< class, class >::bDisposed, getComponent(), and m_rBHelper.

Referenced by comphelper::ComponentMethodGuard::ComponentMethodGuard().

void comphelper::ComponentBase::checkInitialized ( GuardAccess  ) const

checks whether the component is already initialized, throws a NotInitializedException if not.

Definition at line 43 of file componentbase.cxx.

References getComponent(), and m_bInitialized.

Referenced by comphelper::ComponentMethodGuard::ComponentMethodGuard().

::cppu::OBroadcastHelper& comphelper::ComponentBase::getBroadcastHelper ( )
inlineprotected
Reference< XInterface > comphelper::ComponentBase::getComponent ( )
staticprotected

returns the context to be used when throwing exceptions

The default implementation returns <NULL>.

Definition at line 50 of file componentbase.cxx.

Referenced by checkDisposed(), and checkInitialized().

::osl::Mutex& comphelper::ComponentBase::getMutex ( GuardAccess  )
inline

retrieves the component's mutex

Definition at line 74 of file componentbase.hxx.

References getMutex().

Referenced by getMutex().

::osl::Mutex& comphelper::ComponentBase::getMutex ( )
inlineprotected

retrieves the component's mutex

Definition at line 84 of file componentbase.hxx.

Referenced by comphelper::MapEnumeration::~MapEnumeration().

bool comphelper::ComponentBase::impl_isDisposed ( ) const
inlineprotected

determines whether the instance is already disposed

Definition at line 86 of file componentbase.hxx.

Referenced by comphelper::EnumerableMap::~EnumerableMap().

bool comphelper::ComponentBase::impl_isInitialized_nothrow ( ) const
inlineprotected

determines whether the component is already initialized

Definition at line 90 of file componentbase.hxx.

Referenced by comphelper::EnumerableMap::initialize().

void comphelper::ComponentBase::setInitialized ( )
inlineprotected

marks the instance as initialized

Subsequent instantiations of a ComponentMethodGuard won't throw the NotInitializedException now.

Definition at line 67 of file componentbase.hxx.

Referenced by comphelper::EnumerableMap::initialize().

Member Data Documentation

bool comphelper::ComponentBase::m_bInitialized
private

Definition at line 101 of file componentbase.hxx.

Referenced by checkInitialized().

::cppu::OBroadcastHelper& comphelper::ComponentBase::m_rBHelper
private

Definition at line 100 of file componentbase.hxx.

Referenced by checkDisposed().


The documentation for this class was generated from the following files: