Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
eventgroup_entry.h
1#ifndef EVENTGROUP_ENTRY_H
2#define EVENTGROUP_ENTRY_H
3
4#include "./entry.h"
5
6namespace ara
7{
8 namespace com
9 {
10 namespace entry
11 {
13 class EventgroupEntry : public Entry
14 {
15 private:
16 static const uint32_t cNackTTL = 0x000000;
17 static const uint32_t cUnsubscribeEventTTL = 0x000000;
18
19 uint8_t mCounter;
20 uint16_t mEventgroupId;
21
23 uint16_t serviceId,
24 uint16_t instanceId,
25 uint32_t ttl,
26 uint8_t majorVersion,
27 uint8_t counter,
28 uint16_t eventgroupId);
29
30 bool isAcknowledge() const noexcept;
31
32 protected:
33 virtual bool ValidateOption(
34 const option::Option *option) const noexcept override;
35
36 public:
37 EventgroupEntry() = delete;
39
40 EventgroupEntry &operator=(EventgroupEntry &&other);
41
44 uint8_t Counter() const noexcept;
45
48 uint16_t EventgroupId() const noexcept;
49
50 virtual std::vector<uint8_t> Payload(uint8_t &optionIndex) const override;
51
60 static std::unique_ptr<EventgroupEntry> CreateSubscribeEventEntry(
61 uint16_t serviceId,
62 uint16_t instanceId,
63 uint8_t majorVersion,
64 uint8_t counter,
65 uint16_t eventgroupId);
66
75 static std::unique_ptr<EventgroupEntry> CreateUnsubscribeEventEntry(
76 uint16_t serviceId,
77 uint16_t instanceId,
78 uint8_t majorVersion,
79 uint8_t counter,
80 uint16_t eventgroupId);
81
85 static std::unique_ptr<EventgroupEntry> CreateAcknowledgeEntry(
86 const EventgroupEntry *eventgroupEntry);
87
91 static std::unique_ptr<EventgroupEntry> CreateNegativeAcknowledgeEntry(
92 const EventgroupEntry *eventgroupEntry);
93
104 static std::unique_ptr<EventgroupEntry> Deserialize(
105 const std::vector<uint8_t> &payload,
106 std::size_t &offset,
107 EntryType type,
108 uint16_t serviceId,
109 uint16_t instanceId,
110 uint32_t ttl,
111 uint8_t majorVersion);
112 };
113 }
114 }
115}
116
117#endif
Communication message abstract entry.
Definition: entry.h:28
Entry to subscribe/unsubscribe to/from an event-group.
Definition: eventgroup_entry.h:14
virtual bool ValidateOption(const option::Option *option) const noexcept override
Validate an option for adding.
Definition: eventgroup_entry.cpp:49
virtual std::vector< uint8_t > Payload(uint8_t &optionIndex) const override
Get entity payload.
Definition: eventgroup_entry.cpp:101
static std::unique_ptr< EventgroupEntry > CreateAcknowledgeEntry(const EventgroupEntry *eventgroupEntry)
Positive acknowledge of an event-group entry factory.
Definition: eventgroup_entry.cpp:157
uint8_t Counter() const noexcept
Get the subscriber counter.
Definition: eventgroup_entry.cpp:91
static std::unique_ptr< EventgroupEntry > Deserialize(const std::vector< uint8_t > &payload, std::size_t &offset, EntryType type, uint16_t serviceId, uint16_t instanceId, uint32_t ttl, uint8_t majorVersion)
Deserialize a entry payload.
Definition: eventgroup_entry.cpp:193
static std::unique_ptr< EventgroupEntry > CreateNegativeAcknowledgeEntry(const EventgroupEntry *eventgroupEntry)
Negative acknowledge of an event-group entry factory.
Definition: eventgroup_entry.cpp:175
uint16_t EventgroupId() const noexcept
Get event-group ID.
Definition: eventgroup_entry.cpp:96
static std::unique_ptr< EventgroupEntry > CreateUnsubscribeEventEntry(uint16_t serviceId, uint16_t instanceId, uint8_t majorVersion, uint8_t counter, uint16_t eventgroupId)
Unsubscribe from an event-group entry factory.
Definition: eventgroup_entry.cpp:135
static std::unique_ptr< EventgroupEntry > CreateSubscribeEventEntry(uint16_t serviceId, uint16_t instanceId, uint8_t majorVersion, uint8_t counter, uint16_t eventgroupId)
Subscribe to an event-group entry factory.
Definition: eventgroup_entry.cpp:112
Communication message entry abstract option.
Definition: option.h:37
EntryType
Message entry type.
Definition: entry.h:19