summaryrefslogtreecommitdiff
path: root/implementation/service_discovery/include/service_discovery.hpp
blob: 38b414fef9f2a9d42d12e57b770bf2051872871f (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
// 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_SERVICE_DISCOVERY_HPP
#define VSOMEIP_SERVICE_DISCOVERY_HPP

#include <boost/asio/io_service.hpp>

#include <vsomeip/primitive_types.hpp>

namespace vsomeip {

class configuration;

namespace sd {

class service_discovery {
public:
    virtual ~service_discovery() {
    }

    virtual std::shared_ptr<configuration> get_configuration() const = 0;
    virtual boost::asio::io_service & get_io() = 0;

    virtual void init() = 0;
    virtual void start() = 0;
    virtual void stop() = 0;

    virtual void request_service(service_t _service, instance_t _instance,
            major_version_t _major, minor_version_t _minor, ttl_t _ttl) = 0;
    virtual void release_service(service_t _service, instance_t _instance) = 0;

    virtual void subscribe(service_t _service, instance_t _instance,
            eventgroup_t _eventgroup, major_version_t _major, ttl_t _ttl, client_t _client) = 0;
    virtual void unsubscribe(service_t _service, instance_t _instance,
            eventgroup_t _eventgroup, client_t _client) = 0;
    virtual void unsubscribe_all(service_t _service, instance_t _instance) = 0;

    virtual void send(bool _is_announcing) = 0;

    virtual void on_message(const byte_t *_data, length_t _length) = 0;

    virtual void on_offer_change() = 0;
};

} // namespace sd
} // namespace vsomeip

#endif // VSOMEIP_SERVICE_DISCOVERY_HPP