2 /// Type traits used for converting from and to Nasal types
4 // Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Library General Public
8 // License as published by the Free Software Foundation; either
9 // version 2 of the License, or (at your option) any later version.
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 // Library General Public License for more details.
16 // You should have received a copy of the GNU Library General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef SG_NASAL_TRAITS_HXX_
21 #define SG_NASAL_TRAITS_HXX_
23 #include <boost/type_traits/integral_constant.hpp>
28 struct is_vec2: public boost::integral_constant<bool, false> {};
30 #define SG_MAKE_TRAIT(templ,type,attr)\
33 public boost::integral_constant<bool, true> {};
36 SG_MAKE_TRAIT(<class T>, SGVec2<T>, is_vec2)
40 SG_MAKE_TRAIT(<>, osg::Vec2b, is_vec2)
44 SG_MAKE_TRAIT(<>, osg::Vec2d, is_vec2)
48 SG_MAKE_TRAIT(<>, osg::Vec2f, is_vec2)
52 SG_MAKE_TRAIT(<>, osg::Vec2s, is_vec2)
58 #endif /* SG_NASAL_TRAITS_HXX_ */