#include "data_output.hpp" #include "attribute_template_impl.hpp" #include "group_template_impl.hpp" #include "context.hpp" namespace xios { /// ////////////////////// Définitions ////////////////////// /// CDataOutput::~CDataOutput(void) { /* Ne rien faire de plus */ } //---------------------------------------------------------------- void CDataOutput::writeGrid (const boost::shared_ptr grid) { if (grid->domain_ref.isEmpty()) ERROR("CDataOutput::writeGrid(grid)", << " domain is not defined !"); if (grid->axis_ref.isEmpty()) { this->writeGrid (CObjectFactory::GetObject(grid->domain_ref.getValue())); } else { this->writeGrid (CObjectFactory::GetObject(grid->domain_ref.getValue()), CObjectFactory::GetObject(grid->axis_ref.getValue())); } } //---------------------------------------------------------------- void CDataOutput::writeFile (const boost::shared_ptr file) { this->writeFile_(file); } void CDataOutput::syncFile(void) { this->syncFile_(); } void CDataOutput::closeFile(void) { this->closeFile_(); } //---------------------------------------------------------------- void CDataOutput::writeGrid (const boost::shared_ptr domain, const boost::shared_ptr axis) { this->writeDomain_(domain); this->writeAxis_(axis); } //---------------------------------------------------------------- void CDataOutput::writeGrid (const boost::shared_ptr domain) { this->writeDomain_(domain); } //---------------------------------------------------------------- void CDataOutput::writeField (const boost::shared_ptr field) { boost::shared_ptr context = CObjectFactory::GetObject(CObjectFactory::GetCurrentContextId()); boost::shared_ptr calendar = context->getCalendar(); this->writeField_(field); this->writeTimeAxis_(field, calendar); } //---------------------------------------------------------------- void CDataOutput::writeFieldGrid (const boost::shared_ptr field) { this->writeGrid(field->getRelGrid()); } //---------------------------------------------------------------- void CDataOutput::writeFieldData(const boost::shared_ptr field) { boost::shared_ptr grid = CObjectFactory::GetObject(field->grid_ref.getValue()); boost::shared_ptr domain = CObjectFactory::GetObject(grid->domain_ref.getValue()); // if (domain->isEmpty()) return; this->writeFieldData_(field); } ///---------------------------------------------------------------- } // namespace xios