summaryrefslogtreecommitdiff
path: root/include/CommonAPI/Address.hpp
blob: bf21f6530b1ea99a9b9f851a2a18fede697e7ca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef COMMONAPI_ADDRESS_HPP_
#define COMMONAPI_ADDRESS_HPP_

#include <iostream>
#include <string>

#include <CommonAPI/Export.hpp>

namespace CommonAPI {

class Address {
public:
    COMMONAPI_EXPORT Address();
    COMMONAPI_EXPORT Address(const std::string &_address);
    COMMONAPI_EXPORT Address(const std::string &_domain,
            const std::string &_interface,
            const std::string &_instance);
    COMMONAPI_EXPORT Address(const Address &_source);
    COMMONAPI_EXPORT virtual ~Address();

    COMMONAPI_EXPORT bool operator==(const Address &_other) const;
    COMMONAPI_EXPORT bool operator!=(const Address &_other) const;
    COMMONAPI_EXPORT bool operator<(const Address &_other) const;

    COMMONAPI_EXPORT std::string getAddress() const;
    COMMONAPI_EXPORT void setAddress(const std::string &_address);

    COMMONAPI_EXPORT const std::string &getDomain() const;
    COMMONAPI_EXPORT void setDomain(const std::string &_domain);

    COMMONAPI_EXPORT const std::string &getInterface() const;
    COMMONAPI_EXPORT void setInterface(const std::string &_interface);

    COMMONAPI_EXPORT const std::string &getInstance() const;
    COMMONAPI_EXPORT void setInstance(const std::string &_instance);

private:
    std::string domain_;
    std::string interface_;
    std::string instance_;

    friend COMMONAPI_EXPORT std::ostream &operator<<(std::ostream &_out, const Address &_address);
};

} // namespace CommonAPI

#endif // COMMONAPI_ADDRESS_HPP_