Update procedures
[shapes.git] / source / operatorside_none.h
blob78791ec065a943cc9c4cea15b70f7759091534d9
1 /* This file is part of Shapes.
3 * Shapes is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * any later version.
8 * Shapes is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright 2008 Henrik Tidefelt
19 /* Use the two looping macros above in a nested manner to produce a default method declaration
20 * for each pair combination of classes.
22 #define DEFAULTUNARYOPDECL_( Ta ) virtual RefCountPtr< const Lang::Value > op( const RefCountPtr< const Shapes::Ta > & arg ) const;
23 #define DEFAULTUNARYOPDECL FORALLCLASSESM( DEFAULTUNARYOPDECL_ )
25 /* ... and an implementation.
27 #define DEFAULTUNARYOPIMPL_( Ts, Ta ) RefCountPtr< const Lang::Value > Shapes::Ts::op( const RefCountPtr< const Shapes::Ta > & arg ) const { return this->throwNotApplicable( arg.getPtr( ) ); }
28 #define DEFAULTUNARYOPIMPL( Ts ) FORALLCLASSESMT( DEFAULTUNARYOPIMPL_, Ts )
30 /* Define a macro for calling the implementation of an unary operator.
33 #define UNARYCALLIMPL( T )
37 /* Use the two looping macros above in a nested manner to produce a default method declaration
38 * for each pair combination of classes.
40 #define DEFAULTBINARYOPDECL__( Ta, Tb ) virtual RefCountPtr< const Lang::Value > op( const RefCountPtr< const Shapes::Ta > & arg1, const RefCountPtr< const Shapes::Tb > & arg2 ) const;
41 #define DEFAULTBINARYOPDECL_( Ta ) FORALLCLASSESMT( DEFAULTBINARYOPDECL__, Ta )
42 #define DEFAULTBINARYOPDECL FORALLCLASSESM( DEFAULTBINARYOPDECL_ )
44 /* ... and an implementation.
46 #define DEFAULTBINARYOPIMPL__( Ta, Tb ) RefCountPtr< const Lang::Value > Ast::BinaryInfixExpr::op( const RefCountPtr< const Shapes::Ta > & arg1, const RefCountPtr< const Shapes::Tb > & arg2 ) const { return throwNotApplicable( arg1.getPtr( ), arg2.getPtr( ) ); }
47 #define DEFAULTBINARYOPIMPL_( Ta ) FORALLCLASSESMT( DEFAULTBINARYOPIMPL__, Ta )
48 #define DEFAULTBINARYOPIMPL FORALLCLASSESM( DEFAULTBINARYOPIMPL_ )
50 /* Define a macro for calling the implementation of a binary operator.
52 #define CALLIMPL( Sa, Sb )