File indexing completed on 2024-06-23 05:48:59

0001 /*
0002     This file is part of the Okteta Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2011 Alex Richardson <alex.richardson@gmx.de>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "datainformationbase.hpp"
0010 #include "topleveldatainformation.hpp"
0011 
0012 DataInformationBase::DataInformationBase() = default;
0013 
0014 DataInformationBase::~DataInformationBase() = default;
0015 
0016 bool DataInformationBase::isArray() const
0017 {
0018     return false;
0019 }
0020 
0021 bool DataInformationBase::isDummy() const
0022 {
0023     return false;
0024 }
0025 
0026 bool DataInformationBase::isPrimitive() const
0027 {
0028     return false;
0029 }
0030 
0031 bool DataInformationBase::isEnum() const
0032 {
0033     return false;
0034 }
0035 
0036 bool DataInformationBase::isStruct() const
0037 {
0038     return false;
0039 }
0040 
0041 bool DataInformationBase::isUnion() const
0042 {
0043     return false;
0044 }
0045 
0046 bool DataInformationBase::isBitfield() const
0047 {
0048     return false;
0049 }
0050 
0051 bool DataInformationBase::isString() const
0052 {
0053     return false;
0054 }
0055 
0056 bool DataInformationBase::isPointer() const
0057 {
0058     return false;
0059 }
0060 
0061 bool DataInformationBase::isTaggedUnion() const
0062 {
0063     return false;
0064 }
0065 
0066 bool DataInformationBase::isDataInformationWithChildren() const
0067 {
0068     return false;
0069 }
0070 
0071 bool DataInformationBase::isDataInformationWithDummyChildren() const
0072 {
0073     return false;
0074 }
0075 
0076 TopLevelDataInformation* DataInformationBase::asTopLevel()
0077 {
0078     // multiple inheritance -> we can't use reinterpret_cast -> we have to include the file
0079     return isTopLevel() ? static_cast<TopLevelDataInformation*>(this) : nullptr;
0080 }
0081 
0082 const TopLevelDataInformation* DataInformationBase::asTopLevel() const
0083 {
0084     // multiple inheritance -> we can't use reinterpret_cast -> we have to include the file
0085     return isTopLevel() ? static_cast<const TopLevelDataInformation*>(this) : nullptr;
0086 }