te::core::LibraryManager Class Reference

A singleton that can be used to observe the available libraries in the system. More...

#include <LibraryManager.h>

Public Member Functions

bool exists (const std::string &name)
 Checks if a LibraryEntry exists from a given name. More...
 
const LibraryEntryget (const std::string &name)
 Return a null pointer if a library doesnt't exist. More...
 
void insert (const LibraryEntry &entry)
 It inserts a LibraryEntry to the manager. More...
 
bool isInitialized (const std::string &name)
 The current state of the LibraryEntry. More...
 
void remove (const std::string &name)
 It removes a LibraryEntry from the manager. More...
 

Static Public Member Functions

static LibraryManagerinstance ()
 It returns a reference to the singleton instance. More...
 

Protected Member Functions

 LibraryManager ()
 Singleton constructor must be private or protected. More...
 
 LibraryManager (const LibraryManager &)
 
LibraryManageroperator= (const LibraryManager &)
 
 ~LibraryManager ()
 Singleton destructor must be private or protected. More...
 

Private Attributes

Impl * m_pimpl
 

Detailed Description

A singleton that can be used to observe the available libraries in the system.

This singleton doesn't control the libraries lifetime, it just make smart references to them. These references will be automatically removed when a library goes out of scope (or been destroyed). Actually it works like an observer of known libraries.

Definition at line 79 of file LibraryManager.h.

Constructor & Destructor Documentation

te::core::LibraryManager::LibraryManager ( )
protected

Singleton constructor must be private or protected.

te::core::LibraryManager::~LibraryManager ( )
protected

Singleton destructor must be private or protected.

te::core::LibraryManager::LibraryManager ( const LibraryManager )
protected

Member Function Documentation

bool te::core::LibraryManager::exists ( const std::string &  name)

Checks if a LibraryEntry exists from a given name.

Parameters
nameThe name of the LibraryEntry
Returns
true if the LibraryEntry exist or false if doesn't.
const LibraryEntry& te::core::LibraryManager::get ( const std::string &  name)

Return a null pointer if a library doesnt't exist.

Parameters
nameThe LibraryEntry name.
Returns
a const reference to the LibraryEntry
Exceptions
te::OutOfRangeExceptionIf a LibraryEntry with the given name is not registered.
void te::core::LibraryManager::insert ( const LibraryEntry entry)

It inserts a LibraryEntry to the manager.

Parameters
entryLibraryEntry to be managed.
Exceptions
te::InvalidArgumentExceptionIf a LibraryEntry with the given name is already registered.
static LibraryManager& te::core::LibraryManager::instance ( )
static

It returns a reference to the singleton instance.

Returns
A reference to the singleton instance.
bool te::core::LibraryManager::isInitialized ( const std::string &  name)

The current state of the LibraryEntry.

Parameters
nameThe name of the LibraryEntry.
Returns
true if the LibraryEntry is initialized or false if isn't.
Exceptions
te::OutOfRangeExceptionIf a LibraryEntry with the given name is not registered.
LibraryManager& te::core::LibraryManager::operator= ( const LibraryManager )
protected
void te::core::LibraryManager::remove ( const std::string &  name)

It removes a LibraryEntry from the manager.

Parameters
nameThe name of the LibraryEntry.
Exceptions
te::OutOfRangeExceptionIf a LibraryEntry with the given name is not registered.,
te::ExceptionIf trying to remove a initialized library.

Member Data Documentation

Impl* te::core::LibraryManager::m_pimpl
private

Definition at line 154 of file LibraryManager.h.


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