| 1 | /* This file is part of the FaCT++ DL reasoner |
| 2 | Copyright (C) 2010-2015 Dmitry Tsarkov and The University of Manchester |
| 3 | Copyright (C) 2015-2017 Dmitry Tsarkov |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 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 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with this library; if not, write to the Free Software |
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #ifndef TDATATYPEMANAGER_H |
| 21 | #define TDATATYPEMANAGER_Hcxx . . $ `Kernel/tDataTypeManager.h:21:9`! |
| 22 | |
| 23 | #include "tDLExpression.h"cxx . . $ `<file>/Kernel/tDLExpression.h`/ |
| 24 | #include "tNameSet.h"cxx . . $ `<file>/Kernel/tNameSet.h`/ |
| 25 | |
| 26 | /// keeps all the TDLDataTypeName datatypes together with the names |
| 27 | class TDataTypeManagercxx . . $ TDataTypeManager#: public TNameSetcxx . . $ TNameSet#<TDLDataTypeNamecxx . . $ TDLDataTypeName#> |
| 28 | { |
| 29 | public: // interface |
| 30 | // names to build/compare datatypes |
| 31 | |
| 32 | /// get name of the default string datatype |
| 33 | static const char* getStrTypeNamecxx . . $ TDataTypeManager#getStrTypeName(33a1f659e94feb42). ( void ) { return "http://www.w3.org/2001/XMLSchema#string"; } |
| 34 | /// get name of the default integer datatype |
| 35 | static const char* getIntTypeNamecxx . . $ TDataTypeManager#getIntTypeName(33a1f659e94feb42). ( void ) { return "http://www.w3.org/2001/XMLSchema#integer"; } |
| 36 | /// get name of the default floating point datatype |
| 37 | static const char* getRealTypeNamecxx . . $ TDataTypeManager#getRealTypeName(33a1f659e94feb42). ( void ) { return "http://www.w3.org/2001/XMLSchema#float"; } |
| 38 | /// get name of the default boolean datatype |
| 39 | static const char* getBoolTypeNamecxx . . $ TDataTypeManager#getBoolTypeName(33a1f659e94feb42). ( void ) { return "http://www.w3.org/2001/XMLSchema#boolean"; } |
| 40 | /// get name of the default date-time datatype |
| 41 | static const char* getTimeTypeNamecxx . . $ TDataTypeManager#getTimeTypeName(33a1f659e94feb42). ( void ) { return "http://www.w3.org/2001/XMLSchema#dateTimeAsLong"; } |
| 42 | }; // TDataTypeManager |
| 43 | |
| 44 | // helpers for the users |
| 45 | |
| 46 | /// @return true iff TYPE is a default string data type |
| 47 | inline bool isStrDataTypecxx . . $ isStrDataType(f5cf6628e9a19bf6). ( const TDLDataTypeNamecxx . . $ TDLDataTypeName#* type ) { return stdcxx . . $ std/::stringcxx . . $ std/string#(type->getNamecxx . . $ TNamedEntity#getName(a9f41ea0e82d88cf).()) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). TDataTypeManagercxx . . $ TDataTypeManager#::getStrTypeNamecxx . . $ TDataTypeManager#getStrTypeName(33a1f659e94feb42).(); } |
| 48 | /// @return true iff TYPE is a default integer data type |
| 49 | inline bool isIntDataTypecxx . . $ isIntDataType(f5cf6628e9a19bf6). ( const TDLDataTypeNamecxx . . $ TDLDataTypeName#* type ) { return stdcxx . . $ std/::stringcxx . . $ std/string#(type->getNamecxx . . $ TNamedEntity#getName(a9f41ea0e82d88cf).()) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). TDataTypeManagercxx . . $ TDataTypeManager#::getIntTypeNamecxx . . $ TDataTypeManager#getIntTypeName(33a1f659e94feb42).(); } |
| 50 | /// @return true iff TYPE is a default floating point data type |
| 51 | inline bool isRealDataTypecxx . . $ isRealDataType(f5cf6628e9a19bf6). ( const TDLDataTypeNamecxx . . $ TDLDataTypeName#* type ) { return stdcxx . . $ std/::stringcxx . . $ std/string#(type->getNamecxx . . $ TNamedEntity#getName(a9f41ea0e82d88cf).()) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). TDataTypeManagercxx . . $ TDataTypeManager#::getRealTypeNamecxx . . $ TDataTypeManager#getRealTypeName(33a1f659e94feb42).(); } |
| 52 | /// @return true iff TYPE is a default boolean data type |
| 53 | inline bool isBoolDataTypecxx . . $ isBoolDataType(f5cf6628e9a19bf6). ( const TDLDataTypeNamecxx . . $ TDLDataTypeName#* type ) { return stdcxx . . $ std/::stringcxx . . $ std/string#(type->getNamecxx . . $ TNamedEntity#getName(a9f41ea0e82d88cf).()) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). TDataTypeManagercxx . . $ TDataTypeManager#::getBoolTypeNamecxx . . $ TDataTypeManager#getBoolTypeName(33a1f659e94feb42).(); } |
| 54 | /// @return true iff TYPE is a default date-time data type |
| 55 | inline bool isTimeDataTypecxx . . $ isTimeDataType(f5cf6628e9a19bf6). ( const TDLDataTypeNamecxx . . $ TDLDataTypeName#* type ) { return stdcxx . . $ std/::stringcxx . . $ std/string#(type->getNamecxx . . $ TNamedEntity#getName(a9f41ea0e82d88cf).()) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). TDataTypeManagercxx . . $ TDataTypeManager#::getTimeTypeNamecxx . . $ TDataTypeManager#getTimeTypeName(33a1f659e94feb42).(); } |
| 56 | |
| 57 | #endif |