Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
loadbalancing_option.h
1#ifndef LOADBALANCING_OPTION_H
2#define LOADBALANCING_OPTION_H
3
4#include <memory>
5#include "./option.h"
6
7namespace ara
8{
9 namespace com
10 {
11 namespace option
12 {
15 {
16 private:
17 uint16_t mPriority;
18 uint16_t mWeight;
19
20 public:
21 LoadBalancingOption() = delete;
22
28 bool discardable,
29 uint16_t priority,
30 uint16_t weight) noexcept : Option(OptionType::LoadBalancing, discardable),
31 mPriority{priority},
32 mWeight{weight}
33 {
34 }
35
36 virtual uint16_t Length() const noexcept override;
37
40 uint16_t Priority() const noexcept;
41
44 uint16_t Weight() const noexcept;
45
46 virtual std::vector<uint8_t> Payload() const override;
47
53 static std::unique_ptr<LoadBalancingOption> Deserialize(
54 const std::vector<uint8_t> &payload,
55 std::size_t &offset,
56 bool discardable);
57 };
58 }
59 }
60}
61
62#endif
Service load balancing option.
Definition: loadbalancing_option.h:15
virtual std::vector< uint8_t > Payload() const override
Get option payload.
Definition: loadbalancing_option.cpp:25
uint16_t Weight() const noexcept
Get weight.
Definition: loadbalancing_option.cpp:20
constexpr LoadBalancingOption(bool discardable, uint16_t priority, uint16_t weight) noexcept
Constructor.
Definition: loadbalancing_option.h:27
static std::unique_ptr< LoadBalancingOption > Deserialize(const std::vector< uint8_t > &payload, std::size_t &offset, bool discardable)
Deserialize an option payload.
Definition: loadbalancing_option.cpp:35
virtual uint16_t Length() const noexcept override
Get option length.
Definition: loadbalancing_option.cpp:9
uint16_t Priority() const noexcept
Get priority.
Definition: loadbalancing_option.cpp:15
Communication message entry abstract option.
Definition: option.h:37
constexpr Option(OptionType type, bool discardable) noexcept
Constructor.
Definition: option.h:46
@ LoadBalancing
Service instnace load balancing.