• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/language/duchain

  • sources
  • kfour-appscomplete
  • kdevelop
  • kdevplatform
  • language
  • duchain
  • types
structuretype.h
Go to the documentation of this file.
1 /* This file is part of KDevelop
2  Copyright 2006 Roberto Raggi <[email protected]>
3  Copyright 2006-2008 Hamish Rodda <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef KDEVPLATFORM_STRUCTURETYPE_H
21 #define KDEVPLATFORM_STRUCTURETYPE_H
22 
23 #include "abstracttype.h"
24 #include "identifiedtype.h"
25 #include "typesystemdata.h"
26 
27 namespace KDevelop {
28 class StructureTypeData;
29 
30 using StructureTypeBase = MergeIdentifiedType<AbstractType>;
31 
38 class KDEVPLATFORMLANGUAGE_EXPORT StructureType
39  : public StructureTypeBase
40 {
41 public:
42  using Ptr = TypePtr<StructureType>;
43 
45  StructureType();
47  StructureType(const StructureType& rhs);
49  explicit StructureType(StructureTypeData& data);
51  ~StructureType() override;
52 
53  StructureType& operator=(const StructureType& rhs) = delete;
54 
55  AbstractType* clone() const override;
56 
57  bool equals(const AbstractType* rhs) const override;
58 
59  QString toString() const override;
60 
61  uint hash() const override;
62 
63  WhichType whichType() const override;
64 
65  //virtual void exchangeTypes(KDevelop::TypeExchanger*);
66 
67  enum {
68  Identity = 6
69  };
70 
71  using Data = StructureTypeData;
72 
73 protected:
74  void accept0 (TypeVisitor* v) const override;
75 
76  TYPE_DECLARE_DATA(StructureType)
77 };
78 
79 template <>
80 inline StructureType* fastCast<StructureType*>(AbstractType* from)
81 {
82  if (!from || from->whichType() != AbstractType::TypeStructure)
83  return nullptr;
84  else
85  return static_cast<StructureType*>(from);
86 }
87 }
88 
89 #endif
KDevelop::AbstractType::TypeStructure
a structure
Definition: abstracttype.h:220
TYPE_DECLARE_DATA
#define TYPE_DECLARE_DATA(Class)
This macro is used to declare type-specific data-access functions within subclasses of AbstractType.
Definition: abstracttype.h:38
KDevelop::StructureTypeData
Private data structure for StructureType.
Definition: typesystemdata.h:198
KDevelop::TypePtr
QExplicitlySharedDataPointer wrapper with convenience functions attached.
Definition: typepointer.h:39
KDevelop::AbstractType::whichType
virtual WhichType whichType() const
Determine which data type this abstract type represents.
Definition: abstracttype.cpp:120
typesystemdata.h
KDevelop::fastCast< StructureType * >
StructureType * fastCast< StructureType * >(AbstractType *from)
Definition: structuretype.h:80
QString
KDevelop::MergeIdentifiedType
Implements everything necessary to merge the given Parent class with IdentifiedType Your used Data cl...
Definition: identifiedtype.h:135
KDevelop::TypeVisitor
Definition: typesystem.h:41
abstracttype.h
KDevelop
Definition: abstractfunctiondeclaration.cpp:27
identifiedtype.h
KDevelop::StructureType
A type representing structure types.
Definition: structuretype.h:38
KDevelop::AbstractType
Base class for all types.
Definition: abstracttype.h:87
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Mar 3 2021 00:37:28 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/language/duchain

Skip menu "kdevplatform/language/duchain"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal