LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Static Public Member Functions | Protected Member Functions | Static Private Member Functions | Friends | List of all members
lsst.base::ModuleImporter Class Referenceabstract

Base class that defines an interface for importing Python modules. More...

#include <ModuleImporter.h>

Inheritance diagram for lsst.base::ModuleImporter:

Static Public Member Functions

static bool import (std::string const &name)
 Import the given Python module, and return true if successful. More...
 

Protected Member Functions

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

Static Private Member Functions

static void install (ModuleImporter const *importer)
 

Friends

void installPythonModuleImporter ()
 

Detailed Description

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.

Definition at line 48 of file ModuleImporter.h.

Constructor & Destructor Documentation

lsst.base::ModuleImporter::ModuleImporter ( )
inlineprotected

Definition at line 56 of file ModuleImporter.h.

56 {}
virtual lsst.base::ModuleImporter::~ModuleImporter ( )
inlineprotectedvirtual

Definition at line 60 of file ModuleImporter.h.

60 {}

Member Function Documentation

virtual bool lsst.base::ModuleImporter::_import ( std::string const &  name) const
protectedpure virtual
bool lsst.base::ModuleImporter::import ( std::string const &  name)
static

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

Definition at line 49 of file ModuleImporter.cc.

49  {
50  return getImporterSingleton()->_import(name);
51 }
table::Key< std::string > name
Definition: ApCorrMap.cc:71
void lsst.base::ModuleImporter::install ( ModuleImporter const *  importer)
staticprivate

Definition at line 53 of file ModuleImporter.cc.

53  {
54  getImporterSingleton() = importer;
55 }

Friends And Related Function Documentation

void installPythonModuleImporter ( )
friend

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