Spicy
bytes.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <utility>
6 
7 #include <hilti/ast/type.h>
8 #include <hilti/ast/types/integer.h>
9 
10 namespace hilti::type {
11 
12 namespace bytes {
13 
15 class Iterator : public TypeBase,
21 public:
22  Iterator(Meta m = Meta()) : TypeBase(nodes(Type(type::UnsignedInteger(8))), std::move(m)) {}
23 
24  bool operator==(const Iterator& /* other */) const { return true; }
25 
27  auto isEqual(const Type& other) const { return node::isEqual(this, other); }
29  auto _isResolved(ResolvedState* rstate) const { return true; }
31  const Type& dereferencedType() const { return child<Type>(0); }
33  auto properties() const { return node::Properties{}; }
34 };
35 
36 } // namespace bytes
37 
40 public:
41  Bytes(const Meta& m = Meta()) : TypeBase(nodes(Type(type::UnsignedInteger(8)), Type(bytes::Iterator(m))), m) {}
42 
43  bool operator==(const Bytes& /* other */) const { return true; }
44 
46  auto isEqual(const Type& other) const { return node::isEqual(this, other); }
48  auto _isResolved(ResolvedState* rstate) const { return true; }
50  const Type& elementType() const { return child<Type>(0); }
51 
53  const Type& iteratorType(bool /* const */) const { return child<Type>(1); }
55  auto properties() const { return node::Properties{}; }
56 };
57 
58 } // namespace hilti::type
const Type & elementType() const
Definition: bytes.h:50
auto isEqual(const Type &other) const
Definition: bytes.h:27
auto properties() const
Definition: bytes.h:55
Definition: type.h:35
Definition: type.h:36
Definition: meta.h:19
auto _isResolved(ResolvedState *rstate) const
Definition: bytes.h:29
Definition: integer.h:53
Definition: bytes.h:39
Definition: type.h:158
Definition: bytes.h:15
Definition: type.h:34
auto properties() const
Definition: bytes.h:33
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:97
const Type & iteratorType(bool) const
Definition: bytes.h:53
Definition: type.h:197
Definition: type.h:32
auto _isResolved(ResolvedState *rstate) const
Definition: bytes.h:48
auto isEqual(const Type &other) const
Definition: bytes.h:46
const Type & dereferencedType() const
Definition: bytes.h:31
Definition: type.h:25