summaryrefslogtreecommitdiff
path: root/implementation/endpoints/include/endpoint.hpp
blob: adc765a24209c4d2409694e23637c784dfd3bb6e (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
// Copyright (C) 2014 BMW Group
// Author: Lutz Bichler (lutz.bichler@bmw.de)
// 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_ENDPOINT_HPP
#define VSOMEIP_ENDPOINT_HPP

#include <boost/asio/ip/address.hpp>

#include <vsomeip/primitive_types.hpp>

namespace vsomeip {

class endpoint_definition;

class endpoint
{
public:
	virtual ~endpoint() {};

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

	virtual bool is_connected() const = 0;

	virtual bool send(const byte_t *_data, uint32_t _size, bool _flush = true) = 0;
	virtual bool send_to(std::shared_ptr<endpoint_definition> _target,
	                     const byte_t *_data, uint32_t _size, bool _flush = true) = 0;
	virtual void enable_magic_cookies() = 0;
	virtual void receive() = 0;

	virtual void join(const std::string &_address) = 0;
	virtual void leave(const std::string &_address) = 0;

	virtual void add_multicast(service_t _service, event_t _event,
			const std::string &_address, uint16_t _port) = 0;
	virtual void remove_multicast(service_t _service, event_t _event) = 0;

	virtual unsigned short get_port() const = 0;
	virtual bool is_reliable() const = 0;
};

} // namespace vsomeip

#endif // VSOMEIP_ENDPOINT_HPP