GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/expr/datatype_index.cpp Lines: 4 6 66.7 %
Date: 2021-03-23 Branches: 4 8 50.0 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file datatype_index.cpp
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Andrew Reynolds, Tim King
6
 ** This file is part of the CVC4 project.
7
 ** Copyright (c) 2009-2021 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.\endverbatim
11
 **
12
 ** \brief A class representing an index to a datatype living in NodeManager.
13
 **/
14
#include "expr/datatype_index.h"
15
16
#include <sstream>
17
#include <string>
18
#include "util/hash.h"
19
#include "util/integer.h"
20
21
using namespace std;
22
23
namespace CVC4 {
24
25
5796
DatatypeIndexConstant::DatatypeIndexConstant(uint32_t index) : d_index(index) {}
26
std::ostream& operator<<(std::ostream& out, const DatatypeIndexConstant& dic)
27
{
28
  return out << "index_" << dic.getIndex();
29
}
30
31
30556
size_t DatatypeIndexConstantHashFunction::operator()(
32
    const DatatypeIndexConstant& dic) const
33
{
34
30556
  return IntegerHashFunction()(dic.getIndex());
35
}
36
37
26685
}  // namespace CVC4