MIRA
Public Types | Static Public Member Functions | Static Protected Member Functions | List of all members
LibraryRegistry Class Reference

A registry for shared libraries. More...

#include <factory/LibraryRegistry.h>

Inheritance diagram for LibraryRegistry:
Inheritance graph
[legend]

Public Types

typedef std::map< std::string, LibraryInfoRegister
 
typedef Base::Type Type
 

Static Public Member Functions

static void registerManifest (const std::string &name, const LibraryVersion &version)
 Register library manifest. More...
 
static void registerLibrary (const std::string &name, const LibraryVersion &version)
 Register library is loaded. More...
 
static Register getRegister ()
 Get access to library register. More...
 
static Typeinstance ()
 Returns a reference to the singleton instance. More...
 
static bool isDestroyed ()
 Returns true, if the singleton was already destroyed. More...
 

Static Protected Member Functions

static TypemakeInstance ()
 
static void destroyInstance (void)
 

Detailed Description

A registry for shared libraries.

Each manifest is registered here, as well as each library that is loaded. Versions are checked to match between manifest and lib.

Member Typedef Documentation

◆ Register

typedef std::map<std::string, LibraryInfo > Register

◆ Type

typedef Base::Type Type
inherited

Member Function Documentation

◆ registerManifest()

static void registerManifest ( const std::string &  name,
const LibraryVersion version 
)
static

Register library manifest.

This is called by the ManifestAgent.

Exceptions
XFactoryLogicalIf library already has a manifest registered.
XFactoryLogicalIf library already loaded with different version.

◆ registerLibrary()

static void registerLibrary ( const std::string &  name,
const LibraryVersion version 
)
static

Register library is loaded.

This is called by library constructors. This does not throw (throwing from library constructors seems to cause problems). Instead, mismatched versions or multiple loads are shown as error messages.

◆ getRegister()

static Register getRegister ( )
inlinestatic

Get access to library register.

◆ instance()

static Type& instance ( )
inlinestaticinherited

Returns a reference to the singleton instance.

Exceptions
XLogicalIf the singleton was already destroyed (dead reference) or not yet created (when using ExplicitInstantiation).

◆ isDestroyed()

static bool isDestroyed ( )
inlinestaticinherited

Returns true, if the singleton was already destroyed.

Trying to access it will result in an exception.

◆ makeInstance()

static Type* makeInstance ( )
inlinestaticprotectedinherited

◆ destroyInstance()

static void destroyInstance ( void  )
inlinestaticprotectedinherited

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