|Calling Scripting functions from C++|
Here is a list of all the aspects of using scripting functionallity from inside C++
This is a list of all the functionality that is complete and working.
|constructors||valueP result = c->global()["Number"](86.79);|
|objects||The result of the above expression|
|read properties||valueP pinf = result["POSITIVE_INFINITY"];|
Here are some things that will currently not work. Both of the below deficiencies arise because it is hard to implement non-intrusive general templated operator overloadings.
|write properties||result1["x"] = 8;|
|operators||result2 = result1["x"] + 98.1;|
You can still tweak this to make it work by applying the workarounds below:
|write properties as functions||result1["x"](8);|
|operators using wrapping||result2 = invoke_binary_operator<'+'>(result1["x"],wrap(98.1,c));|
Use especially the operator wrapping with care, as it may be replaced with a better mechanism in the future.
Copyright © 2003-2005 Peder Holt
Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.