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

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