[1782] | 1 | #ifndef __XIOS_CCouplerIn__ |
---|
| 2 | #define __XIOS_CCouplerIn__ |
---|
| 3 | |
---|
| 4 | /// XIOS headers /// |
---|
| 5 | #include "xios_spl.hpp" |
---|
| 6 | #include "field.hpp" |
---|
| 7 | #include "declare_group.hpp" |
---|
| 8 | #include "date.hpp" |
---|
| 9 | #include "attribute_enum.hpp" |
---|
| 10 | #include "attribute_enum_impl.hpp" |
---|
| 11 | #include "context_client.hpp" |
---|
| 12 | #include "mpi.hpp" |
---|
[1784] | 13 | #include "string_tools.hpp" |
---|
[1782] | 14 | |
---|
| 15 | namespace xios |
---|
| 16 | { |
---|
| 17 | |
---|
| 18 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 19 | |
---|
| 20 | class CCouplerInGroup; |
---|
| 21 | class CCouplerInAttributes; |
---|
| 22 | class CCouplerIn; |
---|
| 23 | |
---|
| 24 | class CGarbageCollector; |
---|
| 25 | |
---|
| 26 | ///-------------------------------------------------------------- |
---|
| 27 | |
---|
| 28 | // Declare/Define CCouplerInAttribute |
---|
| 29 | BEGIN_DECLARE_ATTRIBUTE_MAP(CCouplerIn) |
---|
| 30 | # include "coupler_in_attribute.conf" |
---|
| 31 | END_DECLARE_ATTRIBUTE_MAP(CCouplerIn) |
---|
| 32 | |
---|
| 33 | ///-------------------------------------------------------------- |
---|
| 34 | |
---|
| 35 | /*! |
---|
| 36 | \class CCouplerIn |
---|
| 37 | This class corresponds to file component of the xml. |
---|
| 38 | The class contains all the nessceary information to write data into a netcdf file: The most important thing |
---|
| 39 | is the field(s) which will be written into file. Besides, there are some options to write |
---|
| 40 | data into file, e.g: writting into only one file or multiple file; splitting a running into several files. |
---|
| 41 | Moreover, there are some other attributes of netcdf file which are also stored in this class |
---|
| 42 | */ |
---|
| 43 | class CCouplerIn |
---|
| 44 | : public CObjectTemplate<CCouplerIn> |
---|
| 45 | , public CCouplerInAttributes |
---|
| 46 | { |
---|
| 47 | /// typedef /// |
---|
| 48 | typedef CObjectTemplate<CCouplerIn> SuperClass; |
---|
| 49 | typedef CCouplerInAttributes SuperClassAttribute; |
---|
| 50 | |
---|
| 51 | public : |
---|
| 52 | enum EEventId |
---|
| 53 | { |
---|
| 54 | NO_EVENT |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | typedef CCouplerInAttributes RelAttributes; |
---|
| 58 | typedef CCouplerInGroup RelGroup; |
---|
| 59 | |
---|
| 60 | /// Constructeurs /// |
---|
| 61 | CCouplerIn(void); |
---|
| 62 | explicit CCouplerIn(const StdString& id); |
---|
| 63 | CCouplerIn(const CCouplerIn& couplerIn); // Not implemented yet. |
---|
| 64 | CCouplerIn(const CCouplerIn* const couplerIn); // Not implemented yet. |
---|
| 65 | |
---|
| 66 | /// Destructeur /// |
---|
| 67 | virtual ~CCouplerIn(void); |
---|
| 68 | |
---|
| 69 | public: |
---|
| 70 | /// Accesseurs /// |
---|
| 71 | CFieldGroup* getVirtualFieldGroup(void) const; |
---|
| 72 | std::vector<CField*> getAllFields(void) const; |
---|
| 73 | std::vector<CField* > getEnabledFields(void); |
---|
| 74 | |
---|
| 75 | StdString dumpClassAttributes(void); |
---|
| 76 | |
---|
| 77 | public : |
---|
| 78 | void setVirtualFieldGroup(CFieldGroup* newVFieldGroup); |
---|
| 79 | |
---|
| 80 | // Add component into coupler |
---|
| 81 | CField* addField(const string& id = ""); |
---|
| 82 | CFieldGroup* addFieldGroup(const string& id = ""); |
---|
| 83 | |
---|
| 84 | public: |
---|
| 85 | /// Accesseurs statiques /// |
---|
| 86 | static StdString GetName(void); |
---|
| 87 | static StdString GetDefName(void); |
---|
| 88 | static ENodeType GetType(void); |
---|
| 89 | public: |
---|
| 90 | /// Traitements /// |
---|
| 91 | virtual void parse(xml::CXMLNode& node); |
---|
| 92 | // virtual StdString toString(void) const; |
---|
| 93 | |
---|
| 94 | public: |
---|
[1784] | 95 | virtual void solveDescInheritance(bool apply, const CAttributeMap* const parent = 0); |
---|
| 96 | void solveFieldRefInheritance(bool apply); |
---|
| 97 | void createInterCommunicator(void) ; |
---|
[1782] | 98 | |
---|
| 99 | private : |
---|
| 100 | CFieldGroup* virtualFieldGroup; |
---|
| 101 | |
---|
| 102 | // std::shared_ptr<CDataOutput> data_out; |
---|
| 103 | // std::shared_ptr<CDataInput> data_in; |
---|
| 104 | std::vector<CField*> enabledFields; |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | public: |
---|
| 108 | |
---|
| 109 | }; // class CCouplerIn |
---|
| 110 | |
---|
| 111 | ///-------------------------------------------------------------- |
---|
| 112 | |
---|
| 113 | // Declare/Define CCouplerInGroup and CCouplerInDefinition |
---|
| 114 | DECLARE_GROUP(CCouplerIn); |
---|
| 115 | |
---|
| 116 | ///-------------------------------------------------------------- |
---|
| 117 | |
---|
| 118 | } // namespace xios |
---|
| 119 | |
---|
| 120 | #endif // __XIOS_CCouplingIn__ |
---|