client_wrapper.hxx, socket_wrapper.hxx: reorder member initialization order
[libt2n] / src / command.hxx
CommitLineData
19facd85
TJ
1/*
2Copyright (C) 2006 by Intra2net AG - Gerd v. Egidy
3
4The software in this package is distributed under the GNU General
5Public License version 2 (with a special exception described below).
6
7A copy of GNU General Public License (GPL) is included in this distribution,
8in the file COPYING.GPL.
9
10As a special exception, if other files instantiate templates or use macros
11or inline functions from this file, or you compile this file and link it
12with other works to produce a work based on this file, this file
13does not by itself cause the resulting work to be covered
14by the GNU General Public License.
15
16However the source code for this file must still be made available
17in accordance with section (3) of the GNU General Public License.
18
19This exception does not invalidate any other reasons why a work based
20on this file might be covered by the GNU General Public License.
21*/
7087e187
GE
22#ifndef __LIBT2N_COMMAND
23#define __LIBT2N_COMMAND
24
d184c648
GE
25#include <iostream>
26
7087e187 27#include <boost/serialization/serialization.hpp>
d184c648 28#include <boost/serialization/tracking.hpp>
7087e187
GE
29
30namespace libt2n
31{
32
33/** @brief base class for the results that are returned from commands.
34*/
35class result
36{
37 private:
38 friend class boost::serialization::access;
39 template<class Archive>
2f90dcbf 40 void serialize(Archive & /* ar */, const unsigned int /* version */)
7087e187
GE
41 { }
42
43 public:
44 result() {}
45 virtual ~result() {}
46};
47}
48//BOOST_IS_ABSTRACT(libt2n::result)
d184c648 49BOOST_CLASS_TRACKING(libt2n::result, boost::serialization::track_never)
7087e187
GE
50
51namespace libt2n
52{
53/** @brief a command that can be serialized. abstract.
54*/
55class command
56{
57 private:
58 friend class boost::serialization::access;
59 template<class Archive>
2f90dcbf 60 void serialize(Archive & /* ar */, const unsigned int /* version */)
a7170401 61 { }
7087e187
GE
62
63 public:
64 /// this calls the wanted target function on the server
d184c648 65 virtual result* operator()()=0;
7087e187
GE
66 virtual ~command() {}
67};
68} // namespace libt2n
69//BOOST_IS_ABSTRACT(libt2n::command)
d184c648 70BOOST_CLASS_TRACKING(libt2n::command, boost::serialization::track_never)
7087e187
GE
71
72
73#endif
74