Updating the changelog in the VERSION file, and version_sync.
[shapes.git] / source / operatorside.h
blobddb9e536a91d84cbd0c8f1eead0091ffd495f57c
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 Lang::Ta > & arg, const Kernel::PassedDyn & dyn ) const;
23 #define DEFAULTUNARYOPDECL FORALLCLASSESM( DEFAULTUNARYOPDECL_ )
25 /* ... and an implementation.
27 #define DEFAULTUNARYOPIMPL_( Ts, Ta ) RefCountPtr< const Lang::Value > Ast::Ts::op( const RefCountPtr< const Lang::Ta > & arg, const Kernel::PassedDyn & dyn ) 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.
32 #define UNARYCALLIMPL_( T ) virtual RefCountPtr< const Lang::Value > op( const RefCountPtr< const Lang::T > & arg, const Kernel::PassedDyn & dyn ) const { return impl( arg.getPtr( ), arg, dyn ); }
33 #define UNARYCALLIMPL( T ) SINGLELOOP1( T, UNARYCALLIMPL_ )
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 Lang::Ta > & arg1, const RefCountPtr< const Lang::Tb > & arg2, const Kernel::PassedDyn & dyn ) 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 Lang::Ta > & arg1, const RefCountPtr< const Lang::Tb > & arg2, const Kernel::PassedDyn & dyn ) const { return throwNotApplicable( arg1.getPtr( ), arg2.getPtr( ) ); }
47 #define DEFAULTBINARYOPIMPL_( Ta ) FORALLCLASSESMT( DEFAULTBINARYOPIMPL__, Ta )
48 #define DEFAULTBINARYOPIMPL FORALLCLASSESM( DEFAULTBINARYOPIMPL_ )
50 #define DUMMYANDREF( T ) T *, const RefCountPtr< T > &
51 /* Define a macro for calling the implementation of a binary operator.
53 #define CALLIMPL_( Ta, Tb ) virtual RefCountPtr< const Lang::Value > op( const RefCountPtr< const Lang::Ta > & arg1, const RefCountPtr< const Lang::Tb > & arg2, const Kernel::PassedDyn & dyn ) const { return impl( arg1.getPtr( ), arg1, arg2.getPtr( ), arg2, dyn ); }
54 #define CALLIMPL( Sa, Sb ) DOUBLELOOP2( Sa, Sb, CALLIMPL_ )