Hopsan
LoadExternal Class Reference

This class handles loading and unloading of external component and node libs. More...

#include <LoadExternal.h>

Public Member Functions

 LoadExternal (ComponentFactory *pComponentFactory, NodeFactory *pNodefactory, HopsanCoreMessageHandler *pMessenger)
 This function loads a library with given path.
 
bool load (const HString &rLibpath)
 
bool unLoad (const HString &rLibpath)
 This function unloads a library and its components and nodes.
 
void setFactory ()
 
void getLoadedLibNames (std::vector< HString > &rLibNames)
 
void getLibContents (const HString &rLibpath, std::vector< HString > &rComponents, std::vector< HString > &rNodes)
 Returns the components and nodes registered by specified library.
 
void getLibPathByTypeName (const HString &rTypeName, HString &rLibPath)
 Returns library path (to dll or so file) for a component type.
 

Detailed Description

This class handles loading and unloading of external component and node libs.

Member Function Documentation

◆ getLibContents()

void getLibContents ( const HString & rLibpath,
std::vector< HString > & rComponents,
std::vector< HString > & rNodes )

Returns the components and nodes registered by specified library.

Parameters
[in]rLibpathPath to library
[out]rComponentsReference to vector with the loaded component type names
[out]rNodesReference to vector with the loaded node type names

◆ getLibPathByTypeName()

void getLibPathByTypeName ( const HString & rTypeName,
HString & rLibPath )

Returns library path (to dll or so file) for a component type.

Parameters
[in]rTypeNameType name to look for
[out]rLibPathReference to string where lib path is stored

◆ unLoad()

bool unLoad ( const HString & rLibpath)

This function unloads a library and its components and nodes.