]> Creatis software - creaCLI.git/blob - bbtk_Slicer_PKG/src/bbSlicerSlicerLibToBlackBoxSrc.h
NOTES:
[creaCLI.git] / bbtk_Slicer_PKG / src / bbSlicerSlicerLibToBlackBoxSrc.h
1 #ifndef __bbSlicerSlicerLibToBlackBoxSrc_h_INCLUDED__
2 #define __bbSlicerSlicerLibToBlackBoxSrc_h_INCLUDED__
3 #include "bbSlicer_EXPORT.h"
4 #include "bbtkAtomicBlackBox.h"
5
6
7 #include <vector>
8
9 #include <cstdlib>
10 #include <sstream>
11 #include <iostream>
12 #include <fstream>
13
14 #include <stdio.h>
15 #include <dlfcn.h>
16 #include <string.h>
17 #include <dirent.h>
18
19 #include <ModuleDescriptionParser.h>
20 #include <ModuleParameterGroup.h>
21 #include <ModuleDescription.h>
22 #include <ModuleParameter.h>
23
24 #include <ModuleDescriptionUtilities.h>
25
26 #include "CreationTool.h"
27
28 namespace bbSlicer {
29
30     class bbSlicer_EXPORT SlicerLibToBlackBoxSrc
31     :
32     public bbtk::AtomicBlackBox {
33         BBTK_BLACK_BOX_INTERFACE ( SlicerLibToBlackBoxSrc , bbtk::AtomicBlackBox ) ;
34         BBTK_DECLARE_INPUT ( LibFullPath , std::string ) ;
35         BBTK_DECLARE_INPUT ( SrcDestinationDir , std::string ) ;
36         BBTK_PROCESS ( Process ) ;
37         void Process ( ) ;
38
39         ///     STD LD_OPEN CALLS       ///
40         char* getModuleDescription ( const std::string lib ) ;
41         ///     FILE RELATED     ///
42         void saveFile ( const std::string content , const std::string file_name ) ;
43         std::string loadFile ( const std::string filename ) ;
44         std::string loadDummyBody ( ) ;
45         std::string loadDummyHeader ( ) ;
46         ///     BBTK BOX CREATION       /// 
47         std::string updateBoxDescription ( const ModuleDescription* module , std::string _header ) ;
48         std::string updateBoxName ( const ModuleDescription* module , std::string content ) ;
49         std::string getHeaderFileName ( const ModuleDescription* module ) ;
50         std::string getBodyFileName ( const ModuleDescription* module ) ;
51         std::string updateBoxInputs ( const ModuleDescription* module , std::string content ) ;
52         const int getNumberOfArguments ( const ModuleDescription* module ) ;
53         std::string updateProcessMethod ( const ModuleDescription* module , std::string content , std::string lib ) ;
54         std::vector < std::string > getFilesByExtention ( std::string dir , std::string ext ) ;
55     } ;
56
57     BBTK_BEGIN_DESCRIBE_BLACK_BOX ( SlicerLibToBlackBoxSrc , bbtk::AtomicBlackBox ) ;
58     BBTK_NAME ( "SlicerLibToBlackBoxSrc" ) ;
59     BBTK_AUTHOR ( "Juan Gabriel RIVEROS REYES" ) ;
60     BBTK_DESCRIPTION ( "Creates a sigle bbtk box from a single slicers shared library The code generated by this box is intended for later compilation and plug in" ) ;
61     BBTK_CATEGORY ( "" ) ;
62     BBTK_INPUT ( SlicerLibToBlackBoxSrc , LibFullPath , "Library full path" , std::string , "" ) ;
63     BBTK_INPUT ( SlicerLibToBlackBoxSrc , SrcDestinationDir , "Source code destination directory" , std::string , "" ) ;
64     BBTK_END_DESCRIBE_BLACK_BOX ( SlicerLibToBlackBoxSrc ) ;
65
66 }
67
68 #endif 
69