X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=example-codegen%2Fserver.hxx;h=c69a9d59acf74d44a491d8c27acc4cf041a6b9d8;hp=027e31338746ca8c01daaf97ac9ed4255ef94f5a;hb=472456caf92ef55f7ab344e8b0087d64c8701e23;hpb=86c1c2e9dcdced7022bc2b979a4b580946802410 diff --git a/example-codegen/server.hxx b/example-codegen/server.hxx index 027e313..c69a9d5 100644 --- a/example-codegen/server.hxx +++ b/example-codegen/server.hxx @@ -1,13 +1,23 @@ #include #include "codegen_common.hxx" -using namespace std; - -LIBT2N_SET_DEFAULTGROUP(example); +LIBT2N_SET_DEFAULTGROUP(default); LIBT2N_EXPORT std::string testfunc(std::string str) { - string ret; + std::string ret; + if (str=="throw") + throw libt2n::t2n_runtime_error("throw me around"); + if (str=="big") + ret.insert(0,100*1024,'x'); + else + ret=str+", testfunc() was here"; + return ret; +} + +LIBT2N_EXPORT std::string testfunc_ref(const std::string &str) +{ + std::string ret; if (str=="throw") throw libt2n::t2n_runtime_error("throw me around"); if (str=="big") @@ -16,3 +26,20 @@ LIBT2N_EXPORT std::string testfunc(std::string str) ret=str+", testfunc() was here"; return ret; } + +LIBT2N_EXPORT int t2(int i) +{ + return i; +} + +using namespace std; + +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"); +} + +LIBT2N_EXPORT_GROUP(other) int t3(int i) +{ + return i; +}