1 | #include "reduce_axis_to_axis.hpp" |
---|
2 | #include "type.hpp" |
---|
3 | #include "axis.hpp" |
---|
4 | |
---|
5 | namespace xios { |
---|
6 | |
---|
7 | /// ////////////////////// Définitions ////////////////////// /// |
---|
8 | |
---|
9 | CReduceAxisToAxis::CReduceAxisToAxis(void) |
---|
10 | : CObjectTemplate<CReduceAxisToAxis>(), CReduceAxisToAxisAttributes(), CTransformation<CAxis>() |
---|
11 | { /* Ne rien faire de plus */ } |
---|
12 | |
---|
13 | CReduceAxisToAxis::CReduceAxisToAxis(const StdString & id) |
---|
14 | : CObjectTemplate<CReduceAxisToAxis>(id), CReduceAxisToAxisAttributes(), CTransformation<CAxis>() |
---|
15 | { /* Ne rien faire de plus */ } |
---|
16 | |
---|
17 | CReduceAxisToAxis::~CReduceAxisToAxis(void) |
---|
18 | {} |
---|
19 | |
---|
20 | CTransformation<CAxis>* CReduceAxisToAxis::create(const StdString& id, xml::CXMLNode* node) |
---|
21 | { |
---|
22 | CReduceAxisToAxis* reduceAxis = CReduceAxisToAxisGroup::get("reduce_axis_to_axis_definition")->createChild(id); |
---|
23 | if (node) reduceAxis->parse(*node); |
---|
24 | return static_cast<CTransformation<CAxis>*>(reduceAxis); |
---|
25 | } |
---|
26 | |
---|
27 | bool CReduceAxisToAxis::registerTrans() |
---|
28 | { |
---|
29 | return registerTransformation(TRANS_REDUCE_AXIS_TO_AXIS, CReduceAxisToAxis::create); |
---|
30 | } |
---|
31 | |
---|
32 | bool CReduceAxisToAxis::_dummyRegistered = CReduceAxisToAxis::registerTrans(); |
---|
33 | |
---|
34 | //---------------------------------------------------------------- |
---|
35 | |
---|
36 | StdString CReduceAxisToAxis::GetName(void) { return StdString("reduce_axis_to_axis"); } |
---|
37 | StdString CReduceAxisToAxis::GetDefName(void) { return StdString("reduce_axis_to_axis"); } |
---|
38 | ENodeType CReduceAxisToAxis::GetType(void) { return eReduceAxisToAxis; } |
---|
39 | |
---|
40 | void CReduceAxisToAxis::checkValid(CAxis* axisDst, CAxis* axisSrc) |
---|
41 | { |
---|
42 | |
---|
43 | if (this->operation.isEmpty()) |
---|
44 | ERROR("CReduceAxisToAxis::checkValid(CAxis* axisDst, CAxis* axisSrc)", |
---|
45 | << "An operation must be defined." |
---|
46 | << "Axis source " <<axisSrc->getId() << std::endl |
---|
47 | << "Axis destination " << axisDst->getId()); |
---|
48 | |
---|
49 | |
---|
50 | if (axisDst->n_glo != axisSrc->n_glo) |
---|
51 | ERROR("CReduceAxisToAxis::checkValid(CAxis* axisDst, CAxis* axisSrc)", |
---|
52 | << "both axis should have same n_glo" |
---|
53 | << "Axis source " <<axisSrc->getId() << " has n_glo " << axisSrc->n_glo << std::endl |
---|
54 | << "Axis destination " << axisDst->getId() << " has n_glo " << axisDst->n_glo); |
---|
55 | |
---|
56 | } |
---|
57 | |
---|
58 | } |
---|