X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=examples%2Fminimalistic-client-stub.cpp;fp=examples%2Fminimalistic-client-stub.cpp;h=b12b6423801165c2fc2ad64a1d421585a4919272;hp=0000000000000000000000000000000000000000;hb=db49c2f908cd5a007e21d27ba614eb4018f92efc;hpb=27cd718283ad61092e8bf1d874d8ce62e0131048 diff --git a/examples/minimalistic-client-stub.cpp b/examples/minimalistic-client-stub.cpp new file mode 100644 index 0000000..b12b642 --- /dev/null +++ b/examples/minimalistic-client-stub.cpp @@ -0,0 +1,24 @@ +#include "minimalistic-client-stub.hxx" +#include "minimalistic-stub.hxx" + +// fake +libt2n::result* testfunc_cmd::operator()() +{ + return NULL; +} + +std::string cmd_group_example_client::testfunc(const std::string& str) +{ + libt2n::result_container rc; + send_command(new testfunc_cmd(str),rc); + + testfunc_res* res=dynamic_cast(rc.get_result()); + if (!res) + throw libt2n::t2n_communication_error("result object of wrong type"); + return res->get_data(); +} + +// include in this compilation unit to ensure the compilation unit is used +// see also: +// http://www.google.de/search?q=g%2B%2B+static+initializer+in+static+library +#include "minimalistic-stub.cpp"