[219] | 1 | #ifndef __XMLIO_CDomain__ |
---|
| 2 | #define __XMLIO_CDomain__ |
---|
| 3 | |
---|
[335] | 4 | /// xios headers /// |
---|
[219] | 5 | #include "xmlioserver_spl.hpp" |
---|
| 6 | #include "group_factory.hpp" |
---|
| 7 | |
---|
| 8 | #include "declare_group.hpp" |
---|
[300] | 9 | #include "event_client.hpp" |
---|
| 10 | #include "event_server.hpp" |
---|
| 11 | #include "buffer_in.hpp" |
---|
[369] | 12 | #include "array_new.hpp" |
---|
| 13 | #include "attribute_array.hpp" |
---|
[219] | 14 | |
---|
[335] | 15 | namespace xios { |
---|
[219] | 16 | |
---|
| 17 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 18 | |
---|
| 19 | class CDomainGroup; |
---|
| 20 | class CDomainAttributes; |
---|
| 21 | class CDomain; |
---|
| 22 | |
---|
| 23 | ///-------------------------------------------------------------- |
---|
| 24 | |
---|
| 25 | // Declare/Define CDomainAttribute |
---|
| 26 | BEGIN_DECLARE_ATTRIBUTE_MAP(CDomain) |
---|
| 27 | # include "domain_attribute.conf" |
---|
| 28 | END_DECLARE_ATTRIBUTE_MAP(CDomain) |
---|
| 29 | |
---|
| 30 | ///-------------------------------------------------------------- |
---|
| 31 | |
---|
| 32 | class CDomain |
---|
| 33 | : public CObjectTemplate<CDomain> |
---|
| 34 | , public CDomainAttributes |
---|
| 35 | { |
---|
[300] | 36 | enum EEventId |
---|
| 37 | { |
---|
| 38 | EVENT_ID_SERVER_ATTRIBUT, EVENT_ID_LON_LAT |
---|
| 39 | } ; |
---|
| 40 | |
---|
[219] | 41 | /// typedef /// |
---|
| 42 | typedef CObjectTemplate<CDomain> SuperClass; |
---|
| 43 | typedef CDomainAttributes SuperClassAttribute; |
---|
| 44 | |
---|
| 45 | public : |
---|
| 46 | |
---|
| 47 | typedef CDomainAttributes RelAttributes; |
---|
| 48 | typedef CDomainGroup RelGroup; |
---|
| 49 | |
---|
| 50 | /// Constructeurs /// |
---|
| 51 | CDomain(void); |
---|
| 52 | explicit CDomain(const StdString & id); |
---|
| 53 | CDomain(const CDomain & domain); // Not implemented yet. |
---|
| 54 | CDomain(const CDomain * const domain); // Not implemented yet. |
---|
| 55 | |
---|
| 56 | /// Vérifications /// |
---|
| 57 | void checkAttributes(void); |
---|
| 58 | |
---|
| 59 | private : |
---|
| 60 | |
---|
| 61 | void checkGlobalDomain(void); |
---|
| 62 | |
---|
| 63 | void checkLocalIDomain(void); |
---|
| 64 | void checkLocalJDomain(void); |
---|
| 65 | |
---|
| 66 | void checkMask(void); |
---|
| 67 | void checkDomainData(void); |
---|
| 68 | void checkCompression(void); |
---|
| 69 | |
---|
| 70 | void checkZoom(void); |
---|
| 71 | |
---|
| 72 | void completeMask(void); |
---|
| 73 | |
---|
| 74 | public : |
---|
| 75 | |
---|
| 76 | /// Autres /// |
---|
[369] | 77 | // virtual void fromBinary(StdIStream & is); |
---|
[219] | 78 | |
---|
| 79 | /// Accesseurs /// |
---|
[369] | 80 | CArray<int, 2> getLocalMask(void) const; |
---|
[219] | 81 | |
---|
| 82 | const std::set<StdString> & getRelFiles(void) const; |
---|
| 83 | |
---|
| 84 | const std::vector<int> & getIBeginSub(void) const; |
---|
| 85 | const std::vector<int> & getIEndSub(void) const; |
---|
| 86 | const std::vector<int> & getJBeginSub(void) const; |
---|
| 87 | const std::vector<int> & getJEndSub(void) const; |
---|
[274] | 88 | |
---|
| 89 | const std::vector<int> & getIBeginZoomSub(void) const; |
---|
| 90 | const std::vector<int> & getJBeginZoomSub(void) const; |
---|
[286] | 91 | const std::vector<int> & getNiZoomSub(void) const; |
---|
| 92 | const std::vector<int> & getNjZoomSub(void) const; |
---|
[219] | 93 | |
---|
[369] | 94 | const std::vector<CArray<double,1>* > & getLonValueSub(void) const; |
---|
| 95 | const std::vector<CArray<double,1>* > & getLatValueSub(void) const; |
---|
[219] | 96 | |
---|
| 97 | /// Test /// |
---|
| 98 | bool IsWritten(const StdString & filename) const; |
---|
| 99 | bool hasZoom(void) const; |
---|
| 100 | bool isEmpty(void) const; |
---|
| 101 | |
---|
[300] | 102 | |
---|
| 103 | int ni_client,ibegin_client,iend_client ; |
---|
| 104 | int zoom_ni_client,zoom_ibegin_client,zoom_iend_client ; |
---|
| 105 | |
---|
| 106 | int nj_client,jbegin_client,jend_client ; |
---|
| 107 | int zoom_nj_client,zoom_jbegin_client,zoom_jend_client ; |
---|
| 108 | |
---|
| 109 | int ni_srv,ibegin_srv,iend_srv ; |
---|
| 110 | int zoom_ni_srv,zoom_ibegin_srv,zoom_iend_srv ; |
---|
| 111 | |
---|
| 112 | int nj_srv,jbegin_srv,jend_srv ; |
---|
| 113 | int zoom_nj_srv,zoom_jbegin_srv,zoom_jend_srv ; |
---|
| 114 | |
---|
[369] | 115 | CArray<double, 1> lonvalue_srv, latvalue_srv ; |
---|
[300] | 116 | |
---|
| 117 | |
---|
| 118 | vector<int> connectedServer,nbSenders ; |
---|
| 119 | vector<int> ib_srv, ie_srv, in_srv ; |
---|
| 120 | vector<int> jb_srv, je_srv, jn_srv ; |
---|
| 121 | |
---|
[219] | 122 | public : |
---|
| 123 | |
---|
| 124 | /// Mutateur /// |
---|
| 125 | void addRelFile(const StdString & filename); |
---|
[266] | 126 | void completeLonLatServer(void); |
---|
| 127 | void completeLonLatClient(void); |
---|
[300] | 128 | void sendServerAttribut(void) ; |
---|
| 129 | void sendLonLat(void) ; |
---|
| 130 | void computeConnectedServer(void) ; |
---|
| 131 | static bool dispatchEvent(CEventServer& event) ; |
---|
| 132 | static void recvLonLat(CEventServer& event) ; |
---|
| 133 | static void recvServerAttribut(CEventServer& event) ; |
---|
| 134 | void recvLonLat(CBufferIn& buffer) ; |
---|
| 135 | void recvServerAttribut(CBufferIn& buffer) ; |
---|
[219] | 136 | |
---|
| 137 | /// Destructeur /// |
---|
| 138 | virtual ~CDomain(void); |
---|
| 139 | |
---|
| 140 | /// Accesseurs statiques /// |
---|
| 141 | static StdString GetName(void); |
---|
| 142 | static StdString GetDefName(void); |
---|
| 143 | |
---|
| 144 | static ENodeType GetType(void); |
---|
| 145 | |
---|
[369] | 146 | CArray<int, 2> local_mask; |
---|
[384] | 147 | bool isCurvilinear ; |
---|
[219] | 148 | private : |
---|
| 149 | |
---|
| 150 | /// Proriétés protégées /// |
---|
| 151 | bool isChecked; |
---|
| 152 | std::set<StdString> relFiles; |
---|
| 153 | |
---|
| 154 | std::vector<int> ibegin_sub, iend_sub, jbegin_sub, jend_sub; |
---|
[278] | 155 | std::vector<int> ibegin_zoom_sub, jbegin_zoom_sub, ni_zoom_sub, nj_zoom_sub; |
---|
[369] | 156 | std::vector<CArray<double,1>* > lonvalue_sub, latvalue_sub; |
---|
[300] | 157 | |
---|
[219] | 158 | |
---|
| 159 | }; // class CDomain |
---|
| 160 | |
---|
| 161 | ///-------------------------------------------------------------- |
---|
| 162 | |
---|
| 163 | // Declare/Define CDomainGroup and CDomainDefinition |
---|
| 164 | DECLARE_GROUP(CDomain); |
---|
| 165 | |
---|
| 166 | ///-------------------------------------------------------------- |
---|
| 167 | |
---|
[335] | 168 | } // namespace xios |
---|
[219] | 169 | |
---|
| 170 | #endif // __XMLIO_CDomain__ |
---|