8#ifndef RDEFINITIONS_H_INCLUDED
9#define RDEFINITIONS_H_INCLUDED
21#define RCPP_DEFINEVECTOR(CLASS) namespace Rcpp{\
22template <> std::vector<CLASS> as(SEXP obj){\
23const int RTYPE = traits::r_sexptype_traits<CLASS>::rtype;\
24Vector<RTYPE> rcppvec(obj);\
25std::vector<CLASS>newvec;\
26newvec.reserve(rcppvec.size());\
27for(int index = 0; index < rcppvec.size();++index)\
29newvec.push_back(rcppvec[index]);\
32template <> SEXP wrap(const std::vector<CLASS>& obj){\
33const int RTYPE=traits::r_sexptype_traits<CLASS>::rtype;\
34return Vector<RTYPE>(obj.begin(), obj.end());}}
36#define RCPP_DEFINELIST(CLASS) namespace Rcpp{\
37template <> std::vector<CLASS> as(SEXP obj){\
39std::vector<CLASS>newvec;\
40newvec.reserve(listobj.size());\
41for(int index = 0; index < listobj.size();++index)\
43newvec.push_back(as<CLASS>(listobj[index]));\
46template <> SEXP wrap(const std::vector<CLASS>& obj){\
47List listobj(obj.size());\
48for(int index = 0; index < listobj.size();++index)\
50listobj[index]=wrap<CLASS>(obj.at(index));\
54#define RCPP_DEFINEPAIR(FIRST,SECOND)namespace Rcpp{\
55template <> std::pair<FIRST,SECOND> as(SEXP obj){\
56Rcpp::List rcpplist(obj);\
57return std::pair<FIRST,SECOND>(as<FIRST>(rcpplist["first"]), as<SECOND>(rcpplist["second"]));}\
58template <> SEXP wrap(const std::pair<FIRST,SECOND>& obj){\
59return List::create(Named("first") = wrap<FIRST>(obj.first),Named("second") = wrap<SECOND>(obj.second));}}
61#define RCPP_DEFINEMAP(KEY,OBJECT)namespace Rcpp{\
62template <> std::map<KEY,OBJECT> as(SEXP obj){\
64std::map<KEY,OBJECT>newmap;\
65for(int index = 0; index < rcpplist.size();++index)\
67newmap[as<KEY>(as<List>(rcpplist[index])["first"])]=as<OBJECT>(as<List>(rcpplist[index])["second"]);\
70template <> SEXP wrap(const std::map<KEY,OBJECT>& obj){\
71List rcpplist(obj.size());\
73for(const auto& mapobject: obj)\
75rcpplist[index]=List::create(Named("first")=wrap<KEY>(mapobject.first),Named("second")=wrap<OBJECT>(mapobject.second));\
85 Rcpp::class_< Core::FMTlist<T> >(name,
"@DocString(FMTlist)")
86 .constructor(
"@DocString(FMTlist())")
88 "@DocString(FMTlist::update)")
91 "@DocString(FMTyieldhandler::APIpush_back)");
98 Rcpp::class_<Spatial::FMTlayer<T>>(name,
"@DocString(FMTlayer)")
99 .constructor(
"@DocString(FMTlayer())")
101 "@DocString(FMTlayer::GetXSize)")
103 "@DocString(FMTlayer::GetYSize)")
105 "@DocString(FMTlayer::getgeotransform)")
107 "@DocString(FMTlayer::getprojection)")
109 "@DocString(FMTlayer::getmapping)")
111 "@DocString(FMTlayer::area)")
113 "@DocString(FMTlayer::getcellsize)")
115 "@DocString(FMTlayer::size)");
Definition: FMTlist.hpp:46
Definition: FMTlayer.hpp:29
void define_FMTlist()
Definition: PYdefinitions.hpp:24
void define_FMTlayer()
Definition: PYdefinitions.hpp:39
Definition: RexportCore.hpp:153