|
50 | 50 | if stem.startswith(MIST_IN): |
51 | 51 | category = "inputs" |
52 | 52 | connector = stem[len(MIST_IN):] |
53 | | - class_name = "Mist::In" + connector |
| 53 | + class_name = "Mist::Input" + connector |
| 54 | + func_name = "InputMain" |
54 | 55 | elif stem.startswith(MIST_OUT): |
55 | 56 | category = "connectors" |
56 | 57 | connector = stem[len(MIST_OUT):] |
57 | 58 | class_name = "Mist::Out" + connector |
| 59 | + func_name = "OutputMain" |
58 | 60 | else: |
59 | 61 | raise Exception("unknown binary naming convention: " + stem) |
60 | 62 | capabilities.append({ |
|
63 | 65 | 'connector': connector, |
64 | 66 | 'class_name': class_name, |
65 | 67 | 'binary_name' : stem, |
| 68 | + 'func_name': func_name, |
66 | 69 | }) |
67 | 70 |
|
68 | 71 | cap_lines = [ |
|
85 | 88 |
|
86 | 89 | entrypoint_lines = [] |
87 | 90 |
|
| 91 | +for header_file in header_files: |
| 92 | + entrypoint_lines.append('#include "' + header_file + '"') |
| 93 | + |
88 | 94 | entrypoint_lines.extend([ |
89 | 95 | '#include <mist/config.h>', |
90 | 96 | '#include <mist/defines.h>', |
91 | 97 | '#include <mist/socket.h>', |
92 | 98 | '#include <mist/util.h>', |
93 | 99 | '#include <mist/stream.h>', |
| 100 | + '#include "src/session.h"', |
| 101 | + '#include "src/controller/controller.h"', |
| 102 | + '#include "src/output/mist_out.cpp"', |
| 103 | + '#include "src/input/mist_in.cpp"', |
94 | 104 | ]) |
95 | 105 |
|
96 | | -for header_file in header_files: |
97 | | - entrypoint_lines.append('#include "' + header_file + '"') |
98 | 106 |
|
99 | 107 | entrypoint_lines.extend([ |
100 | | - '#include "src/output/mist_out.cpp"', |
101 | | - '#include "src/input/mist_in.cpp"', |
102 | | - '#include "src/session.cpp"', |
103 | | - '#include "src/controller/controller.cpp"', |
| 108 | + # '#include "src/output/mist_out.cpp"', |
| 109 | + # '#include "src/input/mist_in.cpp"', |
| 110 | + # '#include "src/session.cpp"', |
| 111 | + # '#include "src/controller/controller.cpp"', |
104 | 112 | 'int main(int argc, char *argv[]){', |
105 | 113 | ' if (argc < 2) {', |
106 | 114 | ' return ControllerMain(argc, argv);', |
|
121 | 129 | for cap in capabilities: |
122 | 130 | entrypoint_lines.extend([ |
123 | 131 | ' else if (strcmp(argv[1], "' + cap['binary_name'] + '") == 0) {', |
124 | | - ' return OutputMain<' + cap['class_name'] + '>(new_argc, new_argv);', |
| 132 | + ' return ' + cap['func_name'] +'<' + cap['class_name'] + '>(new_argc, new_argv);', |
125 | 133 | ' }', |
126 | 134 | ]) |
127 | 135 |
|
|
0 commit comments