summaryrefslogtreecommitdiff
path: root/implementation/service_discovery/include/subscription.hpp
blob: 25df7b38ea7f2311e9420403c712610fd7ff978c (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
53
54
// Copyright (C) 2014-2015 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 VSOMEIP_SD_SUBSCRIPTION_HPP
#define VSOMEIP_SD_SUBSCRIPTION_HPP

#include <memory>

#include <vsomeip/primitive_types.hpp>
#include <vsomeip/enumeration_types.hpp>

namespace vsomeip {

class endpoint;

namespace sd {

class subscription {
public:
    subscription(major_version_t _major, ttl_t _ttl,
            std::shared_ptr<endpoint> _reliable,
            std::shared_ptr<endpoint> _unreliable,
            subscription_type_e _subscription_type);
    ~subscription();

    major_version_t get_major() const;
    ttl_t get_ttl() const;
    void set_ttl(ttl_t _ttl);
    std::shared_ptr<endpoint> get_endpoint(bool _reliable) const;
    void set_endpoint(std::shared_ptr<endpoint> _endpoint, bool _reliable);

    bool is_acknowledged() const;
    void set_acknowledged(bool _is_acknowledged);

    subscription_type_e get_subscription_type() const;

private:
    major_version_t major_;
    ttl_t ttl_;

    std::shared_ptr<endpoint> reliable_;
    std::shared_ptr<endpoint> unreliable_;

    bool is_acknowledged_;

    subscription_type_e subscription_type_;
};

} // namespace sd
} // namespace vsomeip

#endif // VSOMEIP_SD_SUBSCRIPTION_HPP