[3428] | 1 | #include "data_output.hpp" |
---|
| 2 | |
---|
| 3 | #include "attribute_template.hpp" |
---|
| 4 | #include "group_template.hpp" |
---|
| 5 | #include "context.hpp" |
---|
| 6 | |
---|
| 7 | namespace xios |
---|
| 8 | { |
---|
| 9 | /// ////////////////////// Définitions ////////////////////// /// |
---|
| 10 | |
---|
| 11 | CDataOutput::~CDataOutput(void) |
---|
| 12 | { /* Ne rien faire de plus */ } |
---|
| 13 | |
---|
| 14 | //---------------------------------------------------------------- |
---|
| 15 | |
---|
| 16 | void CDataOutput::writeGrid(CGrid* grid) |
---|
| 17 | { |
---|
| 18 | if (grid->domain_ref.isEmpty()) |
---|
| 19 | ERROR("CDataOutput::writeGrid(grid)", |
---|
| 20 | << " domain is not defined !"); |
---|
| 21 | |
---|
| 22 | if (grid->axis_ref.isEmpty()) |
---|
| 23 | { |
---|
| 24 | this->writeGrid(CDomain::get(grid->domain_ref.getValue())); |
---|
| 25 | } |
---|
| 26 | else |
---|
| 27 | { |
---|
| 28 | this->writeGrid(CDomain::get(grid->domain_ref.getValue()), |
---|
| 29 | CAxis::get(grid->axis_ref.getValue())); |
---|
| 30 | } |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | //---------------------------------------------------------------- |
---|
| 34 | |
---|
| 35 | void CDataOutput::writeFile(CFile* file) |
---|
| 36 | { |
---|
| 37 | this->writeFile_(file); |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | void CDataOutput::syncFile(void) |
---|
| 41 | { |
---|
| 42 | this->syncFile_(); |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | void CDataOutput::closeFile(void) |
---|
| 46 | { |
---|
| 47 | this->closeFile_(); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | //---------------------------------------------------------------- |
---|
| 51 | |
---|
| 52 | void CDataOutput::writeGrid(CDomain* domain,CAxis* axis) |
---|
| 53 | { |
---|
| 54 | this->writeDomain_(domain); |
---|
| 55 | this->writeAxis_(axis); |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | //---------------------------------------------------------------- |
---|
| 59 | |
---|
| 60 | void CDataOutput::writeGrid(CDomain* domain) |
---|
| 61 | { |
---|
| 62 | this->writeDomain_(domain); |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | //---------------------------------------------------------------- |
---|
| 66 | |
---|
| 67 | void CDataOutput::writeField(CField* field) |
---|
| 68 | { |
---|
| 69 | CContext* context = CContext::getCurrent() ; |
---|
| 70 | boost::shared_ptr<CCalendar> calendar = context->getCalendar(); |
---|
| 71 | |
---|
| 72 | this->writeField_(field); |
---|
| 73 | this->writeTimeAxis_(field, calendar); |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | //---------------------------------------------------------------- |
---|
| 77 | |
---|
| 78 | void CDataOutput::writeFieldGrid(CField* field) |
---|
| 79 | { |
---|
| 80 | this->writeGrid(field->getRelGrid()); |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | //---------------------------------------------------------------- |
---|
| 84 | |
---|
| 85 | void CDataOutput::writeFieldData(CField* field) |
---|
| 86 | { |
---|
| 87 | CGrid* grid = CGrid::get(field->grid_ref.getValue()); |
---|
| 88 | CDomain* domain = CDomain::get(grid->domain_ref.getValue()); |
---|
| 89 | |
---|
| 90 | // if (domain->isEmpty()) return; |
---|
| 91 | this->writeFieldData_(field); |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | ///---------------------------------------------------------------- |
---|
| 95 | |
---|
| 96 | } // namespace xios |
---|