Spicy
library.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <string>
6 #include <utility>
7 
8 #include <hilti/ast/type.h>
9 
10 namespace hilti {
11 namespace type {
12 
21 public:
22  Library(std::string cxx_name, Meta m = Meta()) : TypeBase(std::move(m)), _cxx_name(std::move(cxx_name)) {}
23 
24  const std::string& cxxName() const { return _cxx_name; }
25  bool operator==(const Library& other) const { return _cxx_name == other._cxx_name; }
26 
28  auto isEqual(const Type& other) const {
29  if ( other.cxxID() == _cxx_name )
30  return true;
31 
32  return node::isEqual(this, other);
33  }
34 
36  auto _isResolved(ResolvedState* rstate) const { return true; }
38  auto properties() const { return node::Properties{{"cxx_name", _cxx_name}}; }
39 
40 private:
41  std::string _cxx_name;
42 };
43 
44 } // namespace type
45 } // namespace hilti
auto isEqual(const Type &other) const
Definition: library.h:28
auto _isResolved(ResolvedState *rstate) const
Definition: library.h:36
Definition: type.h:37
Definition: meta.h:18
std::optional< ID > cxxID() const
Definition: type.h:178
Definition: type.h:159
Definition: library.h:20
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:99
Definition: type.h:198
Definition: type.h:33
auto properties() const
Definition: library.h:38