Rcpp Version 1.0.14
Loading...
Searching...
No Matches
Module.h
Go to the documentation of this file.
1
// Module.h: Rcpp R/C++ interface class library -- Rcpp modules
2
//
3
// Copyright (C) 2013 Romain Francois
4
//
5
// This file is part of Rcpp.
6
//
7
// Rcpp is free software: you can redistribute it and/or modify it
8
// under the terms of the GNU General Public License as published by
9
// the Free Software Foundation, either version 2 of the License, or
10
// (at your option) any later version.
11
//
12
// Rcpp is distributed in the hope that it will be useful, but
13
// WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
16
//
17
// You should have received a copy of the GNU General Public License
18
// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
19
20
#ifndef Rcpp_api_meat_Module_h
21
#define Rcpp_api_meat_Module_h
22
23
namespace
Rcpp
{
24
25
inline
List
Module::classes_info
(){
26
size_t
n =
classes
.
size
() ;
27
CharacterVector
names(n) ;
28
List
info
(n);
29
CLASS_MAP::iterator
it
=
classes
.begin() ;
30
std::string buffer ;
31
for
(
size_t
i=0; i<n; i++, ++
it
){
32
names[i] =
it
->first ;
33
info
[i] =
CppClass
(
this
,
it
->second, buffer ) ;
34
}
35
info
.names() = names ;
36
return
info
;
37
}
38
39
inline
CppClass
Module::get_class
(
const
std::string&
cl
){
40
BEGIN_RCPP
41
CLASS_MAP::iterator
it
=
classes
.find(
cl
) ;
42
if
(
it
==
classes
.end() )
throw
std::range_error(
"no such class"
) ;
43
std::string buffer ;
44
return
CppClass
(
this
,
it
->second, buffer ) ;
45
END_RCPP
46
}
47
48
}
49
50
#endif
Rcpp::CppClass
Definition
Module.h:586
Rcpp::Module::classes
CLASS_MAP classes
Definition
Module.h:235
Rcpp::Module::get_class
CppClass get_class(const std::string &cl)
Definition
Module.h:39
Rcpp::Module::classes_info
List classes_info()
Definition
Module.h:25
Rcpp::Vector< VECSXP >
Rcpp::Vector::size
R_xlen_t size() const
Definition
Vector.h:275
END_RCPP
#define END_RCPP
Definition
macros.h:99
BEGIN_RCPP
#define BEGIN_RCPP
Definition
macros.h:49
Rcpp
Rcpp API.
Definition
algo.h:28
Rcpp::as
T as(SEXP x)
Definition
as.h:151
inst
include
Rcpp
api
meat
module
Module.h
Generated on Sun Jan 12 2025 11:21:42 for Rcpp Version 1.0.14 by
1.9.8