[1782] | 1 | #ifndef __XIOS_CCouplerOut__ |
---|
| 2 | #define __XIOS_CCouplerOut__ |
---|
| 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" |
---|
| 13 | |
---|
| 14 | namespace xios |
---|
| 15 | { |
---|
| 16 | |
---|
| 17 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 18 | |
---|
| 19 | class CCouplerOutGroup; |
---|
| 20 | class CCouplerOutAttributes; |
---|
| 21 | class CCouplerOut; |
---|
| 22 | |
---|
| 23 | class CGarbageCollector; |
---|
| 24 | |
---|
| 25 | ///-------------------------------------------------------------- |
---|
| 26 | |
---|
| 27 | // Declare/Define CCouplerOutAttribute |
---|
| 28 | BEGIN_DECLARE_ATTRIBUTE_MAP(CCouplerOut) |
---|
| 29 | # include "coupler_out_attribute.conf" |
---|
| 30 | END_DECLARE_ATTRIBUTE_MAP(CCouplerOut) |
---|
| 31 | |
---|
| 32 | ///-------------------------------------------------------------- |
---|
| 33 | |
---|
| 34 | /*! |
---|
| 35 | \class CCouplerOut |
---|
| 36 | |
---|
| 37 | */ |
---|
| 38 | class CCouplerOut |
---|
| 39 | : public CObjectTemplate<CCouplerOut> |
---|
| 40 | , public CCouplerOutAttributes |
---|
| 41 | { |
---|
| 42 | /// typedef /// |
---|
| 43 | typedef CObjectTemplate<CCouplerOut> SuperClass; |
---|
| 44 | typedef CCouplerOutAttributes SuperClassAttribute; |
---|
| 45 | |
---|
| 46 | public : |
---|
| 47 | enum EEventId |
---|
| 48 | { |
---|
[2326] | 49 | EVENT_ID_COLLECTIVE=100, |
---|
| 50 | NO_EVENT, |
---|
| 51 | EVENT_ID_NO_COLLECTIVE=1000, |
---|
[1782] | 52 | }; |
---|
| 53 | |
---|
| 54 | typedef CCouplerOutAttributes RelAttributes; |
---|
| 55 | typedef CCouplerOutGroup RelGroup; |
---|
| 56 | |
---|
| 57 | /// Constructeurs /// |
---|
| 58 | CCouplerOut(void); |
---|
| 59 | explicit CCouplerOut(const StdString& id); |
---|
| 60 | CCouplerOut(const CCouplerOut& couplerOut); // Not implemented yet. |
---|
| 61 | CCouplerOut(const CCouplerOut* const couplerOut); // Not implemented yet. |
---|
| 62 | |
---|
| 63 | /// Destructeur /// |
---|
| 64 | virtual ~CCouplerOut(void); |
---|
| 65 | |
---|
| 66 | public: |
---|
| 67 | /// Accesseurs /// |
---|
| 68 | CFieldGroup* getVirtualFieldGroup(void) const; |
---|
| 69 | std::vector<CField*> getAllFields(void) const; |
---|
| 70 | std::vector<CField* > getEnabledFields(void); |
---|
| 71 | |
---|
| 72 | StdString dumpClassAttributes(void); |
---|
| 73 | |
---|
| 74 | public : |
---|
| 75 | void setVirtualFieldGroup(CFieldGroup* newVFieldGroup); |
---|
| 76 | |
---|
| 77 | // Add component into coupler |
---|
| 78 | CField* addField(const string& id = ""); |
---|
| 79 | CFieldGroup* addFieldGroup(const string& id = ""); |
---|
| 80 | |
---|
| 81 | public: |
---|
| 82 | /// Accesseurs statiques /// |
---|
| 83 | static StdString GetName(void); |
---|
| 84 | static StdString GetDefName(void); |
---|
| 85 | static ENodeType GetType(void); |
---|
| 86 | public: |
---|
| 87 | /// Traitements /// |
---|
| 88 | virtual void parse(xml::CXMLNode& node); |
---|
| 89 | // virtual StdString toString(void) const; |
---|
| 90 | |
---|
| 91 | public: |
---|
[1784] | 92 | virtual void solveDescInheritance(bool apply, const CAttributeMap* const parent = 0); |
---|
| 93 | void solveFieldRefInheritance(bool apply); |
---|
| 94 | void createInterCommunicator(void) ; |
---|
| 95 | void checkGridOfEnabledFields(void) ; |
---|
[1875] | 96 | void assignContext(void) ; |
---|
| 97 | private: |
---|
| 98 | // the contextClient associated to the context Id attribute |
---|
| 99 | CContextClient* client_=nullptr ; |
---|
| 100 | public: |
---|
| 101 | CContextClient* getContextClient(void) {return client_; } |
---|
| 102 | |
---|
| 103 | private: |
---|
| 104 | string couplingContextId_ ; |
---|
| 105 | public: |
---|
| 106 | const string& getCouplingContextId(void) ; |
---|
| 107 | private: |
---|
[1782] | 108 | CFieldGroup* virtualFieldGroup; |
---|
| 109 | |
---|
| 110 | // std::shared_ptr<CDataOutput> data_out; |
---|
| 111 | // std::shared_ptr<CDataInput> data_in; |
---|
| 112 | std::vector<CField*> enabledFields; |
---|
| 113 | |
---|
| 114 | |
---|
| 115 | public: |
---|
| 116 | |
---|
| 117 | }; // class CCouplerOut |
---|
| 118 | |
---|
| 119 | ///-------------------------------------------------------------- |
---|
| 120 | |
---|
| 121 | // Declare/Define CFileGroup and CFileDefinition |
---|
| 122 | DECLARE_GROUP(CCouplerOut); |
---|
| 123 | |
---|
| 124 | ///-------------------------------------------------------------- |
---|
| 125 | |
---|
| 126 | } // namespace xios |
---|
| 127 | |
---|
[1875] | 128 | #endif // __XIOS_CCouplingIn__2 |
---|