48 #include <boost/serialization/access.hpp>
49 #include <boost/serialization/base_object.hpp>
50 #include <boost/serialization/nvp.hpp>
51 #include <boost/serialization/split_member.hpp>
91 m_matcher(pattern.m_matcher), m_body(pattern.m_body),
92 m_environment(pattern.m_environment)
120 return m_environment;
169 const Frame* method_bindings = 0)
const;
198 m_environment = new_env;
239 friend class boost::serialization::access;
265 DebugScope(
const Closure* closure)
268 if (m_closure->debugging())
274 if (m_closure->debugging())
280 void startDebugging()
const;
281 void endDebugging()
const;
285 GCEdge<const ArgMatcher> m_matcher;
287 GCEdge<Environment> m_environment;
297 template<
class Archive>
298 void load(Archive & ar,
const unsigned int version);
300 template<
class Archive>
301 void save(Archive & ar,
const unsigned int version)
const;
303 template<
class Archive>
304 void serialize(Archive & ar,
const unsigned int version) {
305 boost::serialization::split_member(ar, *
this, version);
314 template<class Archive>
315 void CXXR::Closure::load(Archive& ar, const
unsigned int version)
317 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(RObject);
318 GCStackRoot<const PairList> formal_args;
320 m_matcher=expose(
new ArgMatcher(formal_args));
325 template<
class Archive>
326 void CXXR::Closure::save(Archive& ar,
const unsigned int version)
const
328 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
RObject);
329 GCStackRoot<const PairList> formal_args(m_matcher->
formalArgs());
338 namespace serialization {
356 template<
class Archive>
358 const unsigned int version)
396 using namespace CXXR;
397 const Closure& clo = *SEXP_downcast<Closure*>(x);
398 return const_cast<RObject*
>(clo.body());
413 using namespace CXXR;
414 Closure& clo = *SEXP_downcast<Closure*>(x);
430 using namespace CXXR;
431 const Closure* clos = SEXP_downcast<Closure*>(x);
432 return const_cast<PairList*
>(clos->matcher()->formalArgs());
452 using namespace CXXR;
453 const Closure& clos = *SEXP_downcast<const Closure*>(x);
454 return Rboolean(clos.debugging());
461 inline int RSTEP(
SEXP x)
480 using namespace CXXR;
481 Closure& clos = *SEXP_downcast<Closure*>(x);
483 clos.setEnvironment(env);
503 using namespace CXXR;
504 Closure& clos = *SEXP_downcast<Closure*>(x);
510 void SET_RSTEP(
SEXP x,
int v);
512 inline void SET_RSTEP(
SEXP x,
int v)