luabind


lua-function as parameter for exported function


Is it possible to send lua-function to a main C++ program like this?
function a()
... -- do something
end
cpp_exported_function(a);
Or better, like this?
cpp_exported_function(function () .... end);
And how do I call it from the main program?
If it is possible - use lua table the same way. I mean exported_function(table);?
Yes - you'd have a C++ function that accepts a luabind::object as a parameter in both those cases. Luabind defines operator[] (for indexing a table) and operator() (for calling a function) for luabind::object for exactly that reason. See the documentation here: http://www.hci.iastate.edu/~rpavlik/doxygen/luabind/docs.html#object

Related Links

Luabind pure_out_value refuses to compile
Bind function returning btVector3 with luabind
how to bind a functor with more than one argument to lua using luabind
lua-function as parameter for exported function

Categories

HOME
xml
phpword
fpga
depth
composite-primary-key
apiblueprint
owl-carousel
ms-access-2016
interpolation
python-multithreading
lanczos
resultset
onedrive-api
selectize.js
glyphicons
html5-appcache
foreign-keys
googlebot
poedit
undertow
href
backpack-for-laravel
php-mysqlidb
zxing
gmock
interbase
custom-post-type
gp
mockjax
left-join
database-comparison
cart
laravel-eloquent
spring-security4
yowsup
processwire
connection-pool
recurrent-neural-network
verifiable-c
typesafe-config
chef-solo
numberpicker
photos
puredata
getchar
datamaps
posixct
remedy
reindex
custom-font
stdmap
reshape
flyout
rsa-archer-grc
reachability
visual-studio-2008-sp1
cronexpression
burrows-wheeler-transform
jodd
dup
avspeechsynthesizer
appscale
android-wake-lock
cortex-m
np-spring
jnlua
java-money
computer-architecture
django-urls
xvim
poppler
phonertc
haskell-warp
rdflib
apache-commons-daemon
cakephp-2.7
infosphere-spl
showdialog
jbake
filesplitting
imagefilter
strawberry-perl
angular-carousel
verold
lnk
extjs2
clickbank
ecslidingviewcontroller
light
route-provider
intersect
extreme-programming
fragmenttransaction
usertype
ilasm
pinch
drawtobitmap
massive
xui
maven-1
zend-rest
application-verifier
tabpanel
xpsdocument
todos
soappy
wspbuilder

Resources

Encrypt Message