VICI  0.11.815
Visual Chart Interpreter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | List of all members
VICI::cfi::PlugInLib Class Reference

Manages an instance of a dynamically loaded shared library. More...

#include <vici/plugin.h>

Public Types

enum  Mode { AutoRun, OnDemand, StayResident }
 Control lifetime of the library. More...
 

Public Member Functions

 PlugInLib (const Path &libPath)
 Constructor. More...
 
 ~PlugInLib ()
 Destructor.
 
void setMode (Mode m)
 Set the lifetime for a plug-in. More...
 
Mode getMode ()
 Get the mode for the entire library. More...
 
bool loaded ()
 Check if successfully loaded the library. More...
 
void startUsage ()
 Indicate that the library is being used.
 
void endUsage ()
 Advise that a plug-in is no longer using the library.
 
bool inUse ()
 Test if the library is in use. More...
 
const VICI::PathgetPath ()
 Get the path to the library. More...
 

Detailed Description

Manages an instance of a dynamically loaded shared library.

This object is responsible for loading and unloading the library. It is also responsible for calling the initialisation and finalisation code within the library using the two extern "C" functions.

Note that a library may have more than one plug-in class defined, and these may even have different lifetimes.

Member Enumeration Documentation

Control lifetime of the library.

Enumerator
AutoRun 

The library can be removed after initialisation.

OnDemand 

The library can be removed once its unused.

StayResident 

The library is only removed on program termination.

Constructor & Destructor Documentation

PlugInLib::PlugInLib ( const Path libPath)

Constructor.

Parameters
libPathThe path to the shared library, from xini config

Member Function Documentation

Mode VICI::cfi::PlugInLib::getMode ( )
inline

Get the mode for the entire library.

Returns
The lifetime mode.
const VICI::Path& VICI::cfi::PlugInLib::getPath ( )
inline

Get the path to the library.

Returns
the library path
bool VICI::cfi::PlugInLib::inUse ( )
inline

Test if the library is in use.

Returns
True if a plug-in is still in active use.
bool PlugInLib::loaded ( )

Check if successfully loaded the library.

Returns
true if loaded OK
void PlugInLib::setMode ( Mode  m)

Set the lifetime for a plug-in.

This value is combined with the existing values to get a lifetime value for the overall library

Parameters
mThe mode for the plug-in

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