Rcpp Version 1.0.9
DottedPairImpl.h
Go to the documentation of this file.
1 // Copyright (C) 2013 Romain Francois
2 //
3 // This file is part of Rcpp.
4 //
5 // Rcpp is free software: you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // Rcpp is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
17 
18 #ifndef Rcpp_DottedPairImpl_h
19 #define Rcpp_DottedPairImpl_h
20 
21 namespace Rcpp{
22 
23  template <typename CLASS>
25  public:
26 
35  template <typename T>
36  void push_back( const T& object) ;
37 
44  template <typename T>
45  void push_front( const T& object) ;
46 
54  template <typename T>
55  void insert( const size_t& index, const T& object) ;
56 
63  template <typename T>
64  void replace( const int& index, const T& object ) ;
65 
66  inline R_xlen_t length() const {
67  return ::Rf_xlength(static_cast<const CLASS&>(*this).get__()) ;
68  }
69 
70  inline R_xlen_t size() const {
71  return ::Rf_xlength(static_cast<const CLASS&>(*this).get__()) ;
72  }
73 
79  void remove( const size_t& index );
80 
81  template <typename T>
82  friend DottedPairImpl& operator<<(DottedPairImpl& os, const T& t){
83  os.push_back( t ) ;
84  return os ;
85  }
86 
87  template <typename T>
88  friend DottedPairImpl& operator>>( const T& t, DottedPairImpl& s){
89  s.push_front(t);
90  return s ;
91  }
92 
93  } ;
94 
95 }
96 
97 #endif
friend DottedPairImpl & operator>>(const T &t, DottedPairImpl &s)
void push_back(const T &object)
void replace(const int &index, const T &object)
void remove(const size_t &index)
R_xlen_t length() const
void insert(const size_t &index, const T &object)
friend DottedPairImpl & operator<<(DottedPairImpl &os, const T &t)
void push_front(const T &object)
R_xlen_t size() const
Rcpp API.
Definition: algo.h:28