On Sat, 26 Feb 2011, Bill Janssen wrote:

Think I've found an issue.  The class
com.parc.goodstuff.simple.HelloWorldService extends
simple.http.load.BasicService, and my JCC (2.7) chokes on it thusly:

build/_PPD/com/parc/goodstuff/simple/HelloWorld/HelloWorldService.h: At global 
scope:
build/_PPD/com/parc/goodstuff/simple/HelloWorld/HelloWorldService.h:22: error: 
?com::parc::goodstuff::simple::http? has not been declared

Looks like namespace confusion.  Toplevel 'simple' clashes with the
package 'com.parc.goodstuff.simple'.  Shouldn't line 22 say something
like

        class HelloWorldService : public ::simple::http::load::BasicService {

instead of

        class HelloWorldService : public simple::http::load::BasicService {

Quite likely, yes. The fix should be simple enough, albeit a bit of a pain to implement. Everywhere jcc uses '::' to join names together, in cpp.py and python.py, that code should be replaced with something that also prepends '::'. And, for consistency's sake, all hardcoded :: paths for system java classes should also use this syntax.

?  (Not sure that's valid C++, though :-).

I think it is.

Andi..


Here's the header file:

#ifndef com_parc_goodstuff_simple_HelloWorld_HelloWorldService_H
#define com_parc_goodstuff_simple_HelloWorld_HelloWorldService_H

#include "simple/http/load/BasicService.h"

namespace java {
   namespace lang {
       class Exception;
       class String;
       class Class;
   }
}
template<class T> class JArray;

namespace com {
 namespace parc {
   namespace goodstuff {
     namespace simple {
       namespace HelloWorld {

         class HelloWorldService : public simple::http::load::BasicService {
         public:
           enum {
             mid_main_4dd4540c,
             max_mid
           };

           static java::lang::Class *class$;
           static jmethodID *mids$;
           static jclass initializeClass();

           explicit HelloWorldService(jobject obj) : 
simple::http::load::BasicService(obj) {
             if (obj != NULL)
               initializeClass();
           }
           HelloWorldService(const HelloWorldService& obj) : 
simple::http::load::BasicService(obj) {}

           static void main(const JArray<java::lang::String>&);
         };
       }
     }
   }
 }
}

#include <Python.h>

namespace com {
 namespace parc {
   namespace goodstuff {
     namespace simple {
       namespace HelloWorld {
         extern PyTypeObject PY_TYPE(HelloWorldService);

         class t_HelloWorldService {
         public:
           PyObject_HEAD
             HelloWorldService object;
           static PyObject *wrap_Object(const HelloWorldService&);
           static PyObject *wrap_jobject(const jobject&);
           static void install(PyObject *module);
           static void initialize(PyObject *module);
         };
       }
     }
   }
 }
}

#endif

Reply via email to