Rcpp Version 1.0.7
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 
26 namespace Rcpp{
27 namespace traits{
28 
34 
40 
45 
51 
56 
61 
66 struct r_type_pair_tag{} ;
67 
72 
77 
83 
88 
93 
97 struct r_type_enum_tag{} ;
98 
100 
104 template <typename T> struct r_type_traits { typedef r_type_generic_tag r_category ; } ;
105 
109 template <typename T> struct r_type_traits< Rcpp::object<T> >{ typedef r_type_module_object_pointer_tag r_category ; } ;
110 
111 
112 template <typename KEY, typename VALUE>
113 struct r_type_traits< std::pair<const KEY,VALUE> > {
115 } ;
116 
120 template <typename T> struct r_type_traits< std::pair<const std::string,T> > { typedef r_type_pairstring_generic_tag r_category ; } ;
121 template<> struct r_type_traits< std::pair<const std::string,int> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
122 template<> struct r_type_traits< std::pair<const std::string,const int> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
123 template<> struct r_type_traits< std::pair<const std::string,double> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
124 template<> struct r_type_traits< std::pair<const std::string,Rbyte> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
125 template<> struct r_type_traits< std::pair<const std::string,Rcomplex> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
126 template<> struct r_type_traits< std::pair<const std::string,bool> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
127 template<> struct r_type_traits< std::pair<const std::string,std::string> >{ typedef r_type_pairstring_string_tag r_category ; } ;
128 template<> struct r_type_traits< std::pair<const std::string,std::wstring> >{ typedef r_type_pairstring_string_tag r_category ; } ;
129 template<> struct r_type_traits< std::pair<const std::string,char> >{ typedef r_type_pairstring_string_tag r_category ; } ;
130 template<> struct r_type_traits< std::pair<const std::string,wchar_t> >{ typedef r_type_pairstring_string_tag r_category ; } ;
131 
132 template<> struct r_type_traits< std::pair<const std::string,unsigned int> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
133 template<> struct r_type_traits< std::pair<const std::string,float> >{ typedef r_type_pairstring_primitive_tag r_category ; } ;
134 
135 template<> struct r_type_traits<int>{ typedef r_type_primitive_tag r_category ; } ;
136 template<> struct r_type_traits<const int>{ typedef r_type_primitive_tag r_category ; } ;
137 template<> struct r_type_traits<double>{ typedef r_type_primitive_tag r_category ; } ;
138 template<> struct r_type_traits<const double>{ typedef r_type_primitive_tag r_category ; } ;
139 template<> struct r_type_traits<Rbyte>{ typedef r_type_primitive_tag r_category ; } ;
140 template<> struct r_type_traits<Rcomplex>{ typedef r_type_primitive_tag r_category ; } ;
141 template<> struct r_type_traits<bool>{ typedef r_type_primitive_tag r_category ; } ;
142 template<> struct r_type_traits<std::string>{ typedef r_type_string_tag r_category ; } ;
143 template<> struct r_type_traits<std::wstring>{ typedef r_type_string_tag r_category ; } ;
144 template<> struct r_type_traits<char>{ typedef r_type_string_tag r_category ; } ;
145 template<> struct r_type_traits<wchar_t>{ typedef r_type_string_tag r_category ; } ;
146 
147 template<> struct r_type_traits<unsigned int>{ typedef r_type_primitive_tag r_category ; } ;
148 template<> struct r_type_traits<float>{ typedef r_type_primitive_tag r_category ; } ;
149 template<> struct r_type_traits<const char*>{ typedef r_type_string_tag r_category ; } ;
150 template<> struct r_type_traits<const wchar_t*>{ typedef r_type_string_tag r_category ; } ;
151 
152 /* long */
153 template<> struct r_type_traits<long>{ typedef r_type_primitive_tag r_category ; } ;
154 template<> struct r_type_traits< std::pair<const std::string,long> >{ typedef r_type_primitive_tag r_category ; } ;
155 
156 /* unsigned long */
157 template<> struct r_type_traits<unsigned long>{ typedef r_type_primitive_tag r_category ; } ;
158 template<> struct r_type_traits< std::pair<const std::string,unsigned long> >{ typedef r_type_primitive_tag r_category ; } ;
159 
160 /* long double */
161 template<> struct r_type_traits<long double>{ typedef r_type_primitive_tag r_category ; } ;
162 template<> struct r_type_traits< std::pair<const std::string,long double> >{ typedef r_type_primitive_tag r_category ; } ;
163 
164 /* short */
165 template<> struct r_type_traits<short>{ typedef r_type_primitive_tag r_category ; } ;
166 template<> struct r_type_traits< std::pair<const std::string,short> >{ typedef r_type_primitive_tag r_category ; } ;
167 
168 /* unsigned short */
169 template<> struct r_type_traits<unsigned short>{ typedef r_type_primitive_tag r_category ; } ;
170 template<> struct r_type_traits< std::pair<const std::string,unsigned short> >{ typedef r_type_primitive_tag r_category ; } ;
171 
172 /* std::complex<double> */
173 template<> struct r_type_traits< std::complex<double> >{ typedef r_type_primitive_tag r_category ; } ;
174 template<> struct r_type_traits< std::pair<const std::string,std::complex<double> > >{ typedef r_type_primitive_tag r_category ; } ;
175 
176 /* std::complex<float> */
177 template<> struct r_type_traits< std::complex<float> >{ typedef r_type_primitive_tag r_category ; } ;
178 template<> 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::traits::r_type_traits< char >::r_category
r_type_string_tag r_category
Definition: r_type_traits.h:144
Rcpp::traits::r_type_traits< std::pair< const std::string, long double > >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:162
Rcpp::traits::r_type_traits< std::pair< const std::string, unsigned short > >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:170
Rcpp::traits::r_type_traits< std::pair< const std::string, std::complex< float > > >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:178
Rcpp::traits::r_type_pair_tag
Definition: r_type_traits.h:66
Rcpp::traits::r_type_traits< unsigned long >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:157
Rcpp::traits::r_type_traits< std::pair< const std::string, float > >::r_category
r_type_pairstring_primitive_tag r_category
Definition: r_type_traits.h:133
Rcpp::traits::r_type_traits< std::wstring >::r_category
r_type_string_tag r_category
Definition: r_type_traits.h:143
Rcpp::traits::r_type_traits< long >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:153
Rcpp::traits::r_type_pairstring_generic_tag
Definition: r_type_traits.h:60
Rcpp::traits::r_type_traits< std::pair< const std::string, char > >::r_category
r_type_pairstring_string_tag r_category
Definition: r_type_traits.h:129
Rcpp::traits::r_type_module_object_reference_tag
Definition: r_type_traits.h:87
Rcpp::traits::r_type_primitive_tag
Definition: r_type_traits.h:33
Rcpp::traits::r_type_traits< std::pair< const std::string, bool > >::r_category
r_type_pairstring_primitive_tag r_category
Definition: r_type_traits.h:126
Rcpp::traits::r_type_traits< wchar_t >::r_category
r_type_string_tag r_category
Definition: r_type_traits.h:145
Rcpp::traits::r_type_traits< const char * >::r_category
r_type_string_tag r_category
Definition: r_type_traits.h:149
Rcpp::traits::r_type_pairstring_primitive_tag
Definition: r_type_traits.h:50
Rcpp::traits::r_type_traits< std::pair< const std::string, unsigned long > >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:158
Rcpp::traits::r_type_traits< std::pair< const std::string, wchar_t > >::r_category
r_type_pairstring_string_tag r_category
Definition: r_type_traits.h:130
Rcpp::traits::r_type_traits< std::pair< const std::string, double > >::r_category
r_type_pairstring_primitive_tag r_category
Definition: r_type_traits.h:123
Rcpp::traits::r_type_traits< std::pair< const std::string, short > >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:166
Rcpp::traits::r_type_RcppString_tag
Definition: r_type_traits.h:99
Rcpp::traits::r_type_traits< const double >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:138
Rcpp::traits::r_type_traits< std::pair< const std::string, unsigned int > >::r_category
r_type_pairstring_primitive_tag r_category
Definition: r_type_traits.h:132
Rcpp::traits::r_type_traits< std::pair< const std::string, std::string > >::r_category
r_type_pairstring_string_tag r_category
Definition: r_type_traits.h:127
Rcpp
Rcpp API.
Definition: algo.h:28
Rcpp::traits::r_type_module_object_const_pointer_tag
Definition: r_type_traits.h:76
Rcpp::traits::r_type_enum_tag
Definition: r_type_traits.h:97
Rcpp::object
Definition: Module.h:65
Rcpp::traits::r_type_module_object_tag
Definition: r_type_traits.h:82
Rcpp::traits::r_type_traits< bool >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:141
Rcpp::traits::r_type_traits< std::pair< const std::string, T > >::r_category
r_type_pairstring_generic_tag r_category
Definition: r_type_traits.h:120
Rcpp::traits::r_type_traits< std::pair< const std::string, Rbyte > >::r_category
r_type_pairstring_primitive_tag r_category
Definition: r_type_traits.h:124
Rcpp::traits::r_type_traits< std::string >::r_category
r_type_string_tag r_category
Definition: r_type_traits.h:142
Rcpp::traits::r_type_traits
Definition: r_type_traits.h:104
Rcpp::traits::r_type_traits< float >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:148
Rcpp::traits::r_type_traits< Rcomplex >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:140
Rcpp::traits::r_type_traits::r_category
r_type_generic_tag r_category
Definition: r_type_traits.h:104
Rcpp::traits::r_type_pairstring_string_tag
Definition: r_type_traits.h:55
Rcpp::traits::r_type_module_object_const_reference_tag
Definition: r_type_traits.h:92
Rcpp::traits::r_type_traits< unsigned short >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:169
Rcpp::traits::r_type_generic_tag
Definition: r_type_traits.h:44
Rcpp::traits::r_type_traits< std::complex< double > >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:173
Rcpp::traits::r_type_traits< std::complex< float > >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:177
Rcpp::traits::r_type_traits< std::pair< const std::string, Rcomplex > >::r_category
r_type_pairstring_primitive_tag r_category
Definition: r_type_traits.h:125
std
Definition: swap.h:25
Rcpp::traits::r_type_traits< std::pair< const std::string, std::complex< double > > >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:174
Rcpp::traits::r_type_traits< long double >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:161
Rcpp::traits::r_type_traits< unsigned int >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:147
Rcpp::traits::r_type_traits< const wchar_t * >::r_category
r_type_string_tag r_category
Definition: r_type_traits.h:150
Rcpp::traits::r_type_traits< std::pair< const std::string, long > >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:154
Rcpp::traits::r_type_traits< std::pair< const std::string, const int > >::r_category
r_type_pairstring_primitive_tag r_category
Definition: r_type_traits.h:122
Rcpp::traits::r_type_string_tag
Definition: r_type_traits.h:39
Rcpp::traits::r_type_traits< int >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:135
Rcpp::traits::r_type_traits< Rbyte >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:139
Rcpp::traits::r_type_module_object_pointer_tag
Definition: r_type_traits.h:71
Rcpp::traits::r_type_traits< double >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:137
Rcpp::traits::r_type_traits< Rcpp::object< T > >::r_category
r_type_module_object_pointer_tag r_category
Definition: r_type_traits.h:109
Rcpp::traits::r_type_traits< const int >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:136
Rcpp::traits::r_type_traits< std::pair< const KEY, VALUE > >::r_category
r_type_pair_tag r_category
Definition: r_type_traits.h:114
Rcpp::traits::r_type_traits< std::pair< const std::string, std::wstring > >::r_category
r_type_pairstring_string_tag r_category
Definition: r_type_traits.h:128
Rcpp::traits::r_type_traits< short >::r_category
r_type_primitive_tag r_category
Definition: r_type_traits.h:165
Rcpp::traits::r_type_traits< std::pair< const std::string, int > >::r_category
r_type_pairstring_primitive_tag r_category
Definition: r_type_traits.h:121