| 1 | #include <string> |
| 2 | // serialization of string |
| 3 | #include <boost/serialization/string.hpp> |
| 4 | // serialization of pair |
| 5 | #include <boost/serialization/utility.hpp> |
| 6 | |
| 7 | // std::vector |
| 8 | #include <vector> |
| 9 | #include <boost/serialization/vector.hpp> |
| 10 | |
| 11 | #include "default_common.hxx" |
| 12 | |
| 13 | //! test pass by copy |
| 14 | LIBT2N_EXPORT std::string testfunc(std::string str) |
| 15 | { |
| 16 | std::string ret; |
| 17 | if (str=="throw") |
| 18 | throw libt2n::t2n_runtime_error("throw me around"); |
| 19 | if (str=="big") |
| 20 | ret.insert(0,100*1024,'x'); |
| 21 | else |
| 22 | ret=str+", testfunc() was here"; |
| 23 | return ret; |
| 24 | } |
| 25 | |
| 26 | //! test pass by const reference |
| 27 | LIBT2N_EXPORT std::string testfunc_ref(const std::string &str) |
| 28 | { |
| 29 | std::string ret; |
| 30 | if (str=="throw") |
| 31 | throw libt2n::t2n_runtime_error("throw me around"); |
| 32 | if (str=="big") |
| 33 | ret.insert(0,100*1024,'x'); |
| 34 | else |
| 35 | ret=str+", testfunc() was here"; |
| 36 | return ret; |
| 37 | } |
| 38 | |
| 39 | //! test builtin type |
| 40 | LIBT2N_EXPORT int t2(int i) |
| 41 | { |
| 42 | return i; |
| 43 | } |