te::common::LibraryManager Class Reference

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

#include <LibraryManager.h>

Inheritance diagram for te::common::LibraryManager:
te::common::Singleton< LibraryManager >

Public Member Functions

void add (const std::string &id, const LibraryPtr &l) throw ()
 It adds a new Library to be managed. More...
 
LibraryPtr find (const std::string &name) throw ()
 Returns a null pointer if a library doesnt't exist. More...
 

Static Public Member Functions

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

Protected Member Functions

 LibraryManager ()
 Consructor. More...
 
 ~LibraryManager ()
 Destructor. More...
 

Private Attributes

Impl * m_pImpl
 A pointer to the real implementation. More...
 

Friends

class Singleton< LibraryManager >
 

Detailed Description

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

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

Definition at line 56 of file LibraryManager.h.

Constructor & Destructor Documentation

te::common::LibraryManager::LibraryManager ( )
protected

Consructor.

te::common::LibraryManager::~LibraryManager ( )
protected

Destructor.

Member Function Documentation

void te::common::LibraryManager::add ( const std::string &  id,
const LibraryPtr l 
)
throw (
)

It adds a new Library to be managed.

This implementaion will keep the library in the manager while there is at least someone pointing to it. As soon as no one keeps a reference to it the manager will be communicated and the library will not be available anymore.

Parameters
idAn identifier used to search for the library in successive lookups.
lThe library to be managed.
LibraryPtr te::common::LibraryManager::find ( const std::string &  name)
throw (
)

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

Parameters
nameThe library name.
Returns
A pointer to an already loaded library or null.
static LibraryManager & te::common::Singleton< LibraryManager >::getInstance ( )
staticinherited

It returns a reference to the singleton instance.

Returns
A reference to the singleton instance.

Friends And Related Function Documentation

friend class Singleton< LibraryManager >
friend

Definition at line 58 of file LibraryManager.h.

Member Data Documentation

Impl* te::common::LibraryManager::m_pImpl
private

A pointer to the real implementation.

Definition at line 95 of file LibraryManager.h.


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