te::core::LibraryManager Class Reference

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

#include <LibraryManager.h>

Classes

struct  Impl
 

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

Implm_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.

Definition at line 129 of file LibraryManager.cpp.

References m_pimpl.

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

Singleton destructor must be private or protected.

Definition at line 135 of file LibraryManager.cpp.

References m_pimpl.

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.

Definition at line 113 of file LibraryManager.cpp.

References te::core::LibraryManager::Impl::library_entries, and m_pimpl.

Referenced by insert().

const te::core::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.

Definition at line 86 of file LibraryManager.cpp.

References te::core::LibraryManager::Impl::library_entries, te::core::LibraryEntry::m_name, m_pimpl, and TE_TR.

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.

Definition at line 47 of file LibraryManager.cpp.

References exists(), te::core::LibraryManager::Impl::library_entries, te::core::LibraryEntry::m_name, m_pimpl, and TE_TR.

te::core::LibraryManager & te::core::LibraryManager::instance ( )
static

It returns a reference to the singleton instance.

Returns
A reference to the singleton instance.

Definition at line 122 of file LibraryManager.cpp.

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.

Definition at line 100 of file LibraryManager.cpp.

References te::core::LibraryManager::Impl::library_entries, te::core::LibraryEntry::m_initialized, te::core::LibraryEntry::m_name, m_pimpl, and TE_TR.

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.

Definition at line 60 of file LibraryManager.cpp.

References te::core::LibraryManager::Impl::library_entries, m_pimpl, and TE_TR.

Member Data Documentation

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

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