CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/FWCore/PythonParameterSet/src/initializeModule.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     PythonParameterSet
00004 // Class  :     initializeModule
00005 // 
00006 // Implementation:
00007 //     [Notes on implementation]
00008 //
00009 // Original Author:  Chris Jones
00010 //         Created:  Tue Jan 11 11:05:58 CST 2011
00011 // $Id: initializeModule.cc,v 1.1 2011/01/11 19:25:55 chrjones Exp $
00012 //
00013 
00014 // system include files
00015 
00016 // user include files
00017 #include "FWCore/PythonParameterSet/src/initializeModule.h"
00018 #include "FWCore/PythonParameterSet/src/PythonModule.h"
00019 
00020 
00021 //
00022 // constants, enums and typedefs
00023 //
00024 static bool s_initialized = false;
00025 
00026 namespace edm {
00027    namespace python {
00028       void initializeModule() {
00029          char *libFWCoreParameterSet = const_cast<char *>("libFWCoreParameterSet");
00030          PyImport_AppendInittab(libFWCoreParameterSet, &initlibFWCoreParameterSet );
00031          Py_Initialize();
00032          if(!s_initialized)
00033          {
00034             PyImport_ImportModule(libFWCoreParameterSet);
00035             s_initialized = true;
00036          }
00037          
00038       }
00039    }
00040 }