1 // =================================
 2 // Copyright (c) 2020 Seppo Laakko
 3 // Distributed under the MIT license
 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* primaryClassTemplateSymbolconst std::std::vector<TypeSymbol*>&templateArgumentSymbols);
14 std::u32string MakeClassTemplateSpecializationName(TypeSymbol* primaryClassTemplateSymbolconst 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* typeint& 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 } } // namespace sngcpp::symbols
35 
36 #endif // SNGCPP_SYMBOLS_CLASS_TEMPLATE_SPECIALIZATION_SYMBOL_INCLUDED