Changeset 509 for XIOS/trunk/src/node/file.hpp
- Timestamp:
- 11/13/14 15:09:14 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/file.hpp
r501 r509 15 15 16 16 namespace xios { 17 17 18 18 /// ////////////////////// Déclarations ////////////////////// /// 19 19 … … 31 31 ///-------------------------------------------------------------- 32 32 33 /*! 34 \class CFile 35 This class corresponds to file component of the xml. 36 The class contains all the nessceary information to write data into a netcdf file: The most important thing 37 is the field(s) which will be written into file. Besides, there are some options to write 38 data into file, e.g: writting into only one file or multiple file; splitting a running into several files. 39 Moreover, there are some other attributes of netcdf file which are also stored in this class 40 */ 33 41 class CFile 34 42 : public CObjectTemplate<CFile> … … 38 46 typedef CObjectTemplate<CFile> SuperClass; 39 47 typedef CFileAttributes SuperClassAttribute; 40 48 41 49 public : 42 50 enum EEventId 43 51 { 44 EVENT_ID_ADD_FIELD=0,EVENT_ID_ADD_FIELD_GROUP, EVENT_ID_ADD_VARIABLE,EVENT_ID_ADD_VARIABLE_GROUP 52 EVENT_ID_ADD_FIELD=0,EVENT_ID_ADD_FIELD_GROUP, EVENT_ID_ADD_VARIABLE, 53 EVENT_ID_ADD_VARIABLE_GROUP, EVENT_ID_CREATE_ENABLED_FIELDS 45 54 } ; 46 55 47 56 typedef CFileAttributes RelAttributes; 48 57 typedef CFileGroup RelGroup; … … 54 63 CFile(const CFile * const file); // Not implemented yet. 55 64 65 /// Destructeur /// 66 virtual ~CFile(void); 67 68 public: 56 69 /// Accesseurs /// 57 70 boost::shared_ptr<CDataOutput> getDataOutput(void) const; … … 66 79 67 80 public : 68 69 /// Mutateurs /// 70 void setVirtualFieldGroup(CFieldGroup* newVFieldGroup); 71 void setVirtualFieldGroup(void); 72 void setVirtualVariableGroup(CVariableGroup* newVVariableGroup); 73 void setVirtualVariableGroup(void); 74 void processEnabledFile(void) ; 75 void processEnabledFields(void) ; 76 void createHeader(void); 77 void close(void) ; 78 79 /// Traitements /// 80 virtual void solveDescInheritance(bool apply, const CAttributeMap * const parent = 0); 81 void solveFieldRefInheritance(bool apply); 82 void solveEFGridRef(void); 83 void solveEFOperation(void); 84 void solveEFExpression(void); 85 86 /// Destructeur /// 87 virtual ~CFile(void); 88 89 /// Autres /// 90 virtual void parse(xml::CXMLNode & node); 91 virtual StdString toString(void) const; 92 93 // virtual void toBinary (StdOStream & os) const; 94 // virtual void fromBinary(StdIStream & is); 95 96 /// Accesseurs statiques /// 97 static StdString GetName(void); 98 static StdString GetDefName(void); 99 100 static ENodeType GetType(void); 101 102 bool allDomainEmpty ; 103 CField* addField(const string& id="") ; 104 CFieldGroup* addFieldGroup(const string& id="") ; 105 CVariable* addVariable(const string& id="") ; 106 CVariableGroup* addVariableGroup(const string& id="") ; 107 void sendAddField(const string& id="") ; 108 void sendAddFieldGroup(const string& id="") ; 109 static void recvAddField(CEventServer& event) ; 110 void recvAddField(CBufferIn& buffer) ; 111 static void recvAddFieldGroup(CEventServer& event) ; 112 void recvAddFieldGroup(CBufferIn& buffer) ; 113 114 void sendAddVariable(const string& id="") ; 115 void sendAddVariableGroup(const string& id="") ; 116 static void recvAddVariable(CEventServer& event) ; 117 void recvAddVariable(CBufferIn& buffer) ; 118 static void recvAddVariableGroup(CEventServer& event) ; 119 void recvAddVariableGroup(CBufferIn& buffer) ; 120 static bool dispatchEvent(CEventServer& event) ; 121 81 // Some functions to verify state of file 122 82 bool isSyncTime(void) ; 123 83 bool checkSplit(void) ; … … 125 85 void checkFile(void) ; 126 86 void initFile(void) ; 87 88 /// Mutateurs /// 89 // Set some root definitions in a file 90 void setVirtualFieldGroup(CFieldGroup* newVFieldGroup); 91 void setVirtualFieldGroup(void); 92 void setVirtualVariableGroup(CVariableGroup* newVVariableGroup); 93 void setVirtualVariableGroup(void); 94 95 void createHeader(void); 96 void close(void) ; 97 98 // Some processing on file 99 void solveFieldRefInheritance(bool apply); 100 void solveEFGridRef(void); 101 void solveEFOperation(void); 102 void solveEFExpression(void); 103 void processEnabledFile(void) ; 104 void processEnabledFields(void) ; 105 void solveAllRefOfEnabledFields(bool sendToServer); 106 void buildAllExpressionOfEnabledFields(); 107 108 // Add component into file 109 CField* addField(const string& id="") ; 110 CFieldGroup* addFieldGroup(const string& id="") ; 111 CVariable* addVariable(const string& id="") ; 112 CVariableGroup* addVariableGroup(const string& id="") ; 113 114 // Send info to serever 115 void sendEnabledFields(); 116 void sendAddField(const string& id="") ; 117 void sendAddFieldGroup(const string& id="") ; 118 void sendAddAllVariables(); 119 void sendAddVariable(const string& id="") ; 120 void sendAddVariableGroup(const string& id="") ; 121 122 // Receive info from client 123 static void recvAddField(CEventServer& event) ; 124 void recvAddField(CBufferIn& buffer) ; 125 static void recvAddFieldGroup(CEventServer& event) ; 126 void recvAddFieldGroup(CBufferIn& buffer) ; 127 static void recvAddVariable(CEventServer& event) ; 128 void recvAddVariable(CBufferIn& buffer) ; 129 static void recvAddVariableGroup(CEventServer& event) ; 130 void recvAddVariableGroup(CBufferIn& buffer) ; 131 132 // Dispatch event 133 static bool dispatchEvent(CEventServer& event) ; 134 135 public: 136 /// Accesseurs statiques /// 137 static StdString GetName(void); 138 static StdString GetDefName(void); 139 140 static ENodeType GetType(void); 141 public: 142 /// Traitements /// 143 virtual void solveDescInheritance(bool apply, const CAttributeMap * const parent = 0); 144 145 /// Autres /// 146 virtual void parse(xml::CXMLNode & node); 147 virtual StdString toString(void) const; 148 public: 149 127 150 CDate* lastSync ; 128 151 CDate* lastSplit ; … … 132 155 int nbDomain ; 133 156 bool isOpen ; 157 bool allDomainEmpty ; 134 158 MPI_Comm fileComm ; 159 135 160 private : 136 137 161 /// Propriétés privées /// 138 162 CFieldGroup* vFieldGroup; … … 140 164 boost::shared_ptr<CDataOutput> data_out; 141 165 std::vector<CField*> enabledFields; 166 167 public: 168 // virtual void toBinary (StdOStream & os) const; 169 // virtual void fromBinary(StdIStream & is); 142 170 143 171 }; // class CFile
Note: See TracChangeset
for help on using the changeset viewer.