libt2n: (tomj) make compilable again
[libt2n] / src / client_wrapper.cpp
... / ...
CommitLineData
1/***************************************************************************
2 * Copyright (C) 2008 by Gerd v. Egidy *
3 * gve@intra2net.com *
4 * *
5 * This library is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU Lesser General Public License version *
7 * 2.1 as published by the Free Software Foundation. *
8 * *
9 * This library is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU Lesser General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 ***************************************************************************/
19
20#include <iostream>
21#include <string>
22
23#include <functional>
24
25#include <boost/any.hpp>
26#include <boost/bind.hpp>
27#include <boost/function.hpp>
28
29#include "../codegen/codegen-stubhead.hxx"
30
31
32#include <client_wrapper.hxx>
33
34namespace libt2n
35{
36
37class testme : public command_client
38{
39 public:
40
41 testme(client_connection &x, long long a, long long b)
42 : command_client(x,100000,10000)
43 { }
44
45 void helloworld(const std::string& text)
46 {
47 std::cout << "Hello world, " << text << std::endl;
48 }
49};
50
51const char* T2nSingletonWrapperMessages::NotInitializedMessage = "T2nSingletonWrapper used before setting initializing connection";
52
53typedef T2nSingletonWrapper<testme> wraptype;
54
55template<>
56std::auto_ptr<wraptype> wraptype::SingletonObject = std::auto_ptr<wraptype>();
57
58template<>
59std::auto_ptr<ConnectionWrapper> wraptype::WrappedConnection = std::auto_ptr<ConnectionWrapper>();
60
61void test(void)
62{
63
64
65 t2n_exec(&testme::helloworld)("gurke");
66
67}
68
69}