00001 00002 // $Id: IoModuleStaticInitializer.cxx,v 1.1 2004/06/20 18:41:46 gmieg Exp $ 00003 // 00004 // Each class which inherits from JobModule has a JOBMODULE CPP macro 00005 // which instantiates a file-scope static class whose constructor 00006 // registers the particular JobModule in JobCModuleRegistry::fModLibMap, 00007 // which maps a JobModule identifier into the JobModule class name. 00008 // The identifiers for IoInputModule and IoOutputModule are "INPUT" and 00009 // "Output", respectively. These classes are instantiated dynamically 00010 // on demand via the JobCModuleRegistry::fModLibMap mapping. 00011 // 00012 // However, the UNIX standard does not specify that unreferenced statics 00013 // should necessarily be initialized when the library is loaded. While 00014 // Linux extends the standard to initialize such statics, MacOSX's 00015 // MACH-O loader strictly follows the standard in not initializing 00016 // unreferenced statics. This results in entries for the "INPUT" and 00017 // "Output" identifiers not appearing in JobCModuleRegistry::fModLibMap. 00018 // 00019 // The IoModuleStaticInitializer class forces initialization of static 00020 // objects in the IoInputModule.cxx and IoOutputModule.cxx files. The 00021 // IoModuleStaticInitializer class itself is never instantiated. The 00022 // initialization of statics in IoInputModule and IoOutputModule is 00023 // forced by the following parameter on the executable link line: 00024 // 00025 // -u _gsiomodulestaticinitializer 00026 // 00027 // G. Irwin 18 June 2004 00029 00030 #include "IoModules/IoInputModule.h" 00031 #include "IoModules/IoOutputModule.h" 00032 00033 class IoModuleStaticInitializer 00034 { 00035 00036 public: 00037 IoModuleStaticInitializer() { 00038 IoInputModule *iim = new IoInputModule; delete iim; 00039 IoOutputModule *iom = new IoOutputModule; delete iom; 00040 } 00041 virtual ~IoModuleStaticInitializer() {;} 00042 }; 00043 00044 IoModuleStaticInitializer gsiomodulestaticinitializer;
1.3.9.1