Rcpp Version 1.0.14
Loading...
Searching...
No Matches
r_type_traits.h
Go to the documentation of this file.
1// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2/* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
3//
4// r_type_traits.h: Rcpp R/C++ interface class library -- traits to help wrap
5//
6// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois
7//
8// This file is part of Rcpp.
9//
10// Rcpp is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 2 of the License, or
13// (at your option) any later version.
14//
15// Rcpp is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
22
23#ifndef Rcpp__traits__r_type_traits__h
24#define Rcpp__traits__r_type_traits__h
25
26namespace Rcpp{
27namespace traits{
28
34
40
45
51
56
61
67
72
77
83
88
93
98
100
104template <typename T> struct r_type_traits { typedef r_type_generic_tag r_category ; } ;
105
109template <typename T> struct r_type_traits< Rcpp::object<T> >{ typedef r_type_module_object_pointer_tag r_category ; } ;
110
111
112template <typename KEY, typename VALUE>
113struct r_type_traits< std::pair<const KEY,VALUE> > {
115} ;
116
120template <typename T> struct r_type_traits< std::pair<const std::string,T> > { typedef r_type_pairstring_generic_tag r_category ; } ;
121template<> struct r_type_traits< std::pair<const std::string,int> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
122template<> struct r_type_traits< std::pair<const std::string,const int> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
123template<> struct r_type_traits< std::pair<const std::string,double> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
124template<> struct r_type_traits< std::pair<const std::string,Rbyte> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
125template<> struct r_type_traits< std::pair<const std::string,Rcomplex> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
126template<> struct r_type_traits< std::pair<const std::string,bool> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
127template<> struct r_type_traits< std::pair<const std::string,std::string> >{ typedef r_type_pairstring_string_tag r_category ; } ;
128template<> struct r_type_traits< std::pair<const std::string,std::wstring> >{ typedef r_type_pairstring_string_tag r_category ; } ;
129template<> struct r_type_traits< std::pair<const std::string,char> >{ typedef r_type_pairstring_string_tag r_category ; } ;
130template<> struct r_type_traits< std::pair<const std::string,wchar_t> >{ typedef r_type_pairstring_string_tag r_category ; } ;
131
132template<> struct r_type_traits< std::pair<const std::string,unsigned int> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
133template<> struct r_type_traits< std::pair<const std::string,float> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
134
135template<> struct r_type_traits<int>{ typedef r_type_primitive_tag r_category ; } ;
136template<> struct r_type_traits<const int>{ typedef r_type_primitive_tag r_category ; } ;
137template<> struct r_type_traits<double>{ typedef r_type_primitive_tag r_category ; } ;
139template<> struct r_type_traits<Rbyte>{ typedef r_type_primitive_tag r_category ; } ;
140template<> struct r_type_traits<Rcomplex>{ typedef r_type_primitive_tag r_category ; } ;
141template<> struct r_type_traits<bool>{ typedef r_type_primitive_tag r_category ; } ;
142template<> struct r_type_traits<std::string>{ typedef r_type_string_tag r_category ; } ;
143template<> struct r_type_traits<std::wstring>{ typedef r_type_string_tag r_category ; } ;
144template<> struct r_type_traits<char>{ typedef r_type_string_tag r_category ; } ;
145template<> struct r_type_traits<wchar_t>{ typedef r_type_string_tag r_category ; } ;
146
148template<> struct r_type_traits<float>{ typedef r_type_primitive_tag r_category ; } ;
149template<> struct r_type_traits<const char*>{ typedef r_type_string_tag r_category ; } ;
150template<> struct r_type_traits<const wchar_t*>{ typedef r_type_string_tag r_category ; } ;
151
152/* long */
153template<> struct r_type_traits<long>{ typedef r_type_primitive_tag r_category ; } ;
154template<> struct r_type_traits< std::pair<const std::string,long> >{ typedef r_type_primitive_tag r_category ; } ;
155
156/* unsigned long */
158template<> struct r_type_traits< std::pair<const std::string,unsigned long> >{ typedef r_type_primitive_tag r_category ; } ;
159
160/* long double */
161template<> struct r_type_traits<long double>{ typedef r_type_primitive_tag r_category ; } ;
162template<> struct r_type_traits< std::pair<const std::string,long double> >{ typedef r_type_primitive_tag r_category ; } ;
163
164/* short */
165template<> struct r_type_traits<short>{ typedef r_type_primitive_tag r_category ; } ;
166template<> struct r_type_traits< std::pair<const std::string,short> >{ typedef r_type_primitive_tag r_category ; } ;
167
168/* unsigned short */
170template<> struct r_type_traits< std::pair<const std::string,unsigned short> >{ typedef r_type_primitive_tag r_category ; } ;
171
172/* std::complex<double> */
173template<> struct r_type_traits< std::complex<double> >{ typedef r_type_primitive_tag r_category ; } ;
174template<> struct r_type_traits< std::pair<const std::string,std::complex<double> > >{ typedef r_type_primitive_tag r_category ; } ;
175
176/* std::complex<float> */
177template<> struct r_type_traits< std::complex<float> >{ typedef r_type_primitive_tag r_category ; } ;
178template<> struct r_type_traits< std::pair<const std::string,std::complex<float> > >{ typedef r_type_primitive_tag r_category ; } ;
179
180} // traits
181} // Rcpp
182
183#endif
Rcpp API.
Definition algo.h:28
T as(SEXP x)
Definition as.h:151
Definition swap.h:25
r_type_module_object_pointer_tag r_category
r_type_generic_tag r_category