GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/expr/datatype_index.h Lines: 3 3 100.0 %
Date: 2021-03-23 Branches: 0 0 0.0 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file datatype_index.h
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Andrew Reynolds, Tim King, Ken Matsui
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
15
#include "cvc4_public.h"
16
17
#ifndef CVC4__DATATYPE_INDEX_H
18
#define CVC4__DATATYPE_INDEX_H
19
20
#include <iosfwd>
21
22
namespace CVC4 {
23
24
/* stores an index to Datatype residing in NodeManager */
25
class DatatypeIndexConstant
26
{
27
 public:
28
  DatatypeIndexConstant(unsigned index);
29
30
5944936
  unsigned getIndex() const { return d_index; }
31
13794
  bool operator==(const DatatypeIndexConstant& uc) const
32
  {
33
13794
    return d_index == uc.d_index;
34
  }
35
  bool operator!=(const DatatypeIndexConstant& uc) const
36
  {
37
    return !(*this == uc);
38
  }
39
  bool operator<(const DatatypeIndexConstant& uc) const
40
  {
41
    return d_index < uc.d_index;
42
  }
43
  bool operator<=(const DatatypeIndexConstant& uc) const
44
  {
45
    return d_index <= uc.d_index;
46
  }
47
  bool operator>(const DatatypeIndexConstant& uc) const
48
  {
49
    return !(*this <= uc);
50
  }
51
  bool operator>=(const DatatypeIndexConstant& uc) const
52
  {
53
    return !(*this < uc);
54
  }
55
56
 private:
57
  const unsigned d_index;
58
}; /* class DatatypeIndexConstant */
59
60
std::ostream& operator<<(std::ostream& out, const DatatypeIndexConstant& dic);
61
62
struct DatatypeIndexConstantHashFunction
63
{
64
  size_t operator()(const DatatypeIndexConstant& dic) const;
65
}; /* struct DatatypeIndexConstantHashFunction */
66
67
}  // namespace CVC4
68
69
#endif /* CVC4__DATATYPE_H */