8#ifndef RDEFINITIONS_H_INCLUDED
9#define RDEFINITIONS_H_INCLUDED
17#include "FMTLayer.hpp"
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: FMTAreaParser.h:32
Definition: FMTParser.h:54
void define_FMTlist()
Definition: PYdefinitions.h:31
void define_FMTlayer()
Definition: PYdefinitions.h:46
Definition: RexportCore.h:153