LCOV - code coverage report
Current view: top level - buildbot/coverage/build/src/expr - emptybag.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 8 13 61.5 %
Date: 2026-02-22 11:44:16 Functions: 6 8 75.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /******************************************************************************
       2                 :            :  * Top contributors (to current version):
       3                 :            :  *   Mudathir Mohamed, Mathias Preiner
       4                 :            :  *
       5                 :            :  * This file is part of the cvc5 project.
       6                 :            :  *
       7                 :            :  * Copyright (c) 2009-2025 by the authors listed in the file AUTHORS
       8                 :            :  * in the top-level source directory and their institutional affiliations.
       9                 :            :  * All rights reserved.  See the file COPYING in the top-level source
      10                 :            :  * directory for licensing information.
      11                 :            :  * ****************************************************************************
      12                 :            :  *
      13                 :            :  * A class for empty bags.
      14                 :            :  */
      15                 :            : 
      16                 :            : #include "expr/emptybag.h"
      17                 :            : 
      18                 :            : #include <iostream>
      19                 :            : 
      20                 :            : #include "expr/type_node.h"
      21                 :            : 
      22                 :            : namespace cvc5::internal {
      23                 :            : 
      24                 :          0 : std::ostream& operator<<(std::ostream& out, const EmptyBag& asa)
      25                 :            : {
      26                 :          0 :   return out << "emptybag(" << asa.getType() << ')';
      27                 :            : }
      28                 :            : 
      29                 :      66427 : size_t EmptyBagHashFunction::operator()(const EmptyBag& es) const
      30                 :            : {
      31                 :      66427 :   return std::hash<TypeNode>()(es.getType());
      32                 :            : }
      33                 :            : 
      34                 :            : /**
      35                 :            :  * Constructs an emptybag of the specified type. Note that the argument
      36                 :            :  * is the type of the bag itself, NOT the type of the elements.
      37                 :            :  */
      38                 :      21297 : EmptyBag::EmptyBag(const TypeNode& bagType) : d_type(new TypeNode(bagType)) {}
      39                 :            : 
      40                 :      22525 : EmptyBag::EmptyBag(const EmptyBag& es) : d_type(new TypeNode(es.getType())) {}
      41                 :            : 
      42                 :          0 : EmptyBag& EmptyBag::operator=(const EmptyBag& es)
      43                 :            : {
      44                 :          0 :   (*d_type) = es.getType();
      45                 :          0 :   return *this;
      46                 :            : }
      47                 :            : 
      48                 :      43781 : EmptyBag::~EmptyBag() {}
      49                 :     165394 : const TypeNode& EmptyBag::getType() const { return *d_type; }
      50                 :      32518 : bool EmptyBag::operator==(const EmptyBag& es) const
      51                 :            : {
      52                 :      32518 :   return getType() == es.getType();
      53                 :            : }
      54                 :            : 
      55                 :            : }  // namespace cvc5::internal

Generated by: LCOV version 1.14