How do I handle primitive types?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How do I handle primitive types?

Alexander S. Usov

I use luabind to glue together a few big peaces of code (my own calculation
and a number of external libraries for minimization and plotting). Right now
I am stuck trying to figure out how do I convince luabind to handle some
exotic types, like "long long" of "float *".

Trying to directly wrap functions expecting/returning any of the above types
crashes the program somewhere deep in the luabind's guts.

In case of "long long" I just wrote a tiny wrapper, which converts it into
double, but this seems to be the wrong way, as I will need soon more of these
functions and wrapping each of them does not seems to be a right way.

The other, even bigger problem is how to convince luabind to pass things
like "float *" in an opaque way. As an example I have following method:
 int TNtuple::Fill(float*);
and the class called TArray, which I use to fill in array and want to feed in
into ntuple.
 float *TArray::GetArray();

On the lua side all I want is to be able to write something like
nt:Fill(ar:GetArray()) without crashing the things.

  I use beta7 version of luabind.

Best regards,

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
luabind-user mailing list
[hidden email]