]> Creatis software - creaCLI.git/blob - bbtk_Slicer_PKG/src/bbSlicerDummy.dummy_cxx
bbtk-Slicer Module JGRR
[creaCLI.git] / bbtk_Slicer_PKG / src / bbSlicerDummy.dummy_cxx
1 #include "bbSlicerDummy.h"
2 #include "bbSlicerPackage.h"
3
4 namespace bbSlicer {
5     BBTK_ADD_BLACK_BOX_TO_PACKAGE ( Slicer, Dummy )
6     BBTK_BLACK_BOX_IMPLEMENTATION ( Dummy, bbtk::AtomicBlackBox );
7
8     void Dummy::Process ( ) {
9
10         // GENERATED
11 _33333_
12         // EO GENERATED
13         this->execute( lib, _argc, _argv );
14
15     }
16
17     void Dummy::execute ( std::string lib, int _argc, char * _argv[] ) {
18         void* handle = dlopen( lib.c_str( ), RTLD_NOW | RTLD_GLOBAL );
19         if ( ! handle ) {
20             std::cerr << "CAN'T OPEN LIBRARY: " << dlerror( ) << '\n';
21             return;
22         }
23         typedef int (*method_t )( int argc, char * argv[] );
24         // RESET ERROR
25         dlerror( );
26         // PROTOTYPE
27         method_t myMethod = ( method_t ) dlsym( handle, "ModuleEntryPoint" );
28         const char *dlsym_error = dlerror( );
29         if ( dlsym_error ) {
30             std::cerr << "CAN'T LOAD SYMBOL 'ModuleEntryPoint':" << dlsym_error << '\n';
31             dlclose( handle );
32             return;
33         }
34         // METHOD CALL
35         myMethod( _argc, _argv );
36         // CLOSING LIB
37         dlclose( handle );
38     }
39
40     void Dummy::bbUserSetDefaultValues ( ) {
41     }
42
43     void Dummy::bbUserInitializeProcessing ( ) {
44     }
45
46     void Dummy::bbUserFinalizeProcessing ( ) {
47     }
48 }
49 // EO namespace bbSlicer
50