GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/util/tuple.h Lines: 5 7 71.4 %
Date: 2021-03-23 Branches: 0 0 0.0 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file tuple.h
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Morgan Deters, Tim King, Mathias Preiner
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 Tuple operators
13
 **
14
 ** Tuple operators.
15
 **/
16
17
#include "cvc4_public.h"
18
19
#ifndef CVC4__TUPLE_H
20
#define CVC4__TUPLE_H
21
22
#include <iostream>
23
#include <vector>
24
#include <utility>
25
26
namespace CVC4 {
27
28
class TupleUpdate
29
{
30
  unsigned d_index;
31
32
 public:
33
3
  TupleUpdate(unsigned index) : d_index(index) {}
34
20
  unsigned getIndex() const { return d_index; }
35
6
  bool operator==(const TupleUpdate& t) const { return d_index == t.d_index; }
36
  bool operator!=(const TupleUpdate& t) const { return d_index != t.d_index; }
37
}; /* class TupleUpdate */
38
39
struct TupleUpdateHashFunction
40
{
41
15
  inline size_t operator()(const TupleUpdate& t) const {
42
15
    return t.getIndex();
43
  }
44
}; /* struct TupleUpdateHashFunction */
45
46
std::ostream& operator<<(std::ostream& out, const TupleUpdate& t);
47
48
inline std::ostream& operator<<(std::ostream& out, const TupleUpdate& t) {
49
  return out << "[" << t.getIndex() << "]";
50
}
51
52
}/* CVC4 namespace */
53
54
#endif /* CVC4__TUPLE_H */