| 103 | } |
| 104 | |
| 105 | void eventgroupinfo::add_event(const std::shared_ptr<event>& _event) { |
| 106 | |
| 107 | if (_event == nullptr) { |
| 108 | VSOMEIP_ERROR_P << "Received ptr is null"; |
| 109 | return; |
| 110 | } |
| 111 | |
| 112 | std::scoped_lock its_lock(events_mutex_); |
| 113 | events_.insert(_event); |
| 114 | |
| 115 | if (!reliability_auto_mode_ && _event->get_reliability() == reliability_type_e::RT_UNKNOWN) { |
| 116 | reliability_auto_mode_ = true; |
| 117 | return; |
| 118 | } |
| 119 | |
| 120 | switch (_event->get_reliability()) { |
| 121 | case reliability_type_e::RT_RELIABLE: |
| 122 | if (reliability_ == reliability_type_e::RT_UNRELIABLE) { |
| 123 | reliability_ = reliability_type_e::RT_BOTH; |
| 124 | } else if (reliability_ != reliability_type_e::RT_BOTH) { |
| 125 | reliability_ = reliability_type_e::RT_RELIABLE; |
| 126 | } |
| 127 | break; |
| 128 | case reliability_type_e::RT_UNRELIABLE: |
| 129 | if (reliability_ == reliability_type_e::RT_RELIABLE) { |
| 130 | reliability_ = reliability_type_e::RT_BOTH; |
| 131 | } else if (reliability_ != reliability_type_e::RT_BOTH) { |
| 132 | reliability_ = reliability_type_e::RT_UNRELIABLE; |
| 133 | } |
| 134 | break; |
| 135 | case reliability_type_e::RT_BOTH: |
| 136 | reliability_ = reliability_type_e::RT_BOTH; |
| 137 | break; |
| 138 | default:; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | void eventgroupinfo::remove_event(const std::shared_ptr<event>& _event) { |
| 143 |
no test coverage detected