50 #define R_LEN_T_MAX INT_MAX
54 #include <boost/serialization/access.hpp>
55 #include <boost/serialization/base_object.hpp>
56 #include <boost/serialization/nvp.hpp>
65 typename Initializer = RObject::DoNothing>
class FixedVector;
66 typedef FixedVector<int, INTSXP>
IntVector;
79 :
RObject(stype), m_truelength(sz), m_size(sz)
87 :
RObject(pattern), m_truelength(pattern.m_truelength),
88 m_size(pattern.m_size)
171 static V*
resize(
const V* pattern, std::size_t new_size);
191 std::size_t new_size);
276 virtual void setSize(std::size_t new_size);
293 return "(vector type)";
304 R_len_t m_truelength;
322 friend class boost::serialization::access;
328 template<
class Archive>
329 void serialize(Archive & ar,
const unsigned int version)
331 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
RObject);
332 ar & BOOST_SERIALIZATION_NVP(m_truelength);
340 std::size_t copysz = std::min(pattern->size(), new_size);
341 typename V::const_iterator patb = pattern->begin();
342 typename V::iterator ansit
343 = std::copy(patb, patb + copysz, ans->begin());
344 std::fill(ansit, ans->end(), NA<typename V::value_type>());
346 ans->setS4Object(pattern->isS4Object());
371 using namespace CXXR;
373 VectorBase& vb = *SEXP_downcast<VectorBase*>(x);
393 using namespace CXXR;
394 VectorBase& vb = *SEXP_downcast<VectorBase*>(x);
395 return vb.m_truelength;
426 using namespace CXXR;
427 VectorBase& vb = *SEXP_downcast<VectorBase*>(x);