-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathExpressionVector.h
More file actions
44 lines (36 loc) · 1.28 KB
/
ExpressionVector.h
File metadata and controls
44 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef Rcpp__vector__impl_ExpressionVector_h
#define Rcpp__vector__impl_ExpressionVector_h
namespace Rcpp{
#undef VEC
#define VEC Vector<EXPRSXP,Storage>
template <typename Storage>
class Vector<EXPRSXP,Storage> :
public VectorOfRTYPE<EXPRSXP>,
public SugarVectorExpression<SEXP, VEC>
{
public:
typedef SEXP value_type ;
typedef internal::generic_proxy<Vector> Proxy ;
typedef internal::Proxy_Iterator<Proxy> iterator ;
typedef internal::Proxy_Iterator<Proxy> const_iterator ;
#define RTYPE EXPRSXP
#include <Rcpp/vector/impl/RCPP_VECTOR_API.h>
#undef RTYPE
public:
Vector( const char* st){init_from_string(st); }
Vector( const std::string& st) { init_from_string(st.c_str()); }
#include <Rcpp/vector/impl/RCPP_VECTOR_PROXY_BASED_API.h>
private:
inline void init_from_string( const char* st ){
ParseStatus status;
Shield<SEXP> expr = Rf_mkString( st );
Shield<SEXP> res = R_ParseVector(expr, -1, &status, R_NilValue);
if( status != PARSE_OK ){
stop("parse error") ;
}
set_data(res) ;
}
} ;
#undef VEC
}
#endif