1 /* This file is part of NIT ( http://www.nitlanguage.org ).
3 * Copyright 2011 Alexis Laferrière <alexis.laf@xymus.net>
5 * This file is free software, which comes along with NIT. This software is
6 * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
8 * PARTICULAR PURPOSE. You can modify it is you want, provided this header
9 * is kept unaltered, and a notification of the changes is added.
10 * You are allowed to redistribute it and sell it, alone or is a part of
14 #include "test_ni_cast_extra.nit.h"
17 C implementation of test_ni_cast_extra::A::isa_b
19 Imported methods signatures:
20 int A_is_a_B( A value ) to check if a A is a B
21 B A_as_B( A value ) to cast from A to B
23 int A_isa_b___impl( A recv
)
25 return A_is_a_B( recv
);
29 C implementation of test_ni_cast_extra::A::as_b
31 Imported methods signatures:
32 int A_is_a_B( A value ) to check if a A is a B
33 B A_as_B( A value ) to cast from A to B
34 int A_is_a_nullable_B( A value ) to check if a A is a nullable B
35 nullable_B A_as_nullable_B( A value ) to cast from A to nullable B
37 nullable_B
A_as_b___impl( A recv
)
39 if ( A_is_a_nullable_B( recv
) )
40 return A_as_nullable_B( recv
);
46 C implementation of test_ni_cast_extra::C::isa_a
48 Imported methods signatures:
49 int C_is_a_A( C value ) to check if a C is a A
50 A C_as_A( C value ) to cast from C to A
52 int C_isa_a___impl( C recv
)
54 return C_is_a_A( recv
);
58 C implementation of test_ni_cast_extra::D::as_a
60 Imported methods signatures:
61 int D_is_a_A( D value ) to check if a D is a A
62 A D_as_A( D value ) to cast from D to A
64 A
D_as_a___impl( D recv
)
66 return D_as_A( recv
);