X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=examples%2Fminimalistic-stub.hxx;fp=examples%2Fminimalistic-stub.hxx;h=78889894729472da767f784c1ccb92a972c2eb11;hp=0000000000000000000000000000000000000000;hb=db49c2f908cd5a007e21d27ba614eb4018f92efc;hpb=27cd718283ad61092e8bf1d874d8ce62e0131048 diff --git a/examples/minimalistic-stub.hxx b/examples/minimalistic-stub.hxx new file mode 100644 index 0000000..7888989 --- /dev/null +++ b/examples/minimalistic-stub.hxx @@ -0,0 +1,99 @@ +#ifndef MINIMALISTIC_STUB_HXX +#define MINIMALISTIC_STUB_HXX + + +/* + stubs to be generated + header is used by the client library and the server +*/ + +// todo: why do we have to include the boost headers first? +// do we have to know which archive format we will use? + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef _GCCXML__ +#define LIBT2P_EXPORT __attribute((gccxml("libt2n"))) +#else +#define LIBT2P_EXPORT +#endif + +class cmd_group_example : public libt2n::command +{ + private: + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int version) + { + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(libt2n::command); + } +}; + + +class testfunc_res : public libt2n::result +{ + private: + std::string res; + + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int version) + { + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(libt2n::result); + ar & BOOST_SERIALIZATION_NVP(res); + } + + public: + testfunc_res() + { } + + testfunc_res(const std::string& str) + { + res=str; + } + + std::string get_data() + { + return res; + } +}; + + +class testfunc_cmd : public cmd_group_example +{ + private: + std::string param; + + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int version) + { + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(cmd_group_example); + ar & BOOST_SERIALIZATION_NVP(param); + } + + public: + testfunc_cmd() + { } + + testfunc_cmd(const std::string& str) + { + param=str; + } + + libt2n::result* operator()(); +}; + +void +extended_type_info_test(); + +#endif