docu
[libt2n] / src / command.hxx
CommitLineData
7087e187
GE
1/***************************************************************************
2 * Copyright (C) 2006 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#ifndef __LIBT2N_COMMAND
20#define __LIBT2N_COMMAND
21
d184c648
GE
22#include <iostream>
23
7087e187 24#include <boost/serialization/serialization.hpp>
d184c648 25#include <boost/serialization/tracking.hpp>
7087e187
GE
26
27namespace libt2n
28{
29
30/** @brief base class for the results that are returned from commands.
31*/
32class result
33{
34 private:
35 friend class boost::serialization::access;
36 template<class Archive>
2f90dcbf 37 void serialize(Archive & /* ar */, const unsigned int /* version */)
7087e187
GE
38 { }
39
40 public:
41 result() {}
42 virtual ~result() {}
43};
44}
45//BOOST_IS_ABSTRACT(libt2n::result)
d184c648 46BOOST_CLASS_TRACKING(libt2n::result, boost::serialization::track_never)
7087e187
GE
47
48namespace libt2n
49{
50/** @brief a command that can be serialized. abstract.
51*/
52class command
53{
54 private:
55 friend class boost::serialization::access;
56 template<class Archive>
2f90dcbf 57 void serialize(Archive & /* ar */, const unsigned int /* version */)
a7170401 58 { }
7087e187
GE
59
60 public:
61 /// this calls the wanted target function on the server
d184c648 62 virtual result* operator()()=0;
7087e187
GE
63 virtual ~command() {}
64};
65} // namespace libt2n
66//BOOST_IS_ABSTRACT(libt2n::command)
d184c648 67BOOST_CLASS_TRACKING(libt2n::command, boost::serialization::track_never)
7087e187
GE
68
69
70#endif
71