[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua-C++ Question
- From: TheGreat Guru <nikosbatsaras@...>
- Date: Mon, 25 Feb 2013 16:17:03 +0200
2013/2/25 Kevin Martin <kev82@khn.org.uk>:
> Can you write some Lua code as an example of what you're trying to achieve? I don't understand.
Imagine that (Prototype in C++):
// header.h
class base {
public:
base (....);
~base ();
void someFunction (...);
void SetterFunction (...);
void GetterFunction ();
int a, b, c;
};
class sub : base {
public:
sub (...) : base (...) {
//Some sub setters here !
}
~sub (...) {
// ....
}
void printString (...);
void someGetter ();
void someSetter (...);
int d, e, f;
};
Now , i want to be able to use it in LUA like this :
-- test.lua
a = NewBase (...)
a:someFunction (...)
a:SetterFunction (...)
print ( a:GetterFunction () ) --Thats all i want lua to do with the
base class ...
b = NewSub (...)
b:someFunction (...)
b:SetterFunction (...)
print ( b:GetterFunction () ) --Now , that functions should be
available for b object BUT i want to be able to write :
b:printString (...)
b:someSetter (...)
b:someGetter (...) -- also !!!
If someone can provide a sample code for this , it WILL be appreciated
!!! Sorry for the newbie questions !
Again thanks for answering !!!