summaryrefslogtreecommitdiff
path: root/implementation/service_discovery/include/fsm_events.hpp
blob: 75279e22f4ec6281823629eee93a13cd0873afb9 (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
60
// 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_FSM_EVENTS_HPP
#define VSOMEIP_FSM_EVENTS_HPP

#include <boost/statechart/event.hpp>

#include <vsomeip/primitive_types.hpp>
#include "../../routing/include/serviceinfo.hpp"

namespace sc = boost::statechart;

namespace vsomeip {
namespace sd {

struct ev_none: sc::event<ev_none> {
};

struct ev_timeout: sc::event<ev_timeout> {
};

struct ev_alt_timeout: sc::event<ev_alt_timeout> {
};

struct ev_status_change: sc::event<ev_status_change> {
    ev_status_change(bool _is_up)
            : is_up_(_is_up) {
    }

    bool is_up_;
};

struct ev_find_service: sc::event<ev_find_service> {

    ev_find_service(const std::shared_ptr<const serviceinfo> &_info, service_t _service, instance_t _instance,
            major_version_t _major, minor_version_t _minor, bool _unicast_flag)
            : info_(_info), service_(_service), instance_(_instance), major_(_major), minor_(
                    _minor), unicast_flag_(_unicast_flag) {
    }
    const std::shared_ptr<const serviceinfo> &info_;
    service_t service_;
    instance_t instance_;
    major_version_t major_;
    minor_version_t minor_;
    bool unicast_flag_;
};

struct ev_offer_change: sc::event<ev_offer_change> {
};

struct ev_request_service: sc::event<ev_request_service> {
};

}  // namespace sd
}  // namespace vsomeip

#endif // VSOMEIP_FSM_EVENTS_HPP