Examples of UDFs using C++

I have been able to use and extend the example UDFs with a few minor tweaks. However, I wanted to know if there are any examples of implementing UDFs with C++?

It would be great if the same udfexample.c were setup as a pure udfexample.cpp example with the appropriate directions for compiling and showing what was necessary to pass the same information back and forth using C++ datatypes as well as implementing UdfLog functionality, etc using pure c++ functionality.


you might use such declaration for you C++ function like in udfexample.cpp

@@ -23,7 +23,7 @@
 #define snprintf _snprintf
 #define DLLEXPORT __declspec(dllexport)
-#define DLLEXPORT
+#define DLLEXPORT extern "C"

this way it will compiles well as C++ code g++ -fPIC -shared -o udfexample.so ../src/udfexample.cpp and later could be used as UDF with daemon

Thanks. I but that part I already had. It was the casting of c++ variables that concerned me. But, I have been able to get that to work.

Thanks again.