• 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
enumerationtype.h
Go to the documentation of this file.
1 /* This file is part of KDevelop
2  Copyright 2002-2005 Roberto Raggi <[email protected]>
3  Copyright 2006 Adam Treat <[email protected]>
4  Copyright 2006-2008 Hamish Rodda <[email protected]>
5  Copyright 2007-2008 David Nolden <[email protected]>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License version 2 as published by the Free Software Foundation.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef KDEVPLATFORM_ENUMERATIONTYPE_H
23 #define KDEVPLATFORM_ENUMERATIONTYPE_H
24 
25 #include "integraltype.h"
26 #include "identifiedtype.h"
27 #include "typesystemdata.h" // for IntegralTypeData (used in EnumerationTypeBase)
28 
29 namespace KDevelop {
30 using EnumerationTypeBase = KDevelop::MergeIdentifiedType<IntegralType>;
31 
32 using EnumerationTypeData = EnumerationTypeBase::Data;
33 
34 class KDEVPLATFORMLANGUAGE_EXPORT EnumerationType
35  : public EnumerationTypeBase
36 {
37 public:
38  EnumerationType();
39 
40  EnumerationType(const EnumerationType& rhs);
41 
42  explicit EnumerationType(EnumerationTypeData& data);
43 
44  EnumerationType& operator=(const EnumerationType& rhs) = delete;
45 
46  using Ptr = TypePtr<EnumerationType>;
47 
48  uint hash() const override;
49 
50  KDevelop::AbstractType* clone() const override;
51 
52  bool equals(const KDevelop::AbstractType* rhs) const override;
53 
54  QString toString() const override;
55 
56  WhichType whichType() const override;
57 
58  enum {
59  Identity = 21
60  };
61 
62  using Data = EnumerationTypeData;
63 
64 protected:
65  TYPE_DECLARE_DATA(EnumerationType);
66 };
67 
68 template <>
69 inline EnumerationType* fastCast<EnumerationType*>(AbstractType* from)
70 {
71  if (!from || from->whichType() != KDevelop::AbstractType::TypeEnumeration)
72  return nullptr;
73  else
74  return static_cast<EnumerationType*>(from);
75 }
76 }
77 
78 #endif // KDEVPLATFORM_ENUMERATIONTYPE_H
integraltype.h
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::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
QString
KDevelop::fastCast< EnumerationType * >
EnumerationType * fastCast< EnumerationType * >(AbstractType *from)
Definition: enumerationtype.h:69
KDevelop::EnumerationType
Definition: enumerationtype.h:34
KDevelop::MergeIdentifiedType
Implements everything necessary to merge the given Parent class with IdentifiedType Your used Data cl...
Definition: identifiedtype.h:135
KDevelop::EnumerationTypeData
EnumerationTypeBase::Data EnumerationTypeData
Definition: enumerationtype.h:32
KDevelop::MergeIdentifiedType::Data
Definition: identifiedtype.h:141
KDevelop
Definition: abstractfunctiondeclaration.cpp:27
identifiedtype.h
KDevelop::AbstractType::TypeEnumeration
an enumeration type
Definition: abstracttype.h:223
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 Thu Jan 21 2021 23:35:46 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