GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/expr/record.h Lines: 6 6 100.0 %
Date: 2021-03-22 Branches: 1 2 50.0 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file record.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 A class representing a Record definition
13
 **
14
 ** A class representing a Record definition.
15
 **/
16
17
#include "cvc4_public.h"
18
19
#ifndef CVC4__RECORD_H
20
#define CVC4__RECORD_H
21
22
#include <iostream>
23
#include <string>
24
#include <vector>
25
#include <utility>
26
27
// Forward Declarations
28
namespace CVC4 {
29
// This forward delcartion is required to resolve a cicular dependency with
30
// Record which is a referenced in a Kind file.
31
class TypeNode;
32
} /* namespace CVC4 */
33
34
namespace CVC4 {
35
36
// operators for record update
37
27
class RecordUpdate
38
{
39
  std::string d_field;
40
41
 public:
42
9
  RecordUpdate(const std::string& field) : d_field(field) {}
43
60
  std::string getField() const { return d_field; }
44
18
  bool operator==(const RecordUpdate& t) const { return d_field == t.d_field; }
45
  bool operator!=(const RecordUpdate& t) const { return d_field != t.d_field; }
46
}; /* class RecordUpdate */
47
48
struct RecordUpdateHashFunction
49
{
50
45
  inline size_t operator()(const RecordUpdate& t) const {
51
45
    return std::hash<std::string>()(t.getField());
52
  }
53
}; /* struct RecordUpdateHashFunction */
54
55
std::ostream& operator<<(std::ostream& out, const RecordUpdate& t);
56
57
using Record = std::vector<std::pair<std::string, TypeNode>>;
58
59
}/* CVC4 namespace */
60
61
#endif /* CVC4__RECORD_H */