Started with boost/serialization error handling.
[bpdyndnsd] / src / service.h
CommitLineData
b1be615b 1/** @file
3a89ac31 2 * @brief The abstract service class. This class represents all services.
b1be615b
BS
3 *
4 *
5 *
6 * @copyright Intra2net AG
7 * @license GPLv2
8*/
9
4545a371
BS
10#ifndef SERVICE_H
11#define SERVICE_H
12
13#include <string>
14
2bc1878a
BS
15#include <boost/serialization/array.hpp>
16
3a89ac31
BS
17#include "logger.h"
18
19typedef boost::shared_ptr<Logger> LoggerPtr;
20
4248e8ca
TJ
21class Service
22{
2bc1878a 23private:
3a89ac31
BS
24 std::string Protocol;
25 std::string Hostname;
27baf279 26
3a89ac31
BS
27 std::string Login;
28 std::string Password;
29
27baf279 30 std::string Actual_IP;
3a89ac31 31
2bc1878a 32 int Lastupdated;
2bc1878a
BS
33
34 friend class boost::serialization::access;
35 template<class Archive>
36 void serialize(Archive &, const unsigned int);
37
27baf279
BS
38 LoggerPtr Log;
39
4545a371
BS
40public:
41 Service();
42
4248e8ca 43 virtual ~Service();
4545a371 44
8bca3c5d 45 virtual void update(const std::string&)=0;
4545a371 46
6d64d311
BS
47 virtual int get_timeout()=0;
48 virtual void set_timeout(const int)=0;
49
3a89ac31
BS
50 void set_protocol(const std::string&);
51 std::string get_protocol();
52
53 void set_hostname(const std::string&);
54 std::string get_hostname();
55
56 void set_login(const std::string&);
57 std::string get_login();
58
59 void set_password(const std::string&);
60 std::string get_password();
61
2bc1878a
BS
62 void set_lastupdated(const int);
63 int get_lastupdated();
64
27baf279
BS
65 void set_actual_ip(const std::string&);
66 std::string get_actual_ip();
67
68 void set_logger(const LoggerPtr&);
69 LoggerPtr get_logger();
70
3a89ac31
BS
71 bool operator== (const Service&) const;
72 bool operator!= (const Service&) const;
4545a371
BS
73};
74
75#endif