LCOV - code coverage report
Current view: top level - wirestead/transport/serial/detail - write_wait.hpp (source / functions) Coverage Total Hit
Test: Wirestead Coverage Report Lines: 100.0 % 4 4
Test Date: 2026-10-29 11:36:05 Functions: 100.0 % 2 2
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 100.0 % 2 2

             Branch data     Line data    Source code
       1                 :             : /*
       2                 :             :  * Copyright 2025 Jinwoo Sung
       3                 :             :  *
       4                 :             :  * Licensed under the Apache License, Version 2.0 (the "License");
       5                 :             :  * you may not use this file except in compliance with the License.
       6                 :             :  * You may obtain a copy of the License at
       7                 :             :  *
       8                 :             :  *     http://www.apache.org/licenses/LICENSE-2.0
       9                 :             :  *
      10                 :             :  * Unless required by applicable law or agreed to in writing, software
      11                 :             :  * distributed under the License is distributed on an "AS IS" BASIS,
      12                 :             :  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      13                 :             :  * See the License for the specific language governing permissions and
      14                 :             :  * limitations under the License.
      15                 :             :  */
      16                 :             : 
      17                 :             : #pragma once
      18                 :             : 
      19                 :             : #include <cstdint>
      20                 :             : #include <optional>
      21                 :             : 
      22                 :             : #include "wirestead/wrapper/send_result.hpp"
      23                 :             : 
      24                 :             : namespace wirestead::transport::detail {
      25                 :             : // Owned by every waiter that pinned this connection, even after replacement.
      26                 :             : // The transport submission mutex guards ended_by and every call to end().
      27                 :             : struct SerialWriteWait {
      28                 :         361 :   explicit SerialWriteWait(uint64_t value) : sequence(value) {}
      29                 :             :   const uint64_t sequence;
      30                 :             :   std::optional<wrapper::SendRejection> ended_by;
      31                 :             : 
      32                 :        1110 :   void end(wrapper::SendRejection reason) {
      33         [ +  + ]:        1110 :     if (!ended_by) ended_by = reason;
      34                 :        1110 :   }
      35                 :             : };
      36                 :             : }  // namespace wirestead::transport::detail
        

Generated by: LCOV version 2.0-1