41 |
#ifndef VOB_JNI_GENERATE_HXX |
#ifndef VOB_JNI_GENERATE_HXX |
42 |
#define VOB_JNI_GENERATE_HXX |
#define VOB_JNI_GENERATE_HXX |
43 |
|
|
44 |
|
#include <string> |
45 |
|
#include <cctype> |
46 |
|
#include <iostream> |
47 |
|
|
48 |
#include <boost/preprocessor/repetition/enum_binary_params.hpp> |
#include <boost/preprocessor/repetition/enum_binary_params.hpp> |
49 |
#include <boost/preprocessor/repetition/enum_params.hpp> |
#include <boost/preprocessor/repetition/enum_params.hpp> |
50 |
#include <boost/preprocessor/repetition/enum_shifted_params.hpp> |
#include <boost/preprocessor/repetition/enum_shifted_params.hpp> |
51 |
#include <boost/preprocessor/iteration/local.hpp> |
#include <boost/preprocessor/iteration/local.hpp> |
|
#include <string> |
|
|
#include <iostream> |
|
52 |
|
|
53 |
#include <vob/Primitives.hxx> |
#include <vob/Primitives.hxx> |
54 |
#include <vob/Transform.hxx> |
#include <vob/Transform.hxx> |
177 |
|
|
178 |
template<class Primitive> struct TransJNIGenerator { |
template<class Primitive> struct TransJNIGenerator { |
179 |
int ind; |
int ind; |
180 |
Primitives::HierarchicalTransform<Primitive> hier; |
Primitives::PrimitiveHierarchicalTransform<Primitive> hier; |
181 |
|
|
182 |
TransJNIGenerator(std::string className, std::string methodName) { |
TransJNIGenerator(std::string className, std::string methodName) { |
183 |
ind = index++; |
ind = index++; |
218 |
VOB_TRANSCSTREAM << " case "<<ind<<": \n" |
VOB_TRANSCSTREAM << " case "<<ind<<": \n" |
219 |
<< "\t\tTRANSTYPE("<<className<<");break;\n"; |
<< "\t\tTRANSTYPE("<<className<<");break;\n"; |
220 |
|
|
221 |
|
|
222 |
|
if(hier.getNParams() > 0) { |
223 |
|
std::string n = methodName; |
224 |
|
n[0] = std::toupper(n[0]); |
225 |
|
VOB_TRANSJAVASTREAM << "public void set"<<n |
226 |
|
<<"Params(int ind"; |
227 |
|
for(int i=0; i<hier.getNParams(); i++) |
228 |
|
VOB_TRANSJAVASTREAM << ", float p"<<i; |
229 |
|
VOB_TRANSJAVASTREAM<<") {\n"; |
230 |
|
VOB_TRANSJAVASTREAM<<"int i = inds[ind+"<< |
231 |
|
(hier.getNDepends()+1)<<"];"; |
232 |
|
VOB_TRANSJAVASTREAM << passignCode.str() << "}\n"; |
233 |
|
} |
234 |
} |
} |
235 |
}; |
}; |
236 |
|
|