Spicy
member.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <utility>
6 #include <vector>
7 
8 #include <hilti/ast/id.h>
9 #include <hilti/ast/node-ref.h>
10 #include <hilti/ast/type.h>
11 
12 namespace hilti {
13 namespace type {
14 
17 public:
18  Member(Wildcard /*unused*/, Meta m = Meta()) : TypeBase({ID("<wildcard>")}, std::move(m)), _wildcard(true) {}
19  Member(::hilti::ID id, Meta m = Meta()) : TypeBase({std::move(id)}, std::move(m)) {}
20 
21  const auto& id() const { return child<::hilti::ID>(0); }
22 
23  bool operator==(const Member& other) const { return id() == other.id(); }
24 
26  auto isEqual(const Type& other) const { return node::isEqual(this, other); }
28  auto _isResolved(ResolvedState* rstate) const { return true; }
30  auto typeParameters() const { return std::vector<Node>{id()}; }
32  auto isWildcard() const { return _wildcard; }
33 
35  auto properties() const { return node::Properties{}; }
36 
37 private:
38  bool _wildcard = false;
39 };
40 
41 } // namespace type
42 } // namespace hilti
auto _isResolved(ResolvedState *rstate) const
Definition: member.h:28
auto isWildcard() const
Definition: member.h:32
Definition: member.h:16
Definition: meta.h:18
Definition: type.h:159
auto typeParameters() const
Definition: member.h:30
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:99
auto properties() const
Definition: member.h:35
Definition: type.h:198
auto isEqual(const Type &other) const
Definition: member.h:26
Definition: type.h:269
Definition: id.h:18