57 #include <boost/serialization/access.hpp>
58 #include <boost/serialization/base_object.hpp>
59 #include <boost/serialization/nvp.hpp>
103 :
public std::iterator<std::forward_iterator_tag, ConsCell> {
145 :
public std::iterator<std::forward_iterator_tag, const ConsCell> {
186 return iterator(
this);
189 const_iterator begin()
const
191 return const_iterator(
this);
222 if (T* ccc = dynamic_cast<T*>(cc))
224 T* ans =
new T(cc->
car(), cc->
tail(), cc->
tag());
234 const_iterator end()
const
236 return const_iterator();
273 return "(pairlist type)";
349 friend class boost::serialization::access;
363 template<
class Archive>
364 void serialize(Archive & ar,
const unsigned int version);
367 template<
class Archive>
368 void CXXR::ConsCell::serialize(Archive & ar,
const unsigned int version) {
369 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(RObject);
375 inline bool operator==(ConsCell::iterator l, ConsCell::iterator r)
377 return &(*l) == &(*r);
380 inline bool operator!=(ConsCell::iterator l, ConsCell::iterator r)
385 inline bool operator==(ConsCell::const_iterator l,
386 ConsCell::const_iterator r)
388 return &(*l) == &(*r);
391 inline bool operator!=(ConsCell::const_iterator l,
392 ConsCell::const_iterator r)
411 return cc ? cc->
car() : 0;
418 void ccdump(std::ostream& os,
const ConsCell& cc,
size_t margin = 0);
430 return (start ? std::distance(start->begin(), start->end()) : 0);
447 return cc ? cc->
tail() : 0;
521 static PairList*
make(
size_t sz)
throw (std::bad_alloc);
538 friend class boost::serialization::access;
559 template<
class Archive>
560 void serialize(Archive & ar,
const unsigned int version) {
561 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
ConsCell);
565 inline void ConsCell::iterator::advance()
570 inline void ConsCell::const_iterator::advance()
577 :
RObject(st), m_car(cr), m_tail(tl), m_tag(tg)
583 :
RObject(pattern), m_car(pattern.m_car),
584 m_tail(clone(pattern.tail())), m_tag(pattern.tag())
588 :
RObject(pattern), m_car(pattern.m_car), m_tail(0),
623 using namespace CXXR;
624 return car0(SEXP_downcast<ConsCell*>(e));
639 inline int MISSING(
SEXP x)
641 using namespace CXXR;
642 return SEXP_downcast<ConsCell*>(x)->m_missing;
657 inline void SET_MISSING(
SEXP x,
int v)
659 using namespace CXXR;
660 SEXP_downcast<ConsCell*>(x)->m_missing = v;
675 using namespace CXXR;
677 ConsCell& cc = *SEXP_downcast<ConsCell*>(e);
678 return const_cast<RObject*
>(cc.tag());