LCOV - code coverage report
Current view: top level - source/server/admin - config_tracker_impl.cc (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 12 12 100.0 %
Date: 2024-01-05 06:35:25 Functions: 4 4 100.0 %

          Line data    Source code
       1             : #include "source/server/admin/config_tracker_impl.h"
       2             : 
       3             : namespace Envoy {
       4             : namespace Server {
       5             : 
       6         715 : ConfigTracker::EntryOwnerPtr ConfigTrackerImpl::add(const std::string& key, Cb cb) {
       7         715 :   auto insert_result = map_->emplace(key, std::move(cb));
       8         715 :   return insert_result.second
       9         715 :              ? std::make_unique<ConfigTrackerImpl::EntryOwnerImpl>(map_, std::move(key))
      10         715 :              : nullptr;
      11         715 : }
      12             : 
      13         154 : const ConfigTracker::CbsMap& ConfigTrackerImpl::getCallbacksMap() const { return *map_; }
      14             : 
      15             : ConfigTrackerImpl::EntryOwnerImpl::EntryOwnerImpl(const std::shared_ptr<ConfigTracker::CbsMap>& map,
      16             :                                                   const std::string& key)
      17         715 :     : map_(map), key_(key) {}
      18             : 
      19         715 : ConfigTrackerImpl::EntryOwnerImpl::~EntryOwnerImpl() {
      20         715 :   size_t erased = map_->erase(key_);
      21         715 :   ASSERT(erased == 1);
      22         715 : }
      23             : 
      24             : } // namespace Server
      25             : } // namespace Envoy

Generated by: LCOV version 1.15