source: XIOS/trunk/src/node/field_impl.hpp @ 1622

Last change on this file since 1622 was 1622, checked in by oabramkina, 5 years ago

Exception handling on trunk.

To activate it, compilation flag -DXIOS_EXCEPTION should be added.

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 1.6 KB
RevLine 
[352]1
2#ifndef __FIELD_IMPL_HPP__
3#define __FIELD_IMPL_HPP__
4
[591]5#include "xios_spl.hpp"
[352]6#include "field.hpp"
7#include "context.hpp"
8#include "grid.hpp"
9#include "timer.hpp"
[369]10#include "array_new.hpp"
[640]11#include "source_filter.hpp"
12#include "store_filter.hpp"
[352]13
[369]14
[352]15namespace xios {
16
[459]17  template <int N>
18  void CField::setData(const CArray<double, N>& _data)
[1622]19  TRY
[459]20  {
[640]21    if (clientSourceFilter)
[1201]22    {
23      if (check_if_active.isEmpty() || (!check_if_active.isEmpty() && (!check_if_active) || isActive(true)))
24        clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);
25    }
[1021]26    else if (instantDataFilter)
[640]27      ERROR("void CField::setData(const CArray<double, N>& _data)",
28            << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation.");
[459]29  }
[1622]30  CATCH_DUMP_ATTR
[459]31
[593]32  template <int N>
33  void CField::getData(CArray<double, N>& _data) const
[1622]34  TRY
[593]35  {
[640]36    if (storeFilter)
[593]37    {
[640]38      CDataPacket::StatusCode status = storeFilter->getData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);
39
40      if (status == CDataPacket::END_OF_STREAM)
41        ERROR("void CField::getData(CArray<double, N>& _data) const",
42              << "Impossible to access field data, all the records of the field [ id = " << getId() << " ] have been already read.");
[593]43    }
44    else
45    {
46      ERROR("void CField::getData(CArray<double, N>& _data) const",
47            << "Impossible to access field data, the field [ id = " << getId() << " ] does not have read access.");
48    }
49  }
[1622]50  CATCH
[352]51} // namespace xios
52
53#endif
Note: See TracBrowser for help on using the repository browser.