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 {
11 namespace type {
12 
13 namespace bytes {
14 
16 class Iterator : public TypeBase,
22 public:
23  Iterator(Meta m = Meta()) : TypeBase(nodes(Type(type::UnsignedInteger(8))), std::move(m)) {}
24 
25  bool operator==(const Iterator& /* other */) const { return true; }
26 
28  auto isEqual(const Type& other) const { return node::isEqual(this, other); }
30  auto _isResolved(ResolvedState* rstate) const { return true; }
32  const Type& dereferencedType() const { return child<Type>(0); }
34  auto properties() const { return node::Properties{}; }
35 };
36 
37 } // namespace bytes
38 
41 public:
42  Bytes(Meta m = Meta()) : TypeBase(nodes(Type(type::UnsignedInteger(8)), Type(bytes::Iterator(m))), m) {}
43 
44  bool operator==(const Bytes& /* other */) const { return true; }
45 
47  auto isEqual(const Type& other) const { return node::isEqual(this, other); }
49  auto _isResolved(ResolvedState* rstate) const { return true; }
51  const Type& elementType() const { return child<Type>(0); }
52 
54  const Type& iteratorType(bool /* const */) const { return child<Type>(1); }
56  auto properties() const { return node::Properties{}; }
57 };
58 
59 } // namespace type
60 
61 } // namespace hilti
const Type & elementType() const
Definition: bytes.h:51
auto isEqual(const Type &other) const
Definition: bytes.h:28
auto properties() const
Definition: bytes.h:56
Definition: type.h:36
Definition: type.h:37
Definition: meta.h:18
auto _isResolved(ResolvedState *rstate) const
Definition: bytes.h:30
Definition: integer.h:54
Definition: bytes.h:40
Definition: type.h:159
Definition: bytes.h:16
Definition: type.h:35
auto properties() const
Definition: bytes.h:34
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:99
const Type & iteratorType(bool) const
Definition: bytes.h:54
Definition: type.h:198
Definition: type.h:33
auto _isResolved(ResolvedState *rstate) const
Definition: bytes.h:49
auto isEqual(const Type &other) const
Definition: bytes.h:47
const Type & dereferencedType() const
Definition: bytes.h:32