LCOV - code coverage report
Current view: top level - src/extension - status_detail.cc (source / functions) Hit Total Coverage
Test: vlink Lines: 85 85 100.0 %
Date: 2026-06-27 19:56:04 Functions: 30 30 100.0 %
Branches: 10 20 50.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * Copyright (C) 2026 by Thun Lu. All rights reserved.
       3                 :            :  * Author: Thun Lu <thun.lu@zohomail.cn>
       4                 :            :  * Repo:   https://github.com/thun-res/vlink
       5                 :            :  *  _    __   __      _           __
       6                 :            :  * | |  / /  / /     (_) ____    / /__
       7                 :            :  * | | / /  / /     / / / __ \  / //_/
       8                 :            :  * | |/ /  / /___  / / / / / / / ,<
       9                 :            :  * |___/  /_____/ /_/ /_/ /_/ /_/|_|
      10                 :            :  *
      11                 :            :  * Licensed under the Apache License, Version 2.0 (the "License");
      12                 :            :  * you may not use this file except in compliance with the License.
      13                 :            :  * You may obtain a copy of the License at
      14                 :            :  *
      15                 :            :  *     http://www.apache.org/licenses/LICENSE-2.0
      16                 :            :  *
      17                 :            :  * Unless required by applicable law or agreed to in writing, software
      18                 :            :  * distributed under the License is distributed on an "AS IS" BASIS,
      19                 :            :  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      20                 :            :  * See the License for the specific language governing permissions and
      21                 :            :  * limitations under the License.
      22                 :            :  */
      23                 :            : 
      24                 :            : #include "./extension/status_detail.h"
      25                 :            : 
      26                 :            : #include <string>
      27                 :            : 
      28                 :            : namespace vlink {
      29                 :            : 
      30                 :            : namespace Status {
      31                 :            : 
      32                 :            : // --- For writer
      33                 :            : 
      34                 :            : // PublicationMatched
      35                 :         31 : Type PublicationMatched::get_type() const { return kPublicationMatched; }
      36                 :            : 
      37         [ +  - ]:          5 : std::string PublicationMatched::get_string() const { return "PublicationMatched"; }
      38                 :            : 
      39                 :          2 : std::ostream& operator<<(std::ostream& ostream, const PublicationMatched& status) noexcept {
      40                 :          2 :   ostream << status.get_string() << ":";
      41                 :          2 :   ostream << "[total_count]" << status.total_count;
      42                 :          2 :   ostream << "[total_count_change]" << status.total_count_change;
      43                 :          2 :   ostream << "[current_count]" << status.current_count;
      44                 :          2 :   ostream << "[current_count_change]" << status.current_count_change;
      45                 :          2 :   ostream << "[last_subscription_handle]" << status.last_subscription_handle;
      46                 :            : 
      47                 :          2 :   return ostream;
      48                 :            : }
      49                 :            : 
      50                 :            : // OfferedDeadlineMissed
      51                 :          5 : Type OfferedDeadlineMissed::get_type() const { return kOfferedDeadlineMissed; }
      52                 :            : 
      53         [ +  - ]:          5 : std::string OfferedDeadlineMissed::get_string() const { return "OfferedDeadlineMissed"; }
      54                 :            : 
      55                 :          2 : std::ostream& operator<<(std::ostream& ostream, const OfferedDeadlineMissed& status) noexcept {
      56                 :          2 :   ostream << status.get_string() << ":";
      57                 :          2 :   ostream << "[total_count]" << status.total_count;
      58                 :          2 :   ostream << "[total_count_change]" << status.total_count_change;
      59                 :          2 :   ostream << "[last_instance_handle]" << status.last_instance_handle;
      60                 :            : 
      61                 :          2 :   return ostream;
      62                 :            : }
      63                 :            : 
      64                 :            : // OfferedIncompatibleQos
      65                 :          6 : Type OfferedIncompatibleQos::get_type() const { return kOfferedIncompatibleQos; }
      66                 :            : 
      67         [ +  - ]:          5 : std::string OfferedIncompatibleQos::get_string() const { return "OfferedIncompatibleQos"; }
      68                 :            : 
      69                 :          2 : std::ostream& operator<<(std::ostream& ostream, const OfferedIncompatibleQos& status) noexcept {
      70                 :          2 :   ostream << status.get_string() << ":";
      71                 :          2 :   ostream << "[total_count]" << status.total_count;
      72                 :          2 :   ostream << "[total_count_change]" << status.total_count_change;
      73                 :          2 :   ostream << "[last_policy_id]" << status.last_policy_id;
      74                 :            : 
      75                 :          2 :   return ostream;
      76                 :            : }
      77                 :            : 
      78                 :            : // LivelinessLost
      79                 :          5 : Type LivelinessLost::get_type() const { return kLivelinessLost; }
      80                 :            : 
      81         [ +  - ]:          5 : std::string LivelinessLost::get_string() const { return "LivelinessLost"; }
      82                 :            : 
      83                 :          2 : std::ostream& operator<<(std::ostream& ostream, const LivelinessLost& status) noexcept {
      84                 :          2 :   ostream << status.get_string() << ":";
      85                 :          2 :   ostream << "[total_count]" << status.total_count;
      86                 :          2 :   ostream << "[total_count_change]" << status.total_count_change;
      87                 :            : 
      88                 :          2 :   return ostream;
      89                 :            : }
      90                 :            : 
      91                 :            : // --- For reader
      92                 :            : 
      93                 :            : // SubscriptionMatched
      94                 :         23 : Type SubscriptionMatched::get_type() const { return kSubscriptionMatched; }
      95                 :            : 
      96         [ +  - ]:          6 : std::string SubscriptionMatched::get_string() const { return "SubscriptionMatched"; }
      97                 :            : 
      98                 :          3 : std::ostream& operator<<(std::ostream& ostream, const SubscriptionMatched& status) noexcept {
      99                 :          3 :   ostream << status.get_string() << ":";
     100                 :          3 :   ostream << "[total_count]" << status.total_count;
     101                 :          3 :   ostream << "[total_count_change]" << status.total_count_change;
     102                 :          3 :   ostream << "[current_count]" << status.current_count;
     103                 :          3 :   ostream << "[current_count_change]" << status.current_count_change;
     104                 :          3 :   ostream << "[last_publication_handle]" << status.last_publication_handle;
     105                 :            : 
     106                 :          3 :   return ostream;
     107                 :            : }
     108                 :            : 
     109                 :            : // RequestedDeadlineMissed
     110                 :          6 : Type RequestedDeadlineMissed::get_type() const { return kRequestedDeadlineMissed; }
     111                 :            : 
     112         [ +  - ]:          5 : std::string RequestedDeadlineMissed::get_string() const { return "RequestedDeadlineMissed"; }
     113                 :            : 
     114                 :          2 : std::ostream& operator<<(std::ostream& ostream, const RequestedDeadlineMissed& status) noexcept {
     115                 :          2 :   ostream << status.get_string() << ":";
     116                 :          2 :   ostream << "[total_count]" << status.total_count;
     117                 :          2 :   ostream << "[total_count_change]" << status.total_count_change;
     118                 :          2 :   ostream << "[last_instance_handle]" << status.last_instance_handle;
     119                 :            : 
     120                 :          2 :   return ostream;
     121                 :            : }
     122                 :            : 
     123                 :            : // LivelinessChanged
     124                 :          7 : Type LivelinessChanged::get_type() const { return kLivelinessChanged; }
     125                 :            : 
     126         [ +  - ]:          4 : std::string LivelinessChanged::get_string() const { return "LivelinessChanged"; }
     127                 :            : 
     128                 :          2 : std::ostream& operator<<(std::ostream& ostream, const LivelinessChanged& status) noexcept {
     129                 :          2 :   ostream << status.get_string() << ":";
     130                 :          2 :   ostream << "[alive_count]" << status.alive_count;
     131                 :          2 :   ostream << "[not_alive_count]" << status.not_alive_count;
     132                 :          2 :   ostream << "[alive_count_change]" << status.alive_count_change;
     133                 :          2 :   ostream << "[not_alive_count_change]" << status.not_alive_count_change;
     134                 :          2 :   ostream << "[last_publication_handle]" << status.last_publication_handle;
     135                 :            : 
     136                 :          2 :   return ostream;
     137                 :            : }
     138                 :            : 
     139                 :            : // SampleRejected
     140                 :          5 : Type SampleRejected::get_type() const { return kSampleRejected; }
     141                 :            : 
     142         [ +  - ]:          5 : std::string SampleRejected::get_string() const { return "SampleRejected"; }
     143                 :            : 
     144                 :          3 : std::ostream& operator<<(std::ostream& ostream, const SampleRejected& status) noexcept {
     145                 :          3 :   ostream << status.get_string() << ":";
     146                 :          3 :   ostream << "[total_count]" << status.total_count;
     147                 :          3 :   ostream << "[total_count_change]" << status.total_count_change;
     148                 :          3 :   ostream << "[last_reason]" << +status.last_reason;
     149                 :          3 :   ostream << "[last_instance_handle]" << status.last_instance_handle;
     150                 :            : 
     151                 :          3 :   return ostream;
     152                 :            : }
     153                 :            : 
     154                 :            : // RequestedIncompatibleQos
     155                 :          6 : Type RequestedIncompatibleQos::get_type() const { return kRequestedIncompatibleQos; }
     156                 :            : 
     157         [ +  - ]:          4 : std::string RequestedIncompatibleQos::get_string() const { return "RequestedIncompatibleQos"; }
     158                 :            : 
     159                 :          2 : std::ostream& operator<<(std::ostream& ostream, const RequestedIncompatibleQos& status) noexcept {
     160                 :          2 :   ostream << status.get_string() << ":";
     161                 :          2 :   ostream << "[total_count]" << status.total_count;
     162                 :          2 :   ostream << "[total_count_change]" << status.total_count_change;
     163                 :          2 :   ostream << "[last_policy_id]" << status.last_policy_id;
     164                 :            : 
     165                 :          2 :   return ostream;
     166                 :            : }
     167                 :            : 
     168                 :            : // SampleLost
     169                 :          6 : Type SampleLost::get_type() const { return kSampleLost; }
     170                 :            : 
     171         [ +  - ]:          5 : std::string SampleLost::get_string() const { return "SampleLost"; }
     172                 :            : 
     173                 :          2 : std::ostream& operator<<(std::ostream& ostream, const SampleLost& status) noexcept {
     174                 :          2 :   ostream << status.get_string() << ":";
     175                 :          2 :   ostream << "[total_count]" << status.total_count;
     176                 :          2 :   ostream << "[total_count_change]" << status.total_count_change;
     177                 :            : 
     178                 :          2 :   return ostream;
     179                 :            : }
     180                 :            : 
     181                 :            : //
     182                 :            : 
     183                 :            : }  // namespace Status
     184                 :            : 
     185                 :            : }  // namespace vlink

Generated by: LCOV version 1.14