Class ModuleImporter

Class Documentation

class ModuleImporter

Base class that defines an interface for importing Python modules.

The default implementation (defined in the source file) simply returns false, indicating that it can’t import the given module. The functional implementation is in the ioLib Swig module, which is installed when that module is imported. That machinery keeps us from calling Python C-API functions from standalone C++ binaries that aren’t linked with Python.

Public Functions

ModuleImporter(const ModuleImporter&)
ModuleImporter &operator=(const ModuleImporter&)
ModuleImporter(ModuleImporter&&)
ModuleImporter &operator=(ModuleImporter&&)

Public Static Functions

static bool import(std::string const &name)

Import the given Python module, and return true if successful.

Protected Functions

ModuleImporter()
virtual bool _import(std::string const &name) const = 0
virtual ~ModuleImporter()