void TemplateRenderer::render_composite(CompositeElement const * tmplt) { for (auto child : tmplt->children()) { auto child_element = dynamic_cast<Element const *>(child); if (child_element != nullptr) { render_empty(child_element); } else { _os << child->str() << std::endl; } } }
void plot::render_from_snapshot() { auto xdd = reinterpret_cast<ide_device*>(_device_desc->deviceSpecific); xdd->output_and_kill_file_device(); try { rhost::util::errors_to_exceptions([&] { auto snapshot = Rf_findVar(Rf_install(_snapshot_varname.c_str()), R_GlobalEnv); if (snapshot != R_UnboundValue && snapshot != R_NilValue) { Rf_protect(snapshot); pGEDevDesc ge_dev_desc = Rf_desc2GEDesc(_device_desc); GEplaySnapshot(snapshot, ge_dev_desc); Rf_unprotect(1); } else { Rf_error("Plot snapshot is missing. Plot history may be corrupted. You should restart your session."); } }); } catch (rhost::util::r_error&) { render_empty(); } }