1
2
3
4
5
6 #ifndef SNGCPP_SYMBOLS_CLASS_TEMPLATE_SPECIALIZATION_SYMBOL_INCLUDED
7 #define SNGCPP_SYMBOLS_CLASS_TEMPLATE_SPECIALIZATION_SYMBOL_INCLUDED
8 #include <sngcpp/symbols/ClassTypeSymbol.hpp>
9 #include <sngcpp/ast/Template.hpp>
10
11 namespace sngcpp { namespace symbols {
12
13 std::u32string MakeClassTemplateSpecializationId(TypeSymbol* primaryClassTemplateSymbol, const std::std::vector<TypeSymbol*>&templateArgumentSymbols);
14 std::u32string MakeClassTemplateSpecializationName(TypeSymbol* primaryClassTemplateSymbol, const std::std::vector<TypeSymbol*>&templateArgumentSymbols);
15
16 class ClassTemplateSpecializationSymbol : public ClassTypeSymbol
17 {
18 public:
19 ClassTemplateSpecializationSymbol(const Span& span_, const std::u32string& name_, TypeSymbol* primaryClassTemplateSymbol_, const std::std::vector<TypeSymbol*>&templateArgumentSymbols_,
20 const std::u32string& id_);
21 bool IsClassTemplateSpecializationSymbol() const override { return true; }
22 bool HasBaseClass(TypeSymbol* type, int& distance) override;
23 ClassKey GetClassKey() const override { return primaryClassTemplateSymbol->GetClassKey(); }
24 TypeSymbol* PrimaryClassTemplateSymbol() { return primaryClassTemplateSymbol; }
25 const std::std::vector<TypeSymbol*>&TemplateArgumentSymbols() const{returntemplateArgumentSymbols;}
26 std::unique_ptr<sngxml::dom::Element> CreateElement() override;
27 std::u32string Id() override { return id; }
28 private:
29 std::u32string id;
30 TypeSymbol* primaryClassTemplateSymbol;
31 std::vector<TypeSymbol*> templateArgumentSymbols;
32 };
33
34 } }
35
36 #endif // SNGCPP_SYMBOLS_CLASS_TEMPLATE_SPECIALIZATION_SYMBOL_INCLUDED