8#ifndef SEN_CORE_LANG_STL_RESOLVER_H
9#define SEN_CORE_LANG_STL_RESOLVER_H
19#include <unordered_map>
20#include <unordered_set>
37 std::vector<ConstTypeHandle<sen::CustomType>>
types;
52 using TypeSetStorageContainerType = std::vector<std::unique_ptr<TypeSet>>;
57 using IterBaseTy = TypeSetStorageContainerType::const_iterator;
61 using value_type =
typename TypeSetStorageContainerType::const_iterator::value_type::element_type;
67 reference operator[](IterBaseTy::difference_type idx)
const {
return *(this->IterBaseTy::operator[](idx)); }
73 return typeSets_.emplace_back(std::make_unique<TypeSet>()).get();
76 void prepend(std::unique_ptr<TypeSet> newTypeSet) { typeSets_.insert(typeSets_.begin(), std::move(newTypeSet)); }
77 void append(std::unique_ptr<TypeSet> newTypeSet) { typeSets_.push_back(std::move(newTypeSet)); }
78 void reserve(
size_t n) { typeSets_.reserve(n); }
79 [[nodiscard]]
size_t size()
const {
return typeSets_.size(); }
85 TypeSetStorageContainerType typeSets_;
113 const std::vector<StlStatement>& statements_;
120 const std::vector<std::filesystem::path>& includePaths,
123 std::string_view from = {});
StlResolver(const std::vector< StlStatement > &statements, const ResolverContext &context, TypeSetContext &globalContext) noexcept
Stores the statements, context, and the global context.
const TypeSet * resolve(const TypeSettings &settings)
Do the resolution based on the inputs passed on the constructor.
Definition stl_resolver.h:56
value_type * pointer
Definition stl_resolver.h:62
value_type & reference
Definition stl_resolver.h:63
typename TypeSetStorageContainerType::const_iterator::value_type::element_type value_type
Definition stl_resolver.h:61
reference operator*() const
Definition stl_resolver.h:65
pointer operator->() const
Definition stl_resolver.h:66
reference operator[](IterBaseTy::difference_type idx) const
Definition stl_resolver.h:67
The set of types used during resolution.
Definition stl_resolver.h:51
void prepend(std::unique_ptr< TypeSet > newTypeSet)
Definition stl_resolver.h:76
TypeSetIterator begin() const
Definition stl_resolver.h:81
void reserve(size_t n)
Definition stl_resolver.h:78
size_t size() const
Definition stl_resolver.h:79
void append(std::unique_ptr< TypeSet > newTypeSet)
Definition stl_resolver.h:77
TypeSet * createNewTypeSet() noexcept(noexcept(TypeSet()))
Definition stl_resolver.h:71
TypeSetIterator end() const
Definition stl_resolver.h:82
std::vector< ConstTypeHandle< sen::CustomType > > types
Definition stl_resolver.h:37
std::vector< const TypeSet * > importedSets
Definition stl_resolver.h:38
std::vector< std::string > package
Definition stl_resolver.h:36
std::string fileName
Definition stl_resolver.h:34
std::filesystem::path originalFileName
Definition stl_resolver.h:44
std::string parentDirectory
Definition stl_resolver.h:35
std::filesystem::path absoluteFileName
Definition stl_resolver.h:45
std::vector< std::filesystem::path > includePaths
Definition stl_resolver.h:46
std::unordered_set< std::string > deferredMethods
Definition stl_resolver.h:91
std::unordered_set< std::string > checkedProperties
Definition stl_resolver.h:90
const TypeSet * readTypesFile(const std::filesystem::path &fileName, const std::vector< std::filesystem::path > &includePaths, TypeSetContext &globalTypeSetContext, const TypeSettings &settings, std::string_view from={})
Helper function to use the resolver.
Definition stl_resolver.h:89
The environment where a resolution takes place.
Definition stl_resolver.h:43
A set of types coming from a STL file.
Definition stl_resolver.h:33
Definition code_location.h:14
Definition stl_resolver.h:95
std::unordered_map< std::string, ClassAnnotations > classAnnotations
Qualified class name to its annotations.
Definition stl_resolver.h:97