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::type {
11 
20 public:
21  Library(std::string cxx_name, Meta m = Meta()) : TypeBase(std::move(m)), _cxx_name(std::move(cxx_name)) {}
22 
23  const std::string& cxxName() const { return _cxx_name; }
24  bool operator==(const Library& other) const { return _cxx_name == other._cxx_name; }
25 
27  auto isEqual(const Type& other) const {
28  if ( other.cxxID() == _cxx_name )
29  return true;
30 
31  return node::isEqual(this, other);
32  }
33 
35  auto _isResolved(ResolvedState* rstate) const { return true; }
37  auto properties() const { return node::Properties{{"cxx_name", _cxx_name}}; }
38 
39 private:
40  std::string _cxx_name;
41 };
42 
43 } // namespace hilti::type
auto isEqual(const Type &other) const
Definition: library.h:27
auto _isResolved(ResolvedState *rstate) const
Definition: library.h:35
Definition: type.h:36
Definition: meta.h:19
Definition: type.h:158
Definition: library.h:19
const std::optional< ID > & cxxID() const
Definition: type.h:177
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:97
Definition: type.h:197
Definition: type.h:32
auto properties() const
Definition: library.h:37
Definition: type.h:25