LCOV - code coverage report
Current view: top level - include/boost/http - datastore.hpp (source / functions) Coverage Total Hit
Test: coverage_remapped.info Lines: 100.0 % 4 4
Test Date: 2026-06-13 19:44:58 Functions: 100.0 % 2 2

           TLA  Line data    Source code
       1                 : //
       2                 : // Copyright (c) 2025 Vinnie Falco (vinnie.falco@gmail.com)
       3                 : //
       4                 : // Distributed under the Boost Software License, Version 1.0. (See accompanying
       5                 : // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
       6                 : //
       7                 : // Official repository: https://github.com/cppalliance/http
       8                 : //
       9                 : 
      10                 : #ifndef BOOST_HTTP_DATASTORE_HPP
      11                 : #define BOOST_HTTP_DATASTORE_HPP
      12                 : 
      13                 : #include <boost/http/detail/config.hpp>
      14                 : #include <boost/http/core/polystore.hpp>
      15                 : 
      16                 : namespace boost {
      17                 : namespace http {
      18                 : 
      19                 : /** A polymorphic data container with clear functionality.
      20                 : 
      21                 :     This class extends @ref polystore to provide a container
      22                 :     for type-erased objects with an explicit clear operation.
      23                 :     It is commonly used as a service container.
      24                 : 
      25                 :     @code
      26                 :     // Example: Using datastore with services
      27                 :     boost::http::datastore ctx;
      28                 : 
      29                 :     // Install services...
      30                 : 
      31                 :     // Clean up all services when done
      32                 :     ctx.clear();
      33                 :     @endcode
      34                 : */
      35                 : class datastore : public polystore
      36                 : {
      37                 : public:
      38                 :     /** Constructor
      39                 : 
      40                 :         Constructs an empty datastore.
      41                 :     */
      42 HIT         225 :     datastore() = default;
      43                 : 
      44                 :     /** Remove and destroy all stored objects.
      45                 : 
      46                 :         All stored objects are destroyed in the reverse order
      47                 :         of construction. The container is left empty.
      48                 :     */
      49               4 :     void clear() noexcept
      50                 :     {
      51               4 :         polystore::clear();
      52               4 :     }
      53                 : };
      54                 : 
      55                 : } // http
      56                 : } // boost
      57                 : 
      58                 : #endif
        

Generated by: LCOV version 2.3