Changeset View
Changeset View
Standalone View
Standalone View
duchain/types/structuretype.h
Show All 17 Lines | |||||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | ||
19 | ***************************************************************************/ | 19 | ***************************************************************************/ | ||
20 | 20 | | |||
21 | #ifndef PHP_STRUCTURETYPE_H | 21 | #ifndef PHP_STRUCTURETYPE_H | ||
22 | #define PHP_STRUCTURETYPE_H | 22 | #define PHP_STRUCTURETYPE_H | ||
23 | 23 | | |||
24 | #include <language/duchain/types/structuretype.h> | 24 | #include <language/duchain/types/structuretype.h> | ||
25 | #include <language/duchain/types/typesystemdata.h> | 25 | #include <language/duchain/types/typesystemdata.h> | ||
26 | #include <serialization/indexedstring.h> | ||||
27 | | ||||
26 | #include "phpduchainexport.h" | 28 | #include "phpduchainexport.h" | ||
27 | 29 | | |||
28 | namespace Php | 30 | namespace Php | ||
29 | { | 31 | { | ||
30 | 32 | | |||
31 | class KDEVPHPDUCHAIN_EXPORT StructureTypeData : public KDevelop::StructureTypeData | 33 | class KDEVPHPDUCHAIN_EXPORT StructureTypeData : public KDevelop::StructureTypeData | ||
32 | { | 34 | { | ||
33 | public: | 35 | public: | ||
Show All 26 Lines | 57 | public: | |||
60 | /// Copy constructor. \param rhs type to copy | 62 | /// Copy constructor. \param rhs type to copy | ||
61 | StructureType(const StructureType& rhs); | 63 | StructureType(const StructureType& rhs); | ||
62 | /// Constructor using raw data. \param data internal data. | 64 | /// Constructor using raw data. \param data internal data. | ||
63 | StructureType(StructureTypeData& data); | 65 | StructureType(StructureTypeData& data); | ||
64 | 66 | | |||
65 | void setPrettyName(const KDevelop::IndexedString& name); | 67 | void setPrettyName(const KDevelop::IndexedString& name); | ||
66 | KDevelop::IndexedString prettyName() const; | 68 | KDevelop::IndexedString prettyName() const; | ||
67 | 69 | | |||
68 | virtual QString toString() const; | 70 | QString toString() const override; | ||
69 | 71 | | |||
70 | virtual KDevelop::AbstractType* clone() const; | 72 | KDevelop::AbstractType* clone() const override; | ||
71 | 73 | | |||
72 | virtual uint hash() const; | 74 | uint hash() const override; | ||
73 | 75 | | |||
74 | enum { | 76 | enum { | ||
75 | ///TODO: is that value OK? | 77 | ///TODO: is that value OK? | ||
76 | Identity = 51 | 78 | Identity = 51 | ||
77 | }; | 79 | }; | ||
78 | 80 | | |||
79 | typedef StructureTypeData Data; | 81 | typedef StructureTypeData Data; | ||
80 | typedef KDevelop::StructureType BaseType; | 82 | typedef KDevelop::StructureType BaseType; | ||
81 | 83 | | |||
82 | protected: | 84 | protected: | ||
83 | TYPE_DECLARE_DATA(StructureType); | 85 | TYPE_DECLARE_DATA(StructureType); | ||
84 | }; | 86 | }; | ||
85 | 87 | | |||
86 | } | 88 | } | ||
87 | 89 | | |||
88 | namespace KDevelop | 90 | namespace KDevelop | ||
89 | { | 91 | { | ||
90 | 92 | | |||
91 | template<> | 93 | template<> | ||
92 | inline Php::StructureType* fastCast<Php::StructureType*>(AbstractType* from) { | 94 | inline Php::StructureType* fastCast<Php::StructureType*>(AbstractType* from) { | ||
93 | if ( !from || from->whichType() != AbstractType::TypeStructure ) { | 95 | if ( !from || from->whichType() != AbstractType::TypeStructure ) { | ||
94 | return 0; | 96 | return nullptr; | ||
95 | } else { | 97 | } else { | ||
96 | return dynamic_cast<Php::StructureType*>(from); | 98 | return dynamic_cast<Php::StructureType*>(from); | ||
97 | } | 99 | } | ||
98 | } | 100 | } | ||
99 | 101 | | |||
100 | } | 102 | } | ||
101 | 103 | | |||
102 | #endif // PHP_STRUCTURETYPE_H | 104 | #endif // PHP_STRUCTURETYPE_H | ||
103 | 105 | |