Commit | Line | Data |
---|---|---|
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 | ||
19 | typedef boost::shared_ptr<Logger> LoggerPtr; | |
20 | ||
4248e8ca TJ |
21 | class Service |
22 | { | |
2bc1878a | 23 | private: |
3a89ac31 BS |
24 | std::string Protocol; |
25 | std::string Hostname; | |
26 | std::string Login; | |
27 | std::string Password; | |
28 | ||
29 | LoggerPtr Log; | |
30 | ||
2bc1878a | 31 | int Lastupdated; |
2bc1878a BS |
32 | |
33 | friend class boost::serialization::access; | |
34 | template<class Archive> | |
35 | void serialize(Archive &, const unsigned int); | |
36 | ||
4545a371 BS |
37 | public: |
38 | Service(); | |
39 | ||
4248e8ca | 40 | virtual ~Service(); |
4545a371 | 41 | |
8bca3c5d | 42 | virtual void update(const std::string&)=0; |
4545a371 | 43 | |
3a89ac31 BS |
44 | void set_protocol(const std::string&); |
45 | std::string get_protocol(); | |
46 | ||
47 | void set_hostname(const std::string&); | |
48 | std::string get_hostname(); | |
49 | ||
50 | void set_login(const std::string&); | |
51 | std::string get_login(); | |
52 | ||
53 | void set_password(const std::string&); | |
54 | std::string get_password(); | |
55 | ||
56 | void set_logger(const LoggerPtr&); | |
57 | LoggerPtr get_logger(); | |
58 | ||
2bc1878a BS |
59 | void set_lastupdated(const int); |
60 | int get_lastupdated(); | |
61 | ||
3a89ac31 BS |
62 | bool operator== (const Service&) const; |
63 | bool operator!= (const Service&) const; | |
4545a371 BS |
64 | }; |
65 | ||
66 | #endif |