// // scope.h // reflection // // Created by Sam Jaffe on 2/20/23. // Copyright © 2023 Sam Jaffe. All rights reserved. // #pragma once #include #include #include namespace reflection { class Scope { private: std::string type_name_; std::vector path_; public: template > Scope(std::string const & type_name, C const & path) : type_name_(type_name), path_(path.begin(), path.end()) {} std::string_view type_name() const { return type_name_; } auto begin() const { return path_.begin(); } auto end() const { return path_.end(); } protected: Scope() = default; }; class ContextScope : public Scope { private: std::string context_; public: // ContextScope() = default; explicit ContextScope(std::string const & type_name) : context_(type_name) {} template > ContextScope(std::string const & context, std::string const & type_name, C const & path) : context_(context), Scope(type_name, path) {} std::string_view context() const { return context_; } }; }