LCOV - code coverage report
Current view: top level - envoy/event - deferred_deletable.h (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 2 2 100.0 %
Date: 2024-01-05 06:35:25 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <memory>
       4             : 
       5             : namespace Envoy {
       6             : namespace Event {
       7             : 
       8             : /**
       9             :  * If an object derives from this class, it can be passed to the dispatcher who guarantees to delete
      10             :  * it in a future event loop cycle. This allows clear ownership with unique_ptr while not having
      11             :  * to worry about stack unwind issues during event processing.
      12             :  */
      13             : class DeferredDeletable {
      14             : public:
      15       13442 :   virtual ~DeferredDeletable() = default;
      16             : 
      17             :   /**
      18             :    * Called when an object is passed to `deferredDelete`. This signals that the object will soon
      19             :    * be deleted.
      20             :    */
      21        4761 :   virtual void deleteIsPending() {}
      22             : };
      23             : 
      24             : using DeferredDeletablePtr = std::unique_ptr<DeferredDeletable>;
      25             : 
      26             : } // namespace Event
      27             : } // namespace Envoy

Generated by: LCOV version 1.15