| 1 | /* |
| 2 | * %injeqt copyright begin% |
| 3 | * Copyright 2014 Rafał Malinowski ([email protected]) |
| 4 | * %injeqt copyright end% |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Lesser General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2.1 of the License, or (at your option) any later version. |
| 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 | * Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public |
| 17 | * License along with this library; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #include "implemented-by.h"cxx . . $ `<file>/src/internal/implemented-by.h`/ |
| 22 | |
| 23 | #include <injeqt/type.h>cxx . . $ `<file>/include/injeqt/type.h`/ |
| 24 | |
| 25 | #include "interfaces-utils.h"cxx . . $ `<file>/src/internal/interfaces-utils.h`/ |
| 26 | |
| 27 | #include <cassert> |
| 28 | |
| 29 | namespace injeqtcxx . . $ injeqt/ { namespace internalcxx . . $ injeqt/internal/ { |
| 30 | |
| 31 | implemented_bycxx . . $ injeqt/internal/implemented_by#::implemented_bycxx . . $ injeqt/internal/implemented_by#implemented_by(4db51c5aea7c0a3b).(typecxx . . $ injeqt/v1/type# interface_type, typecxx . . $ injeqt/v1/type# implementation_type) : |
| 32 | _interface_typecxx . . $ injeqt/internal/implemented_by#_interface_type.{stdcxx . . $ std/::movecxx . . $ std/move(e7c6c0c8363dcc46).(interface_type)}, |
| 33 | _implementation_typecxx . . $ injeqt/internal/implemented_by#_implementation_type.{stdcxx . . $ std/::movecxx . . $ std/move(e7c6c0c8363dcc46).(implementation_type)} |
| 34 | { |
| 35 | assertcxx . . $ `<external>/4398592474888995393/assert.h:102:11`!(!_interface_type.is_empty()); |
| 36 | assertcxx . . $ `<external>/4398592474888995393/assert.h:102:11`!(!_implementation_type.is_empty()); |
| 37 | assertcxx . . $ `<external>/4398592474888995393/assert.h:102:11`!(implements(_implementation_type, _interface_type)); |
| 38 | } |
| 39 | |
| 40 | typecxx . . $ injeqt/v1/type# implemented_bycxx . . $ injeqt/internal/implemented_by#::interface_typecxx . . $ injeqt/internal/implemented_by#interface_type(358fec32f253752a).() const |
| 41 | { |
| 42 | return _interface_typecxx . . $ injeqt/internal/implemented_by#_interface_type.; |
| 43 | } |
| 44 | |
| 45 | typecxx . . $ injeqt/v1/type# implemented_bycxx . . $ injeqt/internal/implemented_by#::implementation_typecxx . . $ injeqt/internal/implemented_by#implementation_type(358fec32f253752a).() const |
| 46 | { |
| 47 | return _implementation_typecxx . . $ injeqt/internal/implemented_by#_implementation_type.; |
| 48 | } |
| 49 | |
| 50 | bool operatorcxx . . $ injeqt/internal/`operator==`(d9f8f2b8a72cd82a). == (const implemented_bycxx . . $ injeqt/internal/implemented_by# &x, const implemented_bycxx . . $ injeqt/internal/implemented_by# &y) |
| 51 | { |
| 52 | if (x.interface_typecxx . . $ injeqt/internal/implemented_by#interface_type(358fec32f253752a).() !=cxx . . $ injeqt/v1/`operator!=`(24fd26303071bddf). y.interface_typecxx . . $ injeqt/internal/implemented_by#interface_type(358fec32f253752a).()) |
| 53 | return false; |
| 54 | |
| 55 | if (x.implementation_typecxx . . $ injeqt/internal/implemented_by#implementation_type(358fec32f253752a).() !=cxx . . $ injeqt/v1/`operator!=`(24fd26303071bddf). y.implementation_typecxx . . $ injeqt/internal/implemented_by#implementation_type(358fec32f253752a).()) |
| 56 | return false; |
| 57 | |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | bool operatorcxx . . $ injeqt/internal/`operator!=`(d9f8f2b8a72cd82a). != (const implemented_bycxx . . $ injeqt/internal/implemented_by# &x, const implemented_bycxx . . $ injeqt/internal/implemented_by# &y) |
| 62 | { |
| 63 | return !(x ==cxx . . $ injeqt/internal/`operator==`(d9f8f2b8a72cd82a). y); |
| 64 | } |
| 65 | |
| 66 | }} |