• 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
integraltype.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_INTEGRALTYPE_H
22 #define KDEVPLATFORM_INTEGRALTYPE_H
23 
24 #include "abstracttype.h"
25 
26 namespace KDevelop {
27 class IntegralTypeData;
28 
35 class KDEVPLATFORMLANGUAGE_EXPORT IntegralType
36  : public AbstractType
37 {
38 public:
39  using Ptr = TypePtr<IntegralType>;
40 
46  enum CommonIntegralTypes {
47  TypeVoid,
48  TypeNone,
49  TypeNull,
50  TypeChar,
51  TypeBoolean,
52  TypeByte,
53  TypeSbyte,
54  TypeShort,
55  TypeInt,
56  TypeLong,
57  TypeFloat,
58  TypeDouble,
59  TypeWchar_t,
60  TypeString,
61  TypeMixed,
62  TypeChar16_t,
63  TypeChar32_t,
64  TypeLanguageSpecific = 200
65  };
66 
68  explicit IntegralType(uint type = TypeNone);
70  IntegralType(const IntegralType& rhs);
72  explicit IntegralType(IntegralTypeData& data);
74  ~IntegralType() override;
75 
76  IntegralType& operator=(const IntegralType& rhs) = delete;
77 
83  uint dataType() const;
84 
90  void setDataType(uint dataType);
91 
96  QString toString() const override;
97 
98  uint hash() const override;
99 
100  WhichType whichType() const override;
101 
102  AbstractType* clone() const override;
103 
104  bool equals(const AbstractType* rhs) const override;
105 
106  enum {
107  Identity = 2
108  };
109 
110  using Data = IntegralTypeData;
111 
112 protected:
113  void accept0 (TypeVisitor* v) const override;
114 
115  TYPE_DECLARE_DATA(IntegralType)
116 };
117 
118 template <>
119 inline IntegralType* fastCast<IntegralType*>(AbstractType* from)
120 {
121  if (!from || from->whichType() != AbstractType::TypeIntegral)
122  return nullptr;
123  else
124  return static_cast<IntegralType*>(from);
125 }
126 }
127 
128 #endif
KDevelop::IntegralType::TypeShort
Definition: integraltype.h:54
KDevelop::IntegralType::TypeFloat
Definition: integraltype.h:57
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::IntegralType::TypeLong
Definition: integraltype.h:56
KDevelop::IntegralType::CommonIntegralTypes
CommonIntegralTypes
Enumeration of frequently used integral types.
Definition: integraltype.h:46
KDevelop::TypePtr< AbstractType >
KDevelop::AbstractType::whichType
virtual WhichType whichType() const
Determine which data type this abstract type represents.
Definition: abstracttype.cpp:120
KDevelop::IntegralType::TypeChar
Definition: integraltype.h:50
KDevelop::IntegralType::TypeByte
Definition: integraltype.h:52
KDevelop::IntegralType::TypeInt
Definition: integraltype.h:55
KDevelop::IntegralTypeData
Private data structure for IntegralType.
Definition: typesystemdata.h:115
QString
KDevelop::IntegralType::TypeChar32_t
Definition: integraltype.h:63
KDevelop::IntegralType::TypeBoolean
Definition: integraltype.h:51
KDevelop::IntegralType::TypeNull
Definition: integraltype.h:49
KDevelop::IntegralType::TypeString
Definition: integraltype.h:60
KDevelop::IntegralType::TypeSbyte
Definition: integraltype.h:53
KDevelop::TypeVisitor
Definition: typesystem.h:41
KDevelop::IntegralType
A type representing inbuilt data types.
Definition: integraltype.h:35
KDevelop::fastCast< IntegralType * >
IntegralType * fastCast< IntegralType * >(AbstractType *from)
Definition: integraltype.h:119
KDevelop::IntegralType::TypeVoid
Definition: integraltype.h:47
KDevelop::IntegralType::TypeChar16_t
Definition: integraltype.h:62
abstracttype.h
KDevelop
Definition: abstractfunctiondeclaration.cpp:27
KDevelop::IntegralType::TypeDouble
Definition: integraltype.h:58
KDevelop::IntegralType::TypeMixed
Definition: integraltype.h:61
KDevelop::AbstractType::TypeIntegral
an integral
Definition: abstracttype.h:216
KDevelop::IntegralType::TypeWchar_t
Definition: integraltype.h:59
KDevelop::IntegralType::TypeNone
Definition: integraltype.h:48
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 Sun Mar 7 2021 23:29:30 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