53 |
#include <vob/trans/Primitives.hxx> |
#include <vob/trans/Primitives.hxx> |
54 |
#include <vob/Transform.hxx> |
#include <vob/Transform.hxx> |
55 |
|
|
56 |
|
#include <vob/Templates.hxx> |
57 |
|
|
58 |
#include <vob/jni/Types.hxx> |
#include <vob/jni/Types.hxx> |
59 |
|
|
60 |
|
extern int getTransId() ; |
61 |
|
|
62 |
namespace Vob { |
namespace Vob { |
63 |
namespace JNI { |
namespace JNI { |
64 |
|
|
130 |
} |
} |
131 |
|
|
132 |
VobJNIGenerator(std::string name) { |
VobJNIGenerator(std::string name) { |
133 |
std::cout << name << "|" ; |
std::cout << "\t" << name << "\n" ; |
134 |
VobJavaParamList pl; |
VobJavaParamList pl; |
135 |
VobSeed().params(pl); |
VobSeed().params(pl); |
136 |
|
|
177 |
|
|
178 |
}; |
}; |
179 |
|
|
|
static int index; |
|
180 |
|
|
181 |
template<class Primitive> struct TransJNIGenerator { |
template<class Primitive> struct TransJNIGenerator { |
182 |
int ind; |
int ind; |
183 |
Primitives::PrimitiveHierarchicalTransform<Primitive> hier; |
Primitives::PrimitiveHierarchicalTransform<Primitive> hier; |
184 |
|
|
185 |
TransJNIGenerator(std::string className, std::string methodName) { |
TransJNIGenerator(std::string className, std::string methodName) { |
186 |
ind = index++; |
ind = getTransId(); |
187 |
VOB_TRANSJAVASTREAM << "public int "<<methodName |
VOB_TRANSJAVASTREAM << "public int "<<methodName |
188 |
<<"(int d0 "; |
<<"(int d0 "; |
189 |
for(int i=1; i<hier.getNDepends(); i++) { |
for(int i=1; i<hier.getNDepends(); i++) { |
218 |
|
|
219 |
VOB_TRANSJAVASTREAM << "}\n"; |
VOB_TRANSJAVASTREAM << "}\n"; |
220 |
|
|
221 |
VOB_TRANSCSTREAM << " case "<<ind<<": \n" |
VOB_JNISTREAM << "static HierFact<"<<className<<"> " |
222 |
<< "\t\tTRANSTYPE("<<className<<");break;\n"; |
<< className<<"__fac("<<ind<<");\n"; |
223 |
|
|
224 |
|
|
225 |
if(hier.getNParams() > 0) { |
if(hier.getNParams() > 0) { |
241 |
} |
} |
242 |
|
|
243 |
#define VOB_DEFINED(x) \ |
#define VOB_DEFINED(x) \ |
244 |
JNI::VobJNIGenerator<x> x##generator(#x); |
static Templates::IfTempl<!VOB_NON_LEAF, JNI::VobJNIGenerator<x> > x##generator(#x); |
245 |
|
|
246 |
|
|
247 |
#define VOB_PRIMITIVETRANS_DEFINED(x, n) \ |
#define VOB_PRIMITIVETRANS_DEFINED(x, n) \ |
248 |
JNI::TransJNIGenerator<x> x##generator(#x, n); |
static Templates::IfTempl<!VOB_NON_LEAF, JNI::TransJNIGenerator<x> > x##generator(#x, n); |
|
|
|
|
|
|
249 |
|
|
250 |
|
#ifndef VOB_NON_LEAF |
251 |
|
#define VOB_NON_LEAF 0 |
252 |
|
#endif |
253 |
|
|
254 |
#endif |
#endif |