• 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
arraytype.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  Copyright 2007-2008 David Nolden <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef KDEVPLATFORM_ARRAYTYPE_H
22 #define KDEVPLATFORM_ARRAYTYPE_H
23 
24 #include "abstracttype.h"
25 
26 namespace KDevelop {
27 class ArrayTypeData;
28 
29 class KDEVPLATFORMLANGUAGE_EXPORT ArrayType
30  : public AbstractType
31 {
32 public:
33  using Ptr = TypePtr<ArrayType>;
34 
36  ArrayType();
38  ArrayType(const ArrayType& rhs);
40  explicit ArrayType(ArrayTypeData& data);
42  ~ArrayType() override;
43 
44  ArrayType& operator=(const ArrayType& rhs) = delete;
45 
46  AbstractType* clone() const override;
47 
48  bool equals(const AbstractType* rhs) const override;
49 
56  int dimension () const;
57 
64  void setDimension(int dimension);
65 
71  AbstractType::Ptr elementType () const;
72 
76  void setElementType(const AbstractType::Ptr& type);
77 
78  QString toString() const override;
79 
80  uint hash() const override;
81 
82  WhichType whichType() const override;
83 
84  void exchangeTypes(TypeExchanger* exchanger) override;
85 
86  enum {
87  Identity = 7
88  };
89 
90  using Data = ArrayTypeData;
91 
92 protected:
93  void accept0 (TypeVisitor* v) const override;
94 
95  TYPE_DECLARE_DATA(ArrayType)
96 };
97 
98 template <>
99 inline ArrayType* fastCast<ArrayType*>(AbstractType* from)
100 {
101  if (!from || from->whichType() != AbstractType::TypeArray)
102  return nullptr;
103  else
104  return static_cast<ArrayType*>(from);
105 }
106 }
107 
108 #endif // KDEVPLATFORM_TYPESYSTEM_H
KDevelop::fastCast< ArrayType * >
ArrayType * fastCast< ArrayType * >(AbstractType *from)
Definition: arraytype.h:99
KDevelop::ArrayTypeData
Private data structure for ArrayType.
Definition: typesystemdata.h:212
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
AbstractTypeData
KDevelop::TypePtr< AbstractType >
KDevelop::AbstractType::TypeArray
an array
Definition: abstracttype.h:221
KDevelop::AbstractType::whichType
virtual WhichType whichType() const
Determine which data type this abstract type represents.
Definition: abstracttype.cpp:120
QString
KDevelop::TypeVisitor
Definition: typesystem.h:41
KDevelop::TypeExchanger
A class that can be used to walk through all types that are references from one type,...
Definition: typesystem.h:103
abstracttype.h
KDevelop
Definition: abstractfunctiondeclaration.cpp:27
KDevelop::ArrayType
Definition: arraytype.h:29
KDevelop::AbstractType::WhichType
WhichType
Enumeration of major data types.
Definition: abstracttype.h:214
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 Sat Jan 23 2021 09:40:52 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