source: XIOS/trunk/src/node/domain.hpp @ 501

Last change on this file since 501 was 501, checked in by ymipsl, 10 years ago

Add licence copyright to all file ond directory src using the command :
svn propset -R copyright -F header_licence src

XIOS is now officialy under CeCILL licence

YM

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 4.6 KB
Line 
1#ifndef __XMLIO_CDomain__
2#define __XMLIO_CDomain__
3
4/// xios headers ///
5#include "xmlioserver_spl.hpp"
6#include "group_factory.hpp"
7
8#include "declare_group.hpp"
9#include "event_client.hpp"
10#include "event_server.hpp"
11#include "buffer_in.hpp"
12#include "array_new.hpp"
13#include "attribute_array.hpp"
14#include "attribute_enum.hpp"
15
16namespace xios {
17   
18   /// ////////////////////// Déclarations ////////////////////// ///
19
20   class CDomainGroup;
21   class CDomainAttributes;
22   class CDomain;
23
24   ///--------------------------------------------------------------
25
26   // Declare/Define CDomainAttribute
27   BEGIN_DECLARE_ATTRIBUTE_MAP(CDomain)
28#  include "domain_attribute.conf"
29   END_DECLARE_ATTRIBUTE_MAP(CDomain)
30
31   ///--------------------------------------------------------------
32
33   class CDomain
34      : public CObjectTemplate<CDomain>
35      , public CDomainAttributes
36   {
37         enum EEventId
38         {
39           EVENT_ID_SERVER_ATTRIBUT, EVENT_ID_LON_LAT
40         } ;
41         
42         /// typedef ///
43         typedef CObjectTemplate<CDomain>   SuperClass;
44         typedef CDomainAttributes SuperClassAttribute;
45
46      public :
47
48         typedef CDomainAttributes RelAttributes;
49         typedef CDomainGroup      RelGroup;
50
51         /// Constructeurs ///
52         CDomain(void);
53         explicit CDomain(const StdString & id);
54         CDomain(const CDomain & domain);       // Not implemented yet.
55         CDomain(const CDomain * const domain); // Not implemented yet.
56
57         /// Vérifications ///
58         void checkAttributes(void);
59
60      private :
61
62         void checkDomain(void);
63
64         void checkLocalIDomain(void);
65         void checkLocalJDomain(void);
66
67         void checkMask(void);
68         void checkDomainData(void);
69         void checkCompression(void);
70         
71         void checkZoom(void);
72         void checkBounds(void);
73
74
75      public :
76     
77         /// Autres ///
78
79         const std::set<StdString> & getRelFiles(void) const;
80
81
82         /// Test ///
83         bool IsWritten(const StdString & filename) const;
84         bool hasZoom(void) const;
85         bool isEmpty(void) const;
86         
87         
88         int ni_client,ibegin_client,iend_client ;
89         int zoom_ni_client,zoom_ibegin_client,zoom_iend_client ;
90
91         int nj_client,jbegin_client,jend_client ;
92         int zoom_nj_client,zoom_jbegin_client,zoom_jend_client ;
93
94         int ni_srv,ibegin_srv,iend_srv ;
95         int zoom_ni_srv,zoom_ibegin_srv,zoom_iend_srv ;
96
97         int nj_srv,jbegin_srv,jend_srv ;
98         int zoom_nj_srv,zoom_jbegin_srv,zoom_jend_srv ;
99
100         CArray<double, 1> lonvalue_srv, latvalue_srv ;
101         CArray<double, 2> bounds_lon_srv, bounds_lat_srv ;
102         
103         
104        vector<int> connectedServer ; // list of connected server
105        vector<int> nbSenders ; // for each communication with a server, number of communicating client
106        vector<int> nbDataSrv ; // size of data to send to each server
107        vector< vector<int> > i_indSrv ; // for each server, i global index to send
108        vector< vector<int> > j_indSrv ; // for each server, j global index to send
109       
110        CArray<int,2> mapConnectedServer ;  // (ni,nj) => mapped to connected server number, -1 if no server is target
111               
112//        vector<int> ib_srv, ie_srv, in_srv ;
113//        vector<int> jb_srv, je_srv, jn_srv ;
114         
115      public :
116     
117         /// Mutateur ///
118         void addRelFile(const StdString & filename);
119         void completeLonLatClient(void);
120         void sendServerAttribut(void) ;
121         void sendLonLat(void) ;
122         void computeConnectedServer(void) ;
123         static bool dispatchEvent(CEventServer& event) ;
124         static void recvLonLat(CEventServer& event) ;
125         static void recvServerAttribut(CEventServer& event) ;
126         void recvLonLat(CBufferIn& buffer) ;
127         void recvServerAttribut(CBufferIn& buffer) ;
128         
129         /// Destructeur ///
130         virtual ~CDomain(void);
131
132         /// Accesseurs statiques ///
133         static StdString GetName(void);
134         static StdString GetDefName(void);
135         
136         static ENodeType GetType(void);
137
138         CArray<int, 2> local_mask;
139         bool isCurvilinear ;
140         bool hasBounds ;
141       private :
142
143         /// Proriétés protégées ///
144         bool isChecked;
145         std::set<StdString> relFiles;
146
147   }; // class CDomain
148
149   ///--------------------------------------------------------------
150
151   // Declare/Define CDomainGroup and CDomainDefinition
152   DECLARE_GROUP(CDomain);
153
154   ///--------------------------------------------------------------
155
156} // namespace xios
157
158#endif // __XMLIO_CDomain__
Note: See TracBrowser for help on using the repository browser.