]> Creatis software - creaCLI.git/blob - bbtk_Slicer_PKG/src/bbSlicerModuleWrapper.h
bbtk-Slicer Module JGRR
[creaCLI.git] / bbtk_Slicer_PKG / src / bbSlicerModuleWrapper.h
1 #ifndef __bbSlicerModuleWrapper_h_INCLUDED__
2 #define __bbSlicerModuleWrapper_h_INCLUDED__
3
4 #include "bbSlicer_EXPORT.h"
5 #include "bbtkAtomicBlackBox.h"
6 #include "iostream"
7
8
9 #include <vector>
10 #include <cstdlib>
11 #include <dlfcn.h>
12 #include <sstream>
13 #include <iostream>
14
15
16 #include <ModuleDescriptionParser.h>
17 #include <ModuleParameterGroup.h>
18 #include <ModuleDescription.h>
19 #include <ModuleParameter.h>
20
21 #include <fstream>
22 #include <ModuleDescriptionUtilities.h>
23
24 #include "CreationTool.h"
25
26 namespace bbSlicer {
27
28     class bbSlicer_EXPORT ModuleWrapper
29     :
30     public bbtk::AtomicBlackBox {
31         BBTK_BLACK_BOX_INTERFACE ( ModuleWrapper , bbtk::AtomicBlackBox ) ;
32         BBTK_DECLARE_INPUT ( Path_to_library , std::string ) ;
33         BBTK_DECLARE_INPUT ( Path_to_souce , std::string ) ;
34         BBTK_PROCESS ( Process ) ;
35         void Process ( ) ;
36     private:
37         ///     STD LD_OPEN CALLS       ///
38
39         char* getModuleDescription ( std::string lib ) ;
40
41         ///     FILE RELATED     ///
42
43         void saveFile ( std::string content , std::string file_name ) ;
44         std::string loadFile ( std::string filename ) ;
45         std::string loadDummyHeader ( ) ;
46         std::string loadDummyBody ( ) ;
47
48         ///     BBTK BOX CREATION       /// 
49
50         std::string updateProcessMethod ( const ModuleDescription* module , std::string content , std::string lib ) ;
51         std::string updateBoxDescription ( const ModuleDescription* module , std::string _header ) ;
52         std::string updateBoxInputs ( const ModuleDescription* module , std::string content ) ;
53         std::string updateBoxName ( const ModuleDescription* module , std::string content ) ;
54         const int getNumberOfArguments ( const ModuleDescription* module ) ;
55         std::string getHeaderFileName ( const ModuleDescription* module ) ;
56         std::string getBodyFileName ( const ModuleDescription* module ) ;
57
58     } ;
59
60     BBTK_BEGIN_DESCRIBE_BLACK_BOX ( ModuleWrapper , bbtk::AtomicBlackBox ) ;
61     BBTK_NAME ( "ModuleWrapper" ) ;
62     BBTK_AUTHOR ( "Juan Gabriel Riveros" ) ;
63     BBTK_DESCRIPTION ( "Interoperability Module" ) ;
64     BBTK_CATEGORY ( "Interoperability Module" ) ;
65     BBTK_INPUT ( ModuleWrapper , Path_to_library , "Shared library full path" , std::string , "" ) ;
66     BBTK_INPUT ( ModuleWrapper , Path_to_souce , "Slicer Interoperability pkg source directory" , std::string , "" ) ;
67     BBTK_END_DESCRIBE_BLACK_BOX ( ModuleWrapper ) ;
68
69 }
70 // EO namespace bbSlicer
71
72 #endif // __bbSlicerModuleWrapper_h_INCLUDED__
73