LCOV - code coverage report
Current view: top level - source/common/api - api_impl.h (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 6 8 75.0 %
Date: 2024-01-05 06:35:25 Functions: 6 8 75.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <chrono>
       4             : #include <string>
       5             : 
       6             : #include "envoy/api/api.h"
       7             : #include "envoy/config/bootstrap/v3/bootstrap.pb.h"
       8             : #include "envoy/event/timer.h"
       9             : #include "envoy/filesystem/filesystem.h"
      10             : #include "envoy/network/socket.h"
      11             : #include "envoy/thread/thread.h"
      12             : 
      13             : #include "source/common/stats/custom_stat_namespaces_impl.h"
      14             : 
      15             : namespace Envoy {
      16             : namespace Api {
      17             : 
      18             : /**
      19             :  * Implementation of Api::Api
      20             :  */
      21             : class Impl : public Api {
      22             : public:
      23             :   Impl(Thread::ThreadFactory& thread_factory, Stats::Store& store, Event::TimeSystem& time_system,
      24             :        Filesystem::Instance& file_system, Random::RandomGenerator& random_generator,
      25             :        const envoy::config::bootstrap::v3::Bootstrap& bootstrap,
      26             :        const ProcessContextOptRef& process_context = absl::nullopt,
      27             :        Buffer::WatermarkFactorySharedPtr watermark_factory = nullptr);
      28             : 
      29             :   // Api::Api
      30             :   Event::DispatcherPtr allocateDispatcher(const std::string& name) override;
      31             :   Event::DispatcherPtr
      32             :   allocateDispatcher(const std::string& name,
      33             :                      const Event::ScaledRangeTimerManagerFactory& scaled_timer_factory) override;
      34             :   Event::DispatcherPtr allocateDispatcher(const std::string& name,
      35             :                                           Buffer::WatermarkFactoryPtr&& watermark_factory) override;
      36        3142 :   Thread::ThreadFactory& threadFactory() override { return thread_factory_; }
      37        2397 :   Filesystem::Instance& fileSystem() override { return file_system_; }
      38        5484 :   TimeSource& timeSource() override { return time_system_; }
      39         266 :   Stats::Scope& rootScope() override { return *store_.rootScope(); }
      40        4111 :   Random::RandomGenerator& randomGenerator() override { return random_generator_; }
      41           0 :   Stats::CustomStatNamespaces& customStatNamespaces() override { return custom_stat_namespaces_; }
      42        1399 :   const envoy::config::bootstrap::v3::Bootstrap& bootstrap() const override { return bootstrap_; }
      43           0 :   ProcessContextOptRef processContext() override { return process_context_; }
      44             : 
      45             : private:
      46             :   Thread::ThreadFactory& thread_factory_;
      47             :   Stats::Store& store_;
      48             :   Event::TimeSystem& time_system_;
      49             :   Filesystem::Instance& file_system_;
      50             :   Random::RandomGenerator& random_generator_;
      51             :   const envoy::config::bootstrap::v3::Bootstrap& bootstrap_;
      52             :   Stats::CustomStatNamespacesImpl custom_stat_namespaces_;
      53             :   ProcessContextOptRef process_context_;
      54             :   const Buffer::WatermarkFactorySharedPtr watermark_factory_;
      55             : };
      56             : 
      57             : } // namespace Api
      58             : } // namespace Envoy

Generated by: LCOV version 1.15