diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-11-12 18:41:11 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-11-13 19:43:43 (GMT) |
commit | 784313b82442747843145429d39e5d257256b7b0 (patch) | |
tree | 195922e2d73dce62f125221bf1f30e0bf4b37f02 /src/classdef.h | |
parent | 075229e586b391c3ec7ad79597aaeae392ca64e5 (diff) | |
download | Doxygen-784313b82442747843145429d39e5d257256b7b0.zip Doxygen-784313b82442747843145429d39e5d257256b7b0.tar.gz Doxygen-784313b82442747843145429d39e5d257256b7b0.tar.bz2 |
Refactoring: replacing dynamic_cast by static_cast to improve performance
Diffstat (limited to 'src/classdef.h')
-rw-r--r-- | src/classdef.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/classdef.h b/src/classdef.h index 5dd35d3..e23bc19 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -91,7 +91,7 @@ using BaseClassList = std::vector<BaseClassDef>; * A compound can be a class, struct, union, interface, service, singleton, * or exception. */ -class ClassDef : virtual public Definition +class ClassDef : public Definition { public: /** The various compound types */ @@ -108,8 +108,6 @@ class ClassDef : virtual public Definition virtual ~ClassDef() {} - static ClassDefMutable *make_mutable(const ClassDef *); - //----------------------------------------------------------------------------------- // --- getters //----------------------------------------------------------------------------------- @@ -386,7 +384,7 @@ class ClassDef : virtual public Definition }; -class ClassDefMutable : virtual public DefinitionMutable, virtual public ClassDef +class ClassDefMutable : public DefinitionMutable, public ClassDef { public: //----------------------------------------------------------------------------------- @@ -467,9 +465,6 @@ class ClassDefMutable : virtual public DefinitionMutable, virtual public ClassDe }; -inline ClassDefMutable *ClassDef::make_mutable(const ClassDef *cd) -{ return dynamic_cast<ClassDefMutable*>(const_cast<ClassDef*>(cd)); } - /** Factory method to create a new ClassDef object */ ClassDefMutable *createClassDef( const char *fileName,int startLine,int startColumn, @@ -479,6 +474,13 @@ ClassDefMutable *createClassDef( ClassDef *createClassDefAlias(const Definition *newScope,const ClassDef *cd); +// --- Cast functions + +ClassDef *toClassDef(Definition *d); +ClassDef *toClassDef(DefinitionMutable *d); +const ClassDef *toClassDef(const Definition *d); +ClassDefMutable *toClassDefMutable(Definition *d); +ClassDefMutable *toClassDefMutable(const Definition *d); //------------------------------------------------------------------------ |