• 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
enumeratortype.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_ENUMERATORTYPE_H
23 #define KDEVPLATFORM_ENUMERATORTYPE_H
24 
25 #include "identifiedtype.h"
26 #include "constantintegraltype.h"
27 
28 namespace KDevelop {
29 using EnumeratorTypeBase = KDevelop::MergeIdentifiedType<ConstantIntegralType>;
30 
31 using EnumeratorTypeData = EnumeratorTypeBase::Data;
32 
33 //The same as EnumerationType, with the difference that here the value is also known
34 class KDEVPLATFORMLANGUAGE_EXPORT EnumeratorType
35  : public EnumeratorTypeBase
36 {
37 public:
38  EnumeratorType(const EnumeratorType& rhs);
39 
40  explicit EnumeratorType(EnumeratorTypeData& data);
41 
42  EnumeratorType();
43 
44  EnumeratorType& operator=(const EnumeratorType& rhs) = delete;
45 
46  using Ptr = TypePtr<EnumeratorType>;
47 
48  bool equals(const KDevelop::AbstractType* rhs) const override;
49 
50  KDevelop::AbstractType* clone() const override;
51 
52  uint hash() const override;
53 
54  WhichType whichType() const override;
55 
56  QString toString() const override;
57 
58  enum {
59  Identity = 20
60  };
61 
62  using Data = EnumeratorTypeData;
63 
64 protected:
65  TYPE_DECLARE_DATA(EnumeratorType);
66 };
67 
68 template <>
69 inline EnumeratorType* fastCast<EnumeratorType*>(AbstractType* from)
70 {
71  if (!from || from->whichType() != KDevelop::AbstractType::TypeEnumerator)
72  return nullptr;
73  else
74  return static_cast<EnumeratorType*>(from);
75 }
76 }
77 
78 #endif // KDEVPLATFORM_ENUMERATORTYPE_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
KDevelop::AbstractType::TypeEnumerator
an enumerator type
Definition: abstracttype.h:224
QString
KDevelop::MergeIdentifiedType
Implements everything necessary to merge the given Parent class with IdentifiedType Your used Data cl...
Definition: identifiedtype.h:135
KDevelop::EnumeratorType
Definition: enumeratortype.h:34
KDevelop::MergeIdentifiedType::Data
Definition: identifiedtype.h:141
KDevelop
Definition: abstractfunctiondeclaration.cpp:27
KDevelop::EnumeratorTypeData
EnumeratorTypeBase::Data EnumeratorTypeData
Definition: enumeratortype.h:31
identifiedtype.h
KDevelop::fastCast< EnumeratorType * >
EnumeratorType * fastCast< EnumeratorType * >(AbstractType *from)
Definition: enumeratortype.h:69
constantintegraltype.h
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 Mon Mar 8 2021 23:29:50 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