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