diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-08-26 11:41:20 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-08-26 11:41:20 +0200 |
commit | fc1b435ab4982ac96324591f6215fd2a3adb0ca0 (patch) | |
tree | 66e1950eb46ad743026e97d2dff85b90335a4bba /src/shared/cplusplus/Symbols.h | |
parent | f137bd3b83dbb57e029a4bdd58e8dc7b34934d39 (diff) |
Introduced CPlusPlus::TemplateArguments and fixed a possible mem-leak when using template members.
Diffstat (limited to 'src/shared/cplusplus/Symbols.h')
-rw-r--r-- | src/shared/cplusplus/Symbols.h | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/src/shared/cplusplus/Symbols.h b/src/shared/cplusplus/Symbols.h index 881d464f4e..a911c21ab9 100644 --- a/src/shared/cplusplus/Symbols.h +++ b/src/shared/cplusplus/Symbols.h @@ -58,6 +58,21 @@ CPLUSPLUS_BEGIN_HEADER CPLUSPLUS_BEGIN_NAMESPACE +class TemplateParameters +{ +public: + TemplateParameters(Scope *scope); + TemplateParameters(TemplateParameters *previous, Scope *scope); + ~TemplateParameters(); + + TemplateParameters *previous() const; + Scope *scope() const; + +private: + TemplateParameters *_previous; + Scope *_scope; +}; + class CPLUSPLUS_EXPORT UsingNamespaceDirective: public Symbol { public: @@ -102,11 +117,8 @@ public: Declaration(TranslationUnit *translationUnit, unsigned sourceLocation, Name *name); virtual ~Declaration(); - unsigned templateParameterCount() const; - Symbol *templateParameterAt(unsigned index) const; - - Scope *templateParameters() const; - void setTemplateParameters(Scope *templateParameters); + TemplateParameters *templateParameters() const; + void setTemplateParameters(TemplateParameters *templateParameters); void setType(FullySpecifiedType type); @@ -124,7 +136,7 @@ protected: private: FullySpecifiedType _type; - Scope *_templateParameters; + TemplateParameters *_templateParameters; }; class CPLUSPLUS_EXPORT Argument: public Symbol @@ -201,11 +213,8 @@ public: ForwardClassDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, Name *name); virtual ~ForwardClassDeclaration(); - unsigned templateParameterCount() const; - Symbol *templateParameterAt(unsigned index) const; - - Scope *templateParameters() const; - void setTemplateParameters(Scope *templateParameters); + TemplateParameters *templateParameters() const; + void setTemplateParameters(TemplateParameters *templateParameters); virtual FullySpecifiedType type() const; @@ -228,7 +237,7 @@ protected: virtual void accept0(TypeVisitor *visitor); private: - Scope *_templateParameters; + TemplateParameters *_templateParameters; }; class CPLUSPLUS_EXPORT Enum: public ScopedSymbol, public Type @@ -279,11 +288,11 @@ public: int methodKey() const; void setMethodKey(int key); - unsigned templateParameterCount() const; - Symbol *templateParameterAt(unsigned index) const; + unsigned templateParameterCount() const; // ### remove me + Symbol *templateParameterAt(unsigned index) const; // ### remove me - Scope *templateParameters() const; - void setTemplateParameters(Scope *templateParameters); + TemplateParameters *templateParameters() const; + void setTemplateParameters(TemplateParameters *templateParameters); FullySpecifiedType returnType() const; void setReturnType(FullySpecifiedType returnType); @@ -336,7 +345,7 @@ protected: virtual void accept0(TypeVisitor *visitor); private: - Scope *_templateParameters; + TemplateParameters *_templateParameters; FullySpecifiedType _returnType; struct Flags { unsigned _isVariadic: 1; @@ -425,11 +434,11 @@ public: Key classKey() const; void setClassKey(Key key); - unsigned templateParameterCount() const; - Symbol *templateParameterAt(unsigned index) const; + unsigned templateParameterCount() const; // ### remove me + Symbol *templateParameterAt(unsigned index) const; // ### remove me - Scope *templateParameters() const; - void setTemplateParameters(Scope *templateParameters); + TemplateParameters *templateParameters() const; + void setTemplateParameters(TemplateParameters *templateParameters); unsigned baseClassCount() const; BaseClass *baseClassAt(unsigned index) const; @@ -459,7 +468,7 @@ protected: private: Key _key; - Scope *_templateParameters; + TemplateParameters *_templateParameters; Array<BaseClass *> _baseClasses; }; |