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-04-23 10:47:37 Functions: 6 8 75.0 %
Branches: 0 0 -

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

Generated by: LCOV version 1.14