libt2n: (gerd) some refactoring, documentation improvement
[libt2n] / src / client_wrapper.cpp
CommitLineData
a64066eb
GE
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
34#include <wrapper_handler_socket.hxx>
35
36namespace libt2n
37{
38
39class testme : public command_client
40{
41 public:
42
43 testme(client_connection &x, long long a, long long b)
44 : command_client(x,100000,10000)
45 { }
46
47 void helloworld(const std::string& text)
48 {
49 std::cout << "Hello world, " << text << std::endl;
50 }
51};
52
53const char* T2nSingletonWrapperMessages::NotInitializedMessage = "T2nSingletonWrapper used before setting initializing connection";
54
55typedef T2nSingletonWrapper<testme> wraptype;
56
57template<>
58std::auto_ptr<wraptype> wraptype::SingletonObject = std::auto_ptr<wraptype>();
59
60template<>
61std::auto_ptr<ConnectionWrapper> wraptype::WrappedConnection = std::auto_ptr<ConnectionWrapper>();
62
63void test(void)
64{
65
66
67 t2n_exec(&testme::helloworld)("gurke");
68
69}
70
71}