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