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