1 | #ifndef __XIOS_CAxis__ |
---|
2 | #define __XIOS_CAxis__ |
---|
3 | |
---|
4 | /// XIOS headers /// |
---|
5 | #include "xios_spl.hpp" |
---|
6 | #include "group_factory.hpp" |
---|
7 | #include "virtual_node.hpp" |
---|
8 | |
---|
9 | #include "declare_group.hpp" |
---|
10 | #include "declare_ref_func.hpp" |
---|
11 | #include "declare_virtual_node.hpp" |
---|
12 | #include "attribute_array.hpp" |
---|
13 | #include "attribute_enum.hpp" |
---|
14 | #include "attribute_enum_impl.hpp" |
---|
15 | #include "server_distribution_description.hpp" |
---|
16 | #include "transformation.hpp" |
---|
17 | #include "transformation_enum.hpp" |
---|
18 | |
---|
19 | namespace xios { |
---|
20 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
21 | |
---|
22 | class CAxisGroup; |
---|
23 | class CAxisAttributes; |
---|
24 | class CAxis; |
---|
25 | |
---|
26 | ///-------------------------------------------------------------- |
---|
27 | |
---|
28 | // Declare/Define CAxisAttribute |
---|
29 | BEGIN_DECLARE_ATTRIBUTE_MAP(CAxis) |
---|
30 | # include "axis_attribute.conf" |
---|
31 | END_DECLARE_ATTRIBUTE_MAP(CAxis) |
---|
32 | |
---|
33 | ///-------------------------------------------------------------- |
---|
34 | |
---|
35 | class CAxis |
---|
36 | : public CObjectTemplate<CAxis> |
---|
37 | , public CAxisAttributes |
---|
38 | { |
---|
39 | enum EEventId |
---|
40 | { |
---|
41 | EVENT_ID_SERVER_ATTRIBUT |
---|
42 | } ; |
---|
43 | |
---|
44 | /// typedef /// |
---|
45 | typedef CObjectTemplate<CAxis> SuperClass; |
---|
46 | typedef CAxisAttributes SuperClassAttribute; |
---|
47 | |
---|
48 | public : |
---|
49 | |
---|
50 | typedef CAxisAttributes RelAttributes; |
---|
51 | typedef CAxisGroup RelGroup; |
---|
52 | typedef CTransformation<CAxis>::TransformationMapTypes TransMapTypes; |
---|
53 | |
---|
54 | public: |
---|
55 | /// Constructeurs /// |
---|
56 | CAxis(void); |
---|
57 | explicit CAxis(const StdString & id); |
---|
58 | CAxis(const CAxis & axis); // Not implemented yet. |
---|
59 | CAxis(const CAxis * const axis); // Not implemented yet. |
---|
60 | |
---|
61 | static CAxis* createAxis(); |
---|
62 | |
---|
63 | /// Accesseurs /// |
---|
64 | const std::set<StdString> & getRelFiles(void) const; |
---|
65 | |
---|
66 | /// Test /// |
---|
67 | bool IsWritten(const StdString & filename) const; |
---|
68 | bool isDistributed(void) const; |
---|
69 | |
---|
70 | /// Mutateur /// |
---|
71 | void addRelFile(const StdString & filename); |
---|
72 | |
---|
73 | /// Vérifications /// |
---|
74 | void checkAttributes(void); |
---|
75 | |
---|
76 | /// Destructeur /// |
---|
77 | virtual ~CAxis(void); |
---|
78 | |
---|
79 | virtual void parse(xml::CXMLNode & node); |
---|
80 | |
---|
81 | /// Accesseurs statiques /// |
---|
82 | static StdString GetName(void); |
---|
83 | static StdString GetDefName(void); |
---|
84 | static ENodeType GetType(void); |
---|
85 | |
---|
86 | void sendServerAttribut(const std::vector<int>& globalDim, int orderPositionInGrid, |
---|
87 | CServerDistributionDescription::ServerDistributionType distType); |
---|
88 | static bool dispatchEvent(CEventServer& event); |
---|
89 | static void recvServerAttribut(CEventServer& event); |
---|
90 | void recvServerAttribut(CBufferIn& buffer) ; |
---|
91 | void checkAttributesOnClient(const std::vector<int>& globalDim, int orderPositionInGrid, |
---|
92 | CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION); |
---|
93 | void sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, |
---|
94 | CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION); |
---|
95 | |
---|
96 | bool hasTransformation(); |
---|
97 | void solveInheritanceTransformation(); |
---|
98 | TransMapTypes getAllTransformations(); |
---|
99 | |
---|
100 | public: |
---|
101 | int zoom_begin_srv, zoom_end_srv, zoom_size_srv; |
---|
102 | int ni_srv, begin_srv, end_srv; |
---|
103 | int global_zoom_begin, global_zoom_size; // The real global zoom begin and zoom size after axis is transformed (zoomed) |
---|
104 | private : |
---|
105 | void checkData(); |
---|
106 | void checkMask(); |
---|
107 | void checkZoom(); |
---|
108 | void checkTransformations(); |
---|
109 | void computeServerIndex(const std::vector<int>& globalDim, int orderPositionInGrid, |
---|
110 | CServerDistributionDescription::ServerDistributionType disType); |
---|
111 | |
---|
112 | |
---|
113 | void setTransformations(const TransMapTypes&); |
---|
114 | private: |
---|
115 | bool isChecked; |
---|
116 | bool areClientAttributesChecked_; |
---|
117 | std::set<StdString> relFiles; |
---|
118 | TransMapTypes transformationMap_; |
---|
119 | bool isDistributed_; |
---|
120 | |
---|
121 | DECLARE_REF_FUNC(Axis,axis) |
---|
122 | }; // class CAxis |
---|
123 | |
---|
124 | ///-------------------------------------------------------------- |
---|
125 | |
---|
126 | // Declare/Define CAxisGroup and CAxisDefinition |
---|
127 | DECLARE_GROUP(CAxis); |
---|
128 | } // namespace xios |
---|
129 | |
---|
130 | #endif // __XIOS_CAxis__ |
---|