gzz-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz] 13th, 14th (jvk)


From: Janne Kujala
Subject: [Gzz] 13th, 14th (jvk)
Date: Wed, 14 Aug 2002 17:41:08 +0300
User-agent: Mutt/1.2.5i

13th & 14th: texture work and debugging

We have many libraries with debug variables
that should be changable in run-time. 
I think we should have a simple library with java and 
c++ interfaces for managing the debug variables.

The low-level interface could be something like

namespace Debug {
  int& getInt(const char *name);
  int& setInt(const char *name, int val);

  std::vector<const char *> getVarNames();

  int& registerInt(const char *name, int *var);
}

Then, a debug variable could be defined and used as easily as 

        int &dbg = Debug::getInt("foobardebug");

                if(dbg) cout << "debug\n";

There is only a small overhead (from the & indirection)
in accessing the variable from c++, and jython code can 
gain access to the variable through the symbolic name.

It would also be possible to define variables as

        int dbg;
        Debug::registerInt("foobardebug", &dbg)

                if(dbg) cout << "debug\n";

and use them from c++ without any overhead, but then 
another registerInt call with the same variable name 
would disconnect the previous definition from the 
string-interface.

I'd like to implement the above idea, but there are
some questions that would need to be answered first:

- where could the library be placed in cvs?
- should it be only for debug variables or is there more 
  general use for it?
- what kind of conventions should be used for naming the 
  variables?
- is there any need for more structure in the set of variables?
- is there anything special that need to be taken into account
  when writing the jni interface?

        jvk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]