/[libvob]/libvob/include/vob/jni/Generate.hxx
ViewVC logotype

Diff of /libvob/include/vob/jni/Generate.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by tjl, Tue Apr 1 11:03:54 2003 UTC revision 1.19 by tjl, Fri Apr 4 12:34:59 2003 UTC
# Line 53  Generate.hxx Line 53  Generate.hxx
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    
# Line 126  namespace JNI { Line 130  namespace JNI {
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    
# Line 173  namespace JNI { Line 177  namespace JNI {
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++) {
# Line 215  namespace JNI { Line 218  namespace JNI {
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) {
# Line 238  namespace JNI { Line 241  namespace JNI {
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

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26