/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-45/test/test.cxx

Go to the documentation of this file.
00001 #include <iostream>
00002 #include <dlfcn.h>
00003 #include "MdcTrkRecon/MdcSegPatterns.h"
00004 
00005 int main() {
00006     using std::cout;
00007     using std::cerr;
00008 
00009     cout << "C++ dlopen demo\n\n";
00010 
00011     // open the library
00012     cout << "Opening MdcTrkRecon.so...\n";
00013     void* handle = dlopen("../rh73_gcc32/libMdcTrkRecon.so", RTLD_LAZY);
00014     
00015     if (!handle) {
00016         cerr << "Cannot open library: " << dlerror() << '\n';
00017         return 1;
00018     }
00019    
00020     MdcSegPatterns pat(true);
00021     for(int j=0;j<20;j++)std::cout<<pat.patt3[j]<<" "<<j<<std::endl;
00022     for(int i=0;i<256;i++){
00023        std::cout<<pat.npatt4[i]<<" "<<pat.npatt3[i]<<" "<<i<<std::endl; 
00024     }
00025 /*    // load the symbol
00026     cout << "Loading symbol hello...\n";
00027     typedef void (*hello_t)();
00028     hello_t hello = (hello_t) dlsym(handle, "hello");
00029     if (!hello) {
00030         cerr << "Cannot load symbol 'hello': " << dlerror() <<
00031             '\n';
00032         dlclose(handle);
00033         return 1;
00034     }
00035     
00036     // use it to do the calculation
00037     cout << "Calling hello...\n";
00038     hello();
00039 */    
00040     // close the library
00041     cout << "Closing library...\n";
00042     dlclose(handle);
00043 }
00044 

Generated on Tue Nov 29 22:58:02 2016 for BOSS_7.0.2 by  doxygen 1.4.7