| 1 | /* This file is part of the FaCT++ DL reasoner |
| 2 | Copyright (C) 2005-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 TDATATYPE_H |
| 21 | #define TDATATYPE_Hcxx . . $ `Kernel/tDataType.h:21:9`! |
| 22 | |
| 23 | #include "tDataEntry.h"cxx . . $ `<file>/Kernel/tDataEntry.h`/ |
| 24 | #include "tNECollection.h"cxx . . $ `<file>/Kernel/tNECollection.h`/ |
| 25 | |
| 26 | /// class for representing general data type |
| 27 | class TDataTypecxx . . $ TDataType#: public TNECollectioncxx . . $ TNECollection#<TDataEntrycxx . . $ TDataEntry#> |
| 28 | { |
| 29 | protected: // members |
| 30 | /// data type |
| 31 | TDataEntrycxx . . $ TDataEntry#* Typecxx . . $ TDataType#Type.; |
| 32 | /// data type |
| 33 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<TDataEntrycxx . . $ TDataEntry#*> Exprcxx . . $ TDataType#Expr.; |
| 34 | |
| 35 | protected: // methods |
| 36 | /// register data value in the datatype |
| 37 | void registerNewcxx . . $ TDataType#registerNew(89f733d05fbcf024). ( TDataEntrycxx . . $ TDataEntry#* p ) override { p->setHostTypecxx . . $ TDataEntry#setHostType(e6573819832c2575).(Typecxx . . $ TDataType#Type.); } |
| 38 | |
| 39 | public: // interface |
| 40 | /// c'tor: create the TYPE entry |
| 41 | explicit TDataTypecxx . . $ TDataType#TDataType(9c546c94e5fcce4e). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& name ) |
| 42 | : TNECollectioncxx . . $ TNECollection#<TDataEntrycxx . . $ TDataEntry#>(name) |
| 43 | { Typecxx . . $ TDataType#Type. = new TDataEntrycxx . . $ TDataEntry#(name); } |
| 44 | /// no copy c'tor |
| 45 | TDataTypecxx . . $ TDataType#TDataType(df291f23353bb1c4). ( const TDataTypecxx . . $ TDataType#& ) = delete; |
| 46 | /// no assignment |
| 47 | TDataTypecxx . . $ TDataType#& operatorcxx . . $ TDataType#`operator=`(6a83d17b8d3f272c). = ( const TDataTypecxx . . $ TDataType#& ) = delete; |
| 48 | /// d'tor: delete data type entry and all the expressions |
| 49 | ~cxx . . $ TDataType#`~TDataType`(49f6e7a06ebc5aa8).TDataTypecxx . . $ TDataType#() override |
| 50 | { |
| 51 | for ( auto& p: Exprcxx . . $ TDataType#Expr. ) |
| 52 | delete p; |
| 53 | delete Typecxx . . $ TDataType#Type.; |
| 54 | } |
| 55 | |
| 56 | // access to the type |
| 57 | |
| 58 | /// get RW access to the type entry (useful for relevance etc) |
| 59 | TDataEntrycxx . . $ TDataEntry#* getTypecxx . . $ TDataType#getType(2a23bdf9a3864e65). ( void ) { return Typecxx . . $ TDataType#Type.; } |
| 60 | /// get RO access to the type entry |
| 61 | const TDataEntrycxx . . $ TDataEntry#* getTypecxx . . $ TDataType#getType(bcfda270e2d2df96). ( void ) const { return Typecxx . . $ TDataType#Type.; } |
| 62 | |
| 63 | /// create new expression of the type |
| 64 | TDataEntrycxx . . $ TDataEntry#* getExprcxx . . $ TDataType#getExpr(2a23bdf9a3864e65). ( void ) |
| 65 | { |
| 66 | TDataEntrycxx . . $ TDataEntry#* ret = registerElemcxx . . $ TNECollection#registerElem(98ea26de6545f0ca).(new TDataEntrycxx . . $ TDataEntry#("expr"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)); |
| 67 | Exprcxx . . $ TDataType#Expr..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(ret); |
| 68 | return ret; |
| 69 | } |
| 70 | }; // TDataType |
| 71 | |
| 72 | #endif |