lua-users home
lua-l archive

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

Am 08.07.2013 um 22:17 schrieb Justin Cormack:

On Mon, Jul 8, 2013 at 8:23 PM, Philipp Kraus
<> wrote:
I use Boost.MPI for communication only, no network socket.


Am 08.07.2013 um 20:22 schrieb Gabriel Duarte:

You can't use network sockets to do this instead?

It sounds to me like your best solution is to use an ffi type
solution, either the LuaJIT ffi, or luaffi or a libffi binding, as
these will let you do this (for structures with no pointers,
obviously). You could do the same with userdata but its less


That's a nice idea, but at the moment I'm in the planning phase, so
I plan to create a mapping between my C++ and LUA class, each LUA
class is point to a C++ class and all datatypes in the LUA object are
user defined pointers. I don't want to create a copy-by-value structure between
LUA and C++.
I haven't written a concept idea in LUA, so in the user-defined-pointer solution exists
the problem, if the user create in the LUA script class proberties, because my C++ don't see
these proberties and my data will be lost.

I my design the C++ class has got a serializable interface for Boost.MPI and I would like to store large
dataset in the class, so these datasets are pushed to LUA with a pointer (and functions). In the documentation
I have found this description:

Account = class(function(acc,balance)
              acc.balance = balance

But my C++ class does not know anything about balance. So can I grep / catch this proberty on C side?
I must read only the memory data of balance. So I would like to get access from C side to the LUA object