Matter SDK Coverage Report
Current view: top level - system - WakeEvent.h (source / functions) Coverage Total Hit
Test: SHA:e98a48c2e59f85a25417956e1d105721433aa5d1 Lines: 100.0 % 1 1
Test Date: 2026-01-09 16:53:50 Functions: 100.0 % 1 1

            Line data    Source code
       1              : /*
       2              :  *
       3              :  *    Copyright (c) 2020-2021 Project CHIP Authors
       4              :  *
       5              :  *    Licensed under the Apache License, Version 2.0 (the "License");
       6              :  *    you may not use this file except in compliance with the License.
       7              :  *    You may obtain a copy of the License at
       8              :  *
       9              :  *        http://www.apache.org/licenses/LICENSE-2.0
      10              :  *
      11              :  *    Unless required by applicable law or agreed to in writing, software
      12              :  *    distributed under the License is distributed on an "AS IS" BASIS,
      13              :  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      14              :  *    See the License for the specific language governing permissions and
      15              :  *    limitations under the License.
      16              :  */
      17              : 
      18              : /**
      19              :  *    @file
      20              :  *      This file declares the abstraction of socket (file descriptor) events.
      21              :  */
      22              : 
      23              : #pragma once
      24              : 
      25              : // Include configuration headers
      26              : #include <system/SystemConfig.h>
      27              : 
      28              : #if !CHIP_SYSTEM_CONFIG_USE_LIBEV
      29              : 
      30              : #include <lib/core/CHIPError.h>
      31              : #include <system/SocketEvents.h>
      32              : 
      33              : namespace chip {
      34              : namespace System {
      35              : 
      36              : class WakeEventTest;
      37              : 
      38              : /**
      39              :  * @class WakeEvent
      40              :  *
      41              :  * An instance of this type can be used by a System::Layer to allow other threads
      42              :  * to wake its event loop thread via System::Layer::Signal().
      43              :  */
      44              : class WakeEvent
      45              : {
      46              : public:
      47              :     CHIP_ERROR Open(); /**< Initialize the pipeline */
      48              :     void Close();      /**< Close both ends of the pipeline. */
      49              : 
      50              :     CHIP_ERROR Notify() const; /**< Set the event. */
      51              :     void Confirm() const;      /**< Clear the event. */
      52              : 
      53    119262645 :     int GetReadFD() const { return mReadFD; }
      54              : 
      55              : private:
      56              :     friend class WakeEventTest;
      57              : 
      58              : #if CHIP_SYSTEM_CONFIG_USE_POSIX_PIPE
      59              :     int mWriteFD;
      60              : #endif
      61              :     int mReadFD;
      62              : };
      63              : 
      64              : } // namespace System
      65              : } // namespace chip
      66              : 
      67              : #endif // !CHIP_SYSTEM_CONFIG_USE_LIBEV
        

Generated by: LCOV version 2.0-1