X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=example-codegen%2Fserver.hxx;h=16068a06d30f03d9c9f0587b76088b686a053b5d;hp=ccca538ec00498549601a511c3e15702279e1131;hb=6f6d24c02ef3e3a7600432bed1c801a611c3c918;hpb=29ba0e9777f576fa318decb2915bf8895bf233eb diff --git a/example-codegen/server.hxx b/example-codegen/server.hxx index ccca538..16068a0 100644 --- a/example-codegen/server.hxx +++ b/example-codegen/server.hxx @@ -1,8 +1,20 @@ #include +// serialization of string +#include +// serialization of pair +#include + +// std::vector +#include +#include + +#include "foo.hxx" + #include "codegen_common.hxx" -LIBT2N_SET_DEFAULTGROUP(example); +LIBT2N_SET_DEFAULTGROUP(default); +//! test pass by copy LIBT2N_EXPORT std::string testfunc(std::string str) { std::string ret; @@ -15,6 +27,7 @@ LIBT2N_EXPORT std::string testfunc(std::string str) return ret; } +//! test pass by const reference LIBT2N_EXPORT std::string testfunc_ref(const std::string &str) { std::string ret; @@ -27,6 +40,7 @@ LIBT2N_EXPORT std::string testfunc_ref(const std::string &str) return ret; } +//! test builtin type LIBT2N_EXPORT int t2(int i) { return i; @@ -34,7 +48,23 @@ LIBT2N_EXPORT int t2(int 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 &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 &i) +{ + return (i.size()==1) && (i[0]==10); +} + +//! test own type and seperate declaration and definition +LIBT2N_EXPORT_GROUP(other) bool t3(const Foo &foo);