client_SOURCES = client.cpp
client_LDADD = $(LDADD) libclient.la
-server_SOURCES = server.cpp codegen_server.cpp
+server_SOURCES = server.cpp codegen_server.cpp foo.hxx
noinst_PROGRAMS = client server
# todo use tmp file for server.xml
gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $< -fxml=server.xml
$(top_builddir)/codegen/codegen $< server.xml codegen_
- touch codegen.stamp
+ touch $@
codegen_common.hxx codegen_common.cpp codegen_client.hxx codegen_client.cpp codegen_server.cpp: codegen.stamp
throwok=(std::string(e.what())=="throw me around");
}
+ Foo foo={10,10};
+
return ( throwok
&& ( cc.testfunc("hello") == "hello, testfunc() was here" )
&& ( 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(std::vector<int>(1,10)) ) )
+ && ( cc_other.t3(std::vector<int>(1,10)) )
+ && ( cc_other.t3(foo) ) )
? EXIT_SUCCESS : EXIT_FAILURE;
}
--- /dev/null
+#ifndef FOO_HXX
+#define FOO_HXX
+
+#include <boost/serialization/version.hpp>
+
+struct Foo
+{
+ int i,j;
+
+ friend class boost::serialization::access;
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int /* version */)
+ {
+ ar & BOOST_SERIALIZATION_NVP(i);
+ ar & BOOST_SERIALIZATION_NVP(j);
+ }
+};
+
+BOOST_CLASS_VERSION(Foo, 1)
+
+#endif
using namespace libt2n;
+bool t3(const Foo &foo)
+{
+ return (foo.i==foo.j);
+}
+
+
int main(int argc, char** argv) {
socket_server ss("./socket");
socket_server ss_other("./socket_other");
#include <vector>
#include <boost/serialization/vector.hpp>
+#include "foo.hxx"
+
#include "codegen_common.hxx"
LIBT2N_SET_DEFAULTGROUP(default);
{
return (i.size()==1) && (i[0]==10);
}
+
+//! test own type and seperate declaration and definition
+LIBT2N_EXPORT_GROUP(other) bool t3(const Foo &foo);