X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=examples-codegen%2Fexample1%2Ft2nexample.cpp;fp=examples-codegen%2Fexample1%2Ft2nexample.cpp;h=8d5e1e6589e0d590404f0bcd4178dc11439355f6;hp=0000000000000000000000000000000000000000;hb=208db683069afb57aeb0ef0e6897c014b870bb6f;hpb=e8b2809dd8681076434fc2b7cb54b148c3b1cbcb diff --git a/examples-codegen/example1/t2nexample.cpp b/examples-codegen/example1/t2nexample.cpp new file mode 100644 index 0000000..8d5e1e6 --- /dev/null +++ b/examples-codegen/example1/t2nexample.cpp @@ -0,0 +1,11 @@ +// include automatically generated code +#include "t2nexample_common.hxx" + +//! example procedure to export (LIBT2N_EXPORT tells the code generator that we want to export this procedure) +LIBT2N_EXPORT std::string testfunc(std::string str) +{ + // exceptions derived from libt2n::t2n_exception are passed to the client transparently + if (str=="throw") + throw libt2n::t2n_runtime_error("throw me around"); + return str+", testfunc() was here"; +}