gramods
Loading...
Searching...
No Matches
gramods::gmCore::ImportLibrary Class Reference

Loads a shared library and loads its nodes into the object factory. More...

#include <ImportLibrary.hh>

Inheritance diagram for gramods::gmCore::ImportLibrary:
Collaboration diagram for gramods::gmCore::ImportLibrary:

Classes

struct  Impl

Public Member Functions

bool isLoaded ()
 Check if the library has been successfully loaded.
void initialize () override
 Called to initialize the Object.
void setLibraryFile (std::filesystem::path path)
 Set full path to library file.
void setLibrary (std::string file)
 Set name of library, used to create the name of the file.
void setPrefix (std::string str)
 Set a string to prepend to the library name.
void setSuffix (std::string str)
 Set a string to append to the library name.
void setDbgSuffix (std::string str)
 Set a string to append to the library name, before the file suffix.
void * getSymbol (std::string name)
 Retrieves the symbol/procedure address from the loaded library.
Public Member Functions inherited from gramods::gmCore::Object
 Object ()
 Initializes internal data.
virtual ~Object ()
 Cleaning up internal data.
virtual void accept (Visitor *visitor)
 Calls the visitors apply method with this as argument.
virtual void traverse (Visitor *visitor)
 Calls the child Object's accept method, if such exist.
virtual std::string getDefaultKey ()
 Returns the default key for the Object when automatically instantiated in a Configuration, i.e.
bool isInitialized ()
 Returns true if the Object is initialized.

Static Public Attributes

static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi

Detailed Description

Loads a shared library and loads its nodes into the object factory.

Member Function Documentation

◆ getSymbol()

void * gramods::gmCore::ImportLibrary::getSymbol ( std::string name)

Retrieves the symbol/procedure address from the loaded library.

◆ initialize()

void gramods::gmCore::ImportLibrary::initialize ( )
overridevirtual

Called to initialize the Object.

This should be called once only!

Reimplemented from gramods::gmCore::Object.

◆ isLoaded()

bool gramods::gmCore::ImportLibrary::isLoaded ( )

Check if the library has been successfully loaded.

◆ setDbgSuffix()

void gramods::gmCore::ImportLibrary::setDbgSuffix ( std::string str)

Set a string to append to the library name, before the file suffix.

Default is "-d" for debug build and an empty string for release.

◆ setLibrary()

void gramods::gmCore::ImportLibrary::setLibrary ( std::string file)

Set name of library, used to create the name of the file.

The filename is generated as prefix + library + suffix.

XML-attribute: library

◆ setLibraryFile()

void gramods::gmCore::ImportLibrary::setLibraryFile ( std::filesystem::path path)

Set full path to library file.

XML-attribute: libraryFile

◆ setPrefix()

void gramods::gmCore::ImportLibrary::setPrefix ( std::string str)

Set a string to prepend to the library name.

Default is "lib" on Linux and the empty string on Windows.

◆ setSuffix()

void gramods::gmCore::ImportLibrary::setSuffix ( std::string str)

Set a string to append to the library name.

Default is ".so" on Linux and ".dll" on Windows. Observe that this string includes the dot.


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