aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/cplusplus/Symbols.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2009-09-28 11:46:00 +0200
committerErik Verbruggen <erik.verbruggen@nokia.com>2009-09-28 11:46:00 +0200
commit478e94748ffd269b6a8025251fb017ee6a1c9011 (patch)
tree7112a43c583b990c15f0efde446ef6a82dbe5797 /src/shared/cplusplus/Symbols.h
parent77fc7441af3228fc7b5fc97aa81849c43458f996 (diff)
Added type declarations for forward declared ObjC protocols and classes.
Diffstat (limited to 'src/shared/cplusplus/Symbols.h')
-rw-r--r--src/shared/cplusplus/Symbols.h40
1 files changed, 35 insertions, 5 deletions
diff --git a/src/shared/cplusplus/Symbols.h b/src/shared/cplusplus/Symbols.h
index a911c21ab9..7ed4cf30f9 100644
--- a/src/shared/cplusplus/Symbols.h
+++ b/src/shared/cplusplus/Symbols.h
@@ -472,23 +472,31 @@ private:
Array<BaseClass *> _baseClasses;
};
-class CPLUSPLUS_EXPORT ObjCForwardProtocolDeclaration: public Symbol
+class CPLUSPLUS_EXPORT ObjCForwardProtocolDeclaration: public Symbol, public Type
{
public:
ObjCForwardProtocolDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, Name *name);
virtual ~ObjCForwardProtocolDeclaration();
- // Symbol's interface
virtual FullySpecifiedType type() const;
+ virtual bool isEqualTo(const Type *other) const;
+
virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() const
{ return this; }
virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration()
{ return this; }
+ virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclarationType() const
+ { return this; }
+
+ virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclarationType()
+ { return this; }
+
protected:
virtual void visitSymbol0(SymbolVisitor *visitor);
+ virtual void accept0(TypeVisitor *visitor);
private:
};
@@ -525,23 +533,31 @@ private:
Array<ObjCProtocol *> _protocols;
};
-class CPLUSPLUS_EXPORT ObjCForwardClassDeclaration: public Symbol
+class CPLUSPLUS_EXPORT ObjCForwardClassDeclaration: public Symbol, public Type
{
public:
ObjCForwardClassDeclaration(TranslationUnit *translationUnit, unsigned sourceLocation, Name *name);
virtual ~ObjCForwardClassDeclaration();
- // Symbol's interface
virtual FullySpecifiedType type() const;
+ virtual bool isEqualTo(const Type *other) const;
+
virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() const
{ return this; }
virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclaration()
{ return this; }
+ virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclarationType() const
+ { return this; }
+
+ virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclarationType()
+ { return this; }
+
protected:
virtual void visitSymbol0(SymbolVisitor *visitor);
+ virtual void accept0(TypeVisitor *visitor);
private:
};
@@ -559,6 +575,20 @@ public:
Name *categoryName() const { return _categoryName; }
void setCategoryName(Name *categoryName) { _categoryName = categoryName; }
+ ObjCClass *baseClass() const
+ { return _baseClass; }
+ void setBaseClass(ObjCClass *baseClass)
+ { _baseClass = baseClass; }
+
+ unsigned protocolCount() const
+ { return _protocols.count(); }
+
+ ObjCProtocol *protocolAt(unsigned index) const
+ { return _protocols.at(index); }
+
+ void addProtocol(ObjCProtocol *protocol)
+ { _protocols.push_back(protocol); }
+
// Symbol's interface
virtual FullySpecifiedType type() const;
@@ -584,7 +614,7 @@ protected:
private:
bool _isInterface;
Name *_categoryName;
- Array<ObjCClass *> _baseClasses;
+ ObjCClass * _baseClass;
Array<ObjCProtocol *> _protocols;
};