Rcpp Version 0.12.12
StretchyList.h
Go to the documentation of this file.
1 // StretchyList.h: Rcpp R/C++ interface class library -- stretchy lists
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_StretchyList_h
21 #define Rcpp_StretchyList_h
22 
23 namespace Rcpp{
24 
35  public:
36 
38 
41 
43  SEXP s = Rf_cons(R_NilValue, R_NilValue);
44  SETCAR(s, s);
45  Storage::set__(s) ;
46  }
48  Storage::set__(r_cast<LISTSXP>(x)) ;
49  }
50 
51  void update(SEXP x){}
52 
53  inline operator SEXP() const{
54  return CDR(Storage::get__() );
55  }
56 
57  template <typename T>
58  inline StretchyList_Impl& push_back(const T& obj ){
59  return push_back__impl( obj, typename traits::is_named<T>::type() ) ;
60  }
61 
62  template <typename T>
63  inline StretchyList_Impl& push_front(const T& obj ){
64  return push_front__impl( obj, typename traits::is_named<T>::type() ) ;
65  }
66 
67  private:
68 
69  template <typename T>
71 
72  template <typename T>
74 
75  template <typename T>
77 
78  template <typename T>
80 
81  } ;
82 
83  typedef StretchyList_Impl<PreserveStorage> StretchyList ;
84 }
85 #endif
StretchyList_Impl< PreserveStorage > StretchyList
Definition: StretchyList.h:81
#define RCPP_GENERATE_CTOR_ASSIGN(__CLASS__)
Definition: interface.h:21
StretchyList_Impl()
Definition: StretchyList.h:42
StretchyList_Impl & push_front__impl(const T &obj, traits::true_type)
RCPP_API_CLASS(DottedPair_Impl)
StretchyList_Impl & push_front(const T &obj)
Definition: StretchyList.h:63
StretchyList_Impl & push_back(const T &obj)
Definition: StretchyList.h:58
StretchyList_Impl & push_back__impl(const T &obj, traits::true_type)
Rcpp API.
Definition: algo.h:28
DottedPairProxyPolicy< Language_Impl >::const_DottedPairProxy const_Proxy
Definition: Language.h:39
void update(SEXP)
Definition: Environment.h:400