• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDevelop Platform Libraries
  • Sitemap
  • Contact Us
 

language/duchain

indexedtype.cpp

00001 /* This file is part of KDevelop
00002    Copyright 2007-2009 David Nolden <david.nolden.kdevelop@art-master.de>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #include "indexedtype.h"
00020 
00021 #include "../repositories/typerepository.h"
00022 #include "../referencecounting.h"
00023 
00024 namespace KDevelop
00025 {
00026 
00027 IndexedType::IndexedType(uint index) : m_index(index) {
00028   if(m_index && shouldDoDUChainReferenceCounting(this))
00029     TypeRepository::increaseReferenceCount(m_index, this);
00030 }
00031 
00032 IndexedType::IndexedType(const IndexedType& rhs) : m_index(rhs.m_index) {
00033   if(m_index && shouldDoDUChainReferenceCounting(this))
00034     TypeRepository::increaseReferenceCount(m_index, this);
00035 }
00036 
00037 IndexedType::~IndexedType() {
00038   if(m_index && shouldDoDUChainReferenceCounting(this))
00039     TypeRepository::decreaseReferenceCount(m_index, this);
00040 }
00041 
00042 IndexedType& IndexedType::operator=(const IndexedType& rhs) {
00043   
00044   if(m_index && shouldDoDUChainReferenceCounting(this))
00045     TypeRepository::decreaseReferenceCount(m_index, this);
00046 
00047   m_index = rhs.m_index;
00048   
00049   if(m_index && shouldDoDUChainReferenceCounting(this))
00050     TypeRepository::increaseReferenceCount(m_index, this);
00051   
00052   return *this;
00053 }
00054 
00055 AbstractType::Ptr IndexedType::abstractType() const {
00056   if(!m_index)
00057     return AbstractType::Ptr();
00058   return TypeRepository::typeForIndex(m_index);
00059 }
00060 }
00061 
00062 // kate: space-indent on; indent-width 2; tab-width 4; replace-tabs on; auto-insert-doxygen on

language/duchain

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

KDevelop Platform Libraries

Skip menu "KDevelop Platform Libraries"
  • interfaces
  • language
  •   codegen
  •   duchain
  •   editor
  • outputview
  • project
  • shell
  • sublime
  • util
  • vcs
Generated for KDevelop Platform Libraries by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal