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 typeParameters() const { return std::vector<Node>{id()}; }
30  auto isWildcard() const { return _wildcard; }
31 
33  auto properties() const { return node::Properties{}; }
34 
35 private:
36  bool _wildcard = false;
37 };
38 
39 } // namespace type
40 } // namespace hilti
auto isWildcard() const
Definition: member.h:30
Definition: member.h:16
Definition: meta.h:18
auto typeParameters() const
Definition: member.h:28
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83
auto properties() const
Definition: member.h:33
Definition: type.h:152
auto isEqual(const Type &other) const
Definition: member.h:26
Definition: type.h:249
Definition: id.h:18