|
maci::LibraryManager − |
|
#include <maciLibraryManager.h> |
|
Classes |
|
struct LibraryInfo |
|
Structure to store data about loaded libraries. |
|
Public Types |
|
typedef bool(* DLLOpenFunc )(int argc, char *argv[]) |
|
typedef void(* DLLCloseFunc )(void) |
|
typedef void(* DLLSetupCORBAFunc )(CORBA::ORB_ptr m_orb, PortableServer::POAManager_ptr m_poaManager, PortableServer::POA_ptr m_poaRoot, PortableServer::POA_ptr m_poaPersistent, PortableServer::POA_ptr m_poaTransient) |
|
typedef void(* DLLInitThreadsFunc )(InitThreadFunc initFunc, DoneThreadFunc doneFunc) |
|
Public Member Functions |
|
LibraryManager () |
|
~LibraryManager () |
|
void setSearchPath (const char *path) |
|
const char * getSearchPath () |
|
void closeAllLibraries (bool inform=true) |
|
char * locateLibrary (const char *name) |
|
void lock (int h) |
|
void unlock (int h) |
|
int load (const char *path, int argc=0, char *argv[]=0) |
|
void unload (int h) |
|
void unload (const char *name) |
|
void * getSymbol (int h, const char *symbol) |
|
bool setupCORBAinDLL (int handle, CORBA::ORB_ptr m_orb, PortableServer::POAManager_ptr m_poaManager, PortableServer::POA_ptr m_poaRoot, PortableServer::POA_ptr m_poaPersistent, PortableServer::POA_ptr m_poaTransient) |
|
bool initThreadsInDLL (int handle, InitThreadFunc initFunc, DoneThreadFunc doneFunc) |
|
Private Member Functions |
|
int ldfind (const ACE_TCHAR filename[], ACE_TCHAR pathname[], size_t maxpathnamelen) |
|
Logging::Logger::LoggerSmartPtr getLogger () |
|
Private Attributes |
|
Registrar< int, LibraryInfo > m_libraries |
|
Data about all loadrd libraries. |
|
char * m_path |
|
Search path. |
|
ACE_Recursive_Thread_Mutex mutex |
|
Thread synchornization mutex. |
|
Logging::Logger::LoggerSmartPtr logger_m |
|
Logger for this container;. |
|
Class responsible of loading/unloading of dynamic-linked/shared libraries |
|
typedef void(* maci::LibraryManager::DLLCloseFunc)(void) Declaration of the DLLClose function. A DLL that expects to be unloaded by the DLL Manager can export a function named ’DLLClose’. The DLL Manager then invokes this function just before it unloads the DLL. |
|
typedef void(* maci::LibraryManager::DLLInitThreadsFunc)(InitThreadFunc initFunc, DoneThreadFunc doneFunc) Declaration of the DLLInitThreads function. A DLL that expects to be loaded by the DLL Manager can export a function named ’DLLInitThreads’. The DLL Manager then invokes this function just after it loads the DLL. |
|
Parameters: |
|
m_orb |
|
typedef bool(* maci::LibraryManager::DLLOpenFunc)(int argc, char *argv[]) Declaration of the DLLOpen function. A DLL that expects to be loaded by the DLL Manager can export a function named ’DLLOpen’. The DLL Manager then invokes this function just after it loads the DLL. |
|
Parameters: |
|
argc number of arguments |
|
Returns: |
|
false on initialization failure (false indicates that DLL will be unloaded). |
|
typedef void(* maci::LibraryManager::DLLSetupCORBAFunc)(CORBA::ORB_ptr m_orb, PortableServer::POAManager_ptr m_poaManager, PortableServer::POA_ptr m_poaRoot, PortableServer::POA_ptr m_poaPersistent, PortableServer::POA_ptr m_poaTransient) Declaration of the DLLSetupCORBA function. A DLL that expects to be loaded by the DLL Manager can export a function named ’DLLSetupCORBA’. The DLL Manager then invokes this function just after it loads the DLL. |
|
Parameters: |
|
m_orb |
|
maci::LibraryManager::LibraryManager () Constructor |
|
maci::LibraryManager::~LibraryManager () Destructor |
|
void maci::LibraryManager::closeAllLibraries (bool inform = true) Close all currently opened libraries |
|
Parameters: |
|
inform if true DLLClose function will be called |
|
Logging::Logger::LoggerSmartPtr maci::LibraryManager::getLogger () [inline, private] Returns an ACS Logger created for this container. |
|
Returns: |
|
an ACS Logger |
|
References logger_m. |
|
const char* maci::LibraryManager::getSearchPath () [inline] Get path where to libraries can be found |
|
Parameters: |
|
path |
|
References m_path. |
|
void* maci::LibraryManager::getSymbol (int h, const char * symbol) Resolves symbol from the library |
|
Parameters: |
|
handle given by open method |
|
See also: |
|
open |
|
bool maci::LibraryManager::initThreadsInDLL (int handle, InitThreadFunc initFunc, DoneThreadFunc doneFunc) Calls ’DLLInitThreads’ in library with specified handle |
|
Parameters: |
|
handle |
|
Returns: |
|
true if successful |
|
int maci::LibraryManager::ldfind (const ACE_TCHAR filename[], ACE_TCHAR pathname[], size_t maxpathnamelen) [private] Search throuh search path(s) for library with given name |
|
Parameters: |
|
filename library name |
|
Returns: |
|
0 on success, -1 on failure |
|
int maci::LibraryManager::load (const char * path, int argc = 0, char * argv[] = 0) Loads library |
|
Parameters: |
|
path |
|
char* maci::LibraryManager::locateLibrary (const char * name) Get path of given library (e.g. ps returns /usr/lib/libps.so) |
|
Parameters: |
|
name ’core’ name of the library |
|
void maci::LibraryManager::lock (int h) Lock library (increase reference counter) |
|
Parameters: |
|
handle given by open method |
|
See also: |
|
open |
|
void maci::LibraryManager::setSearchPath (const char * path) Set path where to libraries can be found |
|
Parameters: |
|
path |
|
bool maci::LibraryManager::setupCORBAinDLL (int handle, CORBA::ORB_ptr m_orb, PortableServer::POAManager_ptr m_poaManager, PortableServer::POA_ptr m_poaRoot, PortableServer::POA_ptr m_poaPersistent, PortableServer::POA_ptr m_poaTransient) Calls ’DLLSetupCORBA’ in library with specified handle |
|
Parameters: |
|
handle |
|
Returns: |
|
true if successful |
|
void maci::LibraryManager::unload (const char * name) Forces to unload the library (ignoring existing references to this library) |
|
void maci::LibraryManager::unload (int h) Forces to unload the library (ignoring existing references to this library) |
|
void maci::LibraryManager::unlock (int h) Unlock library (decrease reference counter) |
|
Parameters: |
|
handle given by open method |
|
See also: |
|
open |
|
Logging::Logger::LoggerSmartPtr maci::LibraryManager::logger_m [private] |
|
Logger for this container;. Referenced by getLogger(). |
|
Registrar<int, LibraryInfo> maci::LibraryManager::m_libraries [private] |
|
Data about all loadrd libraries. |
|
char* maci::LibraryManager::m_path [private] |
|
Search path. Referenced by getSearchPath(). |
|
ACE_Recursive_Thread_Mutex maci::LibraryManager::mutex [private] |
|
Thread synchornization mutex. |
|
Generated automatically by Doxygen for ACS-2015.4 C++ API from the source code. |