2 /// Conversion functions to convert Nasal types to C++ 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_FROM_NASAL_HXX_
21 #define SG_FROM_NASAL_HXX_
23 #include "from_nasal_detail.hxx"
29 * Convert a Nasal type to any supported C++ type.
31 * @param c Active Nasal context
32 * @param ref Nasal object to be converted
33 * @tparam T Target type of conversion
35 * @throws bad_nasal_cast if conversion is not possible
37 * @note Every type which should be supported needs a function with the
38 * following signature declared:
40 * Type from_nasal(naContext, naRef, Type*)
43 T from_nasal(naContext c, naRef ref)
45 return from_nasal(c, ref, static_cast<T*>(0));
50 #endif /* SG_FROM_NASAL_HXX_ */