codegen.stamp: server.hxx $(top_builddir)/codegen/codegen
cp $(top_srcdir)/codegen/codegen-stubhead.hxx codegen_common.hxx
# todo use tmp file for server.xml
- gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) server.hxx -fxml=server.xml
- $(top_builddir)/codegen/codegen server.xml codegen_
+ gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $< -fxml=server.xml
+ $(top_builddir)/codegen/codegen $< server.xml codegen_
touch codegen.stamp
codegen_common.hxx codegen_common.cpp codegen_client.hxx codegen_client.cpp codegen_server.cpp: codegen.stamp
&& ( cc.testfunc_ref("hello") == "hello, testfunc() was here" )
&& ( cc.t2(10) == 10 )
&& ( cc_other.t3(10, 20, "hello", std::pair<int, float>(10,20)) )
- && ( cc_other.t3(10) == 10 ) )
+ && ( cc_other.t3(10) == 10 )
+ && ( cc_other.t3(std::vector<int>(1,10)) ) )
? EXIT_SUCCESS : EXIT_FAILURE;
}
#include <string>
+// serialization of string
+#include <boost/serialization/string.hpp>
+// serialization of pair
+#include <boost/serialization/utility.hpp>
+
+// std::vector
+#include <vector>
+#include <boost/serialization/vector.hpp>
+
#include "codegen_common.hxx"
LIBT2N_SET_DEFAULTGROUP(default);
+//! test pass by copy
LIBT2N_EXPORT std::string testfunc(std::string str)
{
std::string ret;
return ret;
}
+//! test pass by const reference
LIBT2N_EXPORT std::string testfunc_ref(const std::string &str)
{
std::string ret;
return ret;
}
+//! test builtin type
LIBT2N_EXPORT int t2(int i)
{
return i;
using namespace std;
+//! test pair, multiple arguments and namespace
LIBT2N_EXPORT_GROUP(other) bool t3(int i, float f, const string &s, const pair<int, float> &p)
{
return (i==p.first) && (f==p.second) && (s=="hello");
}
+//! test function overload
LIBT2N_EXPORT_GROUP(other) int t3(int i)
{
return i;
}
+
+//! test std::vector
+LIBT2N_EXPORT_GROUP(other) bool t3(const std::vector<int> &i)
+{
+ return (i.size()==1) && (i[0]==10);
+}