summaryrefslogtreecommitdiff
path: root/interface/vsomeip/runtime.hpp
blob: 00dd06971e4bd3792e0a341c1d0548c322004193 (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
55
56
57
58
59
// Copyright (C) 2014-2016 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_RUNTIME_HPP
#define VSOMEIP_RUNTIME_HPP

#include <memory>
#include <string>
#include <vector>

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

namespace vsomeip {

class application;
class message;
class payload;

class VSOMEIP_IMPORT_EXPORT runtime {
public:

    static std::string get_property(const std::string &_name);
    static void set_property(const std::string &_name, const std::string &_value);

    static std::shared_ptr<runtime> get();

    virtual ~runtime() {
    }

    virtual std::shared_ptr<application> create_application(
            const std::string &_name = "") = 0;

    virtual std::shared_ptr<message> create_message(
            bool _reliable = false) const = 0;
    virtual std::shared_ptr<message> create_request(
            bool _reliable = false) const = 0;
    virtual std::shared_ptr<message> create_response(
            const std::shared_ptr<message> &_request) const = 0;
    virtual std::shared_ptr<message> create_notification(
            bool _reliable = false) const = 0;

    virtual std::shared_ptr<payload> create_payload() const = 0;
    virtual std::shared_ptr<payload> create_payload(
            const byte_t *_data, uint32_t _size) const = 0;
    virtual std::shared_ptr<payload> create_payload(
            const std::vector<byte_t> &_data) const = 0;

    virtual std::shared_ptr<application> get_application(
            const std::string &_name) const = 0;

    virtual void remove_application( const std::string &_name) = 0;
};

} // namespace vsomeip

#endif // VSOMEIP_RUNTIME_HPP