XIOS  1.0
Xml I/O Server
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Définitions de type Énumérations Valeurs énumérées Amis Macros
field_impl.hpp
Aller à la documentation de ce fichier.
1 
2 #ifndef __FIELD_IMPL_HPP__
3 #define __FIELD_IMPL_HPP__
4 
5 #include "xios_spl.hpp"
6 #include "field.hpp"
7 #include "context.hpp"
8 #include "grid.hpp"
9 #include "timer.hpp"
10 #include "array_new.hpp"
11 #include "source_filter.hpp"
12 #include "store_filter.hpp"
13 
14 
15 namespace xios {
16 
17  template <int N>
19  TRY
20  {
21  if (clientSourceFilter)
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  }
26  else if (instantDataFilter)
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.");
29  }
31 
32  template <int N>
34  TRY
35  {
36  if (storeFilter)
37  {
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.");
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  }
50  CATCH
51 } // namespace xios
52 
53 #endif
#define CATCH_DUMP_ATTR
Definition: exception.hpp:156
Last packet of the stream, does not have data.
Definition: data_packet.hpp:21
#define TRY
Definition: exception.hpp:154
#define xios(arg)
CATCH CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar *scalarDestination, CScalar *scalarSource, CReduceScalarToScalar *algo ERROR)("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)",<< "Operation must be defined."<< "Scalar source "<< scalarSource->getId()<< std::endl<< "Scalar destination "<< scalarDestination->getId())
////////////////////// Déclarations ////////////////////// ///
Definition: array.hpp:25
void getData(CArray< double, N > &_data) const
static const xios::CCalendar & getCalendar(const std::string &idFunc)
Definition: icdate.cpp:23
StatusCode
Describes the status associated to a packet.
Definition: data_packet.hpp:19
void setData(const CArray< double, N > &_data)
Definition: field_impl.hpp:18
#define CATCH
Definition: exception.hpp:155
static CContext * getCurrent(void)
Get current context.
Definition: context.cpp:2018