[219] | 1 | #ifndef __XMLIO_CAxis__ |
---|
| 2 | #define __XMLIO_CAxis__ |
---|
| 3 | |
---|
[335] | 4 | /// xios headers /// |
---|
[219] | 5 | #include "xmlioserver_spl.hpp" |
---|
| 6 | #include "group_factory.hpp" |
---|
| 7 | |
---|
| 8 | #include "declare_group.hpp" |
---|
[540] | 9 | #include "declare_ref_func.hpp" |
---|
[369] | 10 | #include "attribute_array.hpp" |
---|
[399] | 11 | #include "attribute_enum.hpp" |
---|
| 12 | #include "attribute_enum_impl.hpp" |
---|
[567] | 13 | #include "server_distribution_description.hpp" |
---|
[219] | 14 | |
---|
[335] | 15 | namespace xios { |
---|
[540] | 16 | |
---|
[219] | 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) |
---|
[231] | 27 | # include "axis_attribute.conf" |
---|
[219] | 28 | END_DECLARE_ATTRIBUTE_MAP(CAxis) |
---|
| 29 | |
---|
| 30 | ///-------------------------------------------------------------- |
---|
| 31 | |
---|
| 32 | class CAxis |
---|
| 33 | : public CObjectTemplate<CAxis> |
---|
| 34 | , public CAxisAttributes |
---|
| 35 | { |
---|
[567] | 36 | enum EEventId |
---|
| 37 | { |
---|
| 38 | EVENT_ID_SERVER_ATTRIBUT |
---|
| 39 | } ; |
---|
| 40 | |
---|
[219] | 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 | |
---|
| 62 | /// Mutateur /// |
---|
| 63 | void addRelFile(const StdString & filename); |
---|
| 64 | |
---|
| 65 | /// Vérifications /// |
---|
| 66 | void checkAttributes(void); |
---|
| 67 | |
---|
| 68 | /// Destructeur /// |
---|
| 69 | virtual ~CAxis(void); |
---|
| 70 | |
---|
| 71 | /// Accesseurs statiques /// |
---|
| 72 | static StdString GetName(void); |
---|
| 73 | static StdString GetDefName(void); |
---|
| 74 | static ENodeType GetType(void); |
---|
| 75 | |
---|
[567] | 76 | void sendServerAttribut(void); |
---|
| 77 | static bool dispatchEvent(CEventServer& event); |
---|
| 78 | static void recvServerAttribut(CEventServer& event); |
---|
| 79 | void recvServerAttribut(CBufferIn& buffer) ; |
---|
| 80 | void checkAttributesOnClient(const std::vector<int>& globalDim, int orderPositionInGrid, |
---|
| 81 | CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION); |
---|
| 82 | void sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, |
---|
| 83 | CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION); |
---|
| 84 | public: |
---|
| 85 | int zoom_begin_srv, zoom_end_srv, zoom_size_srv; |
---|
| 86 | int ni_srv, begin_srv, end_srv; |
---|
[219] | 87 | private : |
---|
[551] | 88 | void checkData(); |
---|
| 89 | void checkMask(); |
---|
[567] | 90 | void checkZoom(); |
---|
| 91 | void computeServerIndex(const std::vector<int>& globalDim, int orderPositionInGrid, |
---|
| 92 | CServerDistributionDescription::ServerDistributionType disType); |
---|
| 93 | private: |
---|
| 94 | |
---|
[219] | 95 | bool isChecked; |
---|
[567] | 96 | bool areClientAttributesChecked_; |
---|
[219] | 97 | std::set<StdString> relFiles; |
---|
| 98 | |
---|
[540] | 99 | DECLARE_REF_FUNC(Axis,axis) |
---|
[219] | 100 | |
---|
[540] | 101 | |
---|
[219] | 102 | }; // class CAxis |
---|
| 103 | |
---|
| 104 | ///-------------------------------------------------------------- |
---|
| 105 | |
---|
| 106 | // Declare/Define CAxisGroup and CAxisDefinition |
---|
| 107 | DECLARE_GROUP(CAxis); |
---|
| 108 | |
---|
| 109 | ///-------------------------------------------------------------- |
---|
| 110 | |
---|
[335] | 111 | } // namespace xios |
---|
[219] | 112 | |
---|
| 113 | #endif // __XMLIO_CAxis__ |
---|