summaryrefslogtreecommitdiffstats
path: root/src/bindings/swig/csharp
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2017-05-24 11:37:19 (GMT)
committerStefan Radomski <github@mintwerk.de>2017-05-24 11:37:19 (GMT)
commitbaa898789a2b70b4b969ac36a096c3fa77806ca5 (patch)
tree4ab1ddb575e7fec66fc9baf0abbc9560486370b2 /src/bindings/swig/csharp
parentd0dcc2cbec95f3bfae5da9ff07fc63833eb61342 (diff)
downloaduscxml-baa898789a2b70b4b969ac36a096c3fa77806ca5.zip
uscxml-baa898789a2b70b4b969ac36a096c3fa77806ca5.tar.gz
uscxml-baa898789a2b70b4b969ac36a096c3fa77806ca5.tar.bz2
CSharp bindings and regression tests
Diffstat (limited to 'src/bindings/swig/csharp')
-rw-r--r--src/bindings/swig/csharp/CMakeLists.txt15
-rw-r--r--src/bindings/swig/csharp/uscxml.i19
2 files changed, 20 insertions, 14 deletions
diff --git a/src/bindings/swig/csharp/CMakeLists.txt b/src/bindings/swig/csharp/CMakeLists.txt
index 966f740..fc07676 100644
--- a/src/bindings/swig/csharp/CMakeLists.txt
+++ b/src/bindings/swig/csharp/CMakeLists.txt
@@ -56,27 +56,30 @@ if (DMCS_EXECUTABLE OR CSC_EXECUTABLE)
# build managed code part
if (CSC_EXECUTABLE)
- ADD_CUSTOM_TARGET(csharp
+ ADD_CUSTOM_COMMAND( # ADD_CUSTOM_TARGET is always considered outdated
+ OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/uscxmlCSharp.dll
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_CURRENT_SOURCE_DIR}/org/uscxml/InterpreterException.cs ${PROJECT_BINARY_DIR}/src/bindings/swig/csharp/org/uscxml
COMMAND ${CSC_EXECUTABLE}
/target:library
/out:${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/uscxmlCSharp.dll
*.cs
- WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/bindings/swig/csharp/org/uscxml
- COMMENT "Creating umundoCSharp.dll for C# ...")
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/bindings/swig/csharp/org/uscxml
+ COMMENT "Creating uscxmlCSharp.dll for C# ...")
else()
- ADD_CUSTOM_TARGET(csharp
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/uscxmlCSharp.dll
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_CURRENT_SOURCE_DIR}/org/uscxml/InterpreterException.cs ${PROJECT_BINARY_DIR}/src/bindings/swig/csharp/org/uscxml
COMMAND ${DMCS_EXECUTABLE}
-target:library
/out:${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/uscxmlCSharp.dll
*.cs
- WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/bindings/swig/csharp/org/uscxml
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/bindings/swig/csharp/org/uscxml
COMMENT "Creating umundoCSharp.dll for Mono ...")
endif()
-
+ ADD_CUSTOM_TARGET(csharp DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/uscxmlCSharp.dll)
+
add_dependencies(csharp uscxmlNativeCSharp)
if (BUILD_TESTS)
add_dependencies(ALL_TESTS csharp)
diff --git a/src/bindings/swig/csharp/uscxml.i b/src/bindings/swig/csharp/uscxml.i
index ac154c5..154bda3 100644
--- a/src/bindings/swig/csharp/uscxml.i
+++ b/src/bindings/swig/csharp/uscxml.i
@@ -178,7 +178,6 @@ WRAP_TO_STRING(uscxml::InterpreterIssue);
// Beautify important classes
//***********************************************
-
// byte[] signature for Blob get/setData
// see http://permalink.gmane.org/gmane.comp.programming.swig/5804
@@ -216,6 +215,9 @@ WRAP_TO_STRING(uscxml::InterpreterIssue);
$result = (char *)result;
}
+%include "../uscxml_beautify.i"
+
+#if 0
%csmethodmodifiers uscxml::Event::getParamMap() "private";
@@ -228,7 +230,6 @@ WRAP_TO_STRING(uscxml::InterpreterIssue);
%csmethodmodifiers uscxml::Interpreter::getIOProcessors() "private";
%csmethodmodifiers uscxml::Data::getCompoundKeys() "private";
-%include "../uscxml_beautify.i"
%typemap(csimports) uscxml::Interpreter %{
using System;
@@ -241,7 +242,7 @@ using System.Runtime.InteropServices;
Dictionary<string, NativeIOProcessor> ioProcs = new Dictionary<string, NativeIOProcessor>();
StringVector keys = getIOProcessorKeys();
IOProcMap ioProcMap = getIOProcessorsNative();
- for (size_t i = 0; i < keys.Count; i++) {
+ for (int i = 0; i < keys.Count; i++) {
ioProcs[keys[i]] = ioProcMap[keys[i]];
}
return ioProcs;
@@ -251,7 +252,7 @@ using System.Runtime.InteropServices;
Dictionary<string, NativeInvoker> invokers = new Dictionary<string, NativeInvoker>();
StringVector keys = getInvokerKeys();
InvokerMap invokerMap = getInvokersNative();
- for (size_t i = 0; i < keys.Count; i++) {
+ for (int i = 0; i < keys.Count; i++) {
invokers[keys[i]] = invokerMap[keys[i]];
}
return invokers;
@@ -293,7 +294,7 @@ using System.Runtime.InteropServices;
Dictionary<string, Data> compound = new Dictionary<string, Data>();
DataMap dataMap = getCompoundNative();
StringVector dataMapKeys = getCompoundKeys();
- for (size_t i = 0; i < dataMapKeys.Count; i++) {
+ for (int i = 0; i < dataMapKeys.Count; i++) {
compound[dataMapKeys[i]] = dataMap[dataMapKeys[i]];
}
return compound;
@@ -310,7 +311,7 @@ using System.Runtime.InteropServices;
public List<Data> getArray() {
List<Data> arr = new List<Data>();
DataList dataList = getArrayNative();
- for (size_t i = 0; i < dataList.size(); i++) {
+ for (int i = 0; i < dataList.size(); i++) {
arr.Add(dataList.get(i));
}
return arr;
@@ -350,7 +351,7 @@ using System.Runtime.InteropServices;
foreach (KeyValuePair<string, DataList> entry in paramMap) {
DataList dataList = entry.Value;
List<Data> paramList = new List<Data>();
- for (size_t i = 0; i < dataList.size(); i++) {
+ for (int i = 0; i < dataList.size(); i++) {
Data data = dataList.get(i);
paramList.Add(data);
}
@@ -375,7 +376,7 @@ using System.Runtime.InteropServices;
Dictionary<string, Data> nameList = new Dictionary<string, Data>();
DataMap nameListMap = getNameListNative();
StringVector nameListMapKeys = getNameListKeys();
- for (size_t i = 0; i < nameListMapKeys.Count; i++) {
+ for (int i = 0; i < nameListMapKeys.Count; i++) {
nameList[nameListMapKeys[i]] = nameListMap[nameListMapKeys[i]];
}
return nameList;
@@ -390,6 +391,8 @@ using System.Runtime.InteropServices;
}
%}
+#endif
+
//***********************************************
// Parse the header file to generate wrappers
//***********************************************