| 1 | #ifndef __XIOS_GENERATE_INTERFACE_HPP__ |
|---|
| 2 | #define __XIOS_GENERATE_INTERFACE_HPP__ |
|---|
| 3 | |
|---|
| 4 | #include "xmlioserver_spl.hpp" |
|---|
| 5 | |
|---|
| 6 | namespace xios |
|---|
| 7 | { |
|---|
| 8 | class CInterface |
|---|
| 9 | { |
|---|
| 10 | public: |
|---|
| 11 | |
|---|
| 12 | template <class T> |
|---|
| 13 | static void AttributeCInterface(ostream& oss,const string& className,const string& name) ; |
|---|
| 14 | static void AttributeIsDefinedCInterface(ostream& oss, const string& className,const string& name); |
|---|
| 15 | |
|---|
| 16 | template <class T> |
|---|
| 17 | static void AttributeFortran2003Interface(ostream& oss,const string& className,const string& name) ; |
|---|
| 18 | static void AttributeIsDefinedFortran2003Interface(ostream& oss,const string& className,const string& name); |
|---|
| 19 | |
|---|
| 20 | template <class T> |
|---|
| 21 | static void AttributeFortranInterfaceDeclaration(ostream& oss,const string& className,const string& name) ; |
|---|
| 22 | |
|---|
| 23 | template <class T> |
|---|
| 24 | static void AttributeFortranInterfaceGetDeclaration(ostream& oss,const string& className,const string& name) ; |
|---|
| 25 | |
|---|
| 26 | static void AttributeFortranInterfaceIsDefinedDeclaration(ostream& oss,const string& className,const string& name) ; |
|---|
| 27 | |
|---|
| 28 | template <class T> |
|---|
| 29 | static void AttributeFortranInterfaceBody(ostream& oss,const string& className,const string& name) ; |
|---|
| 30 | |
|---|
| 31 | template <class T> |
|---|
| 32 | static void AttributeFortranInterfaceGetBody(ostream& oss,const string& className,const string& name) ; |
|---|
| 33 | |
|---|
| 34 | static void AttributeFortranInterfaceIsDefinedBody(ostream& oss,const string& className,const string& name) ; |
|---|
| 35 | |
|---|
| 36 | template <class T> |
|---|
| 37 | static string getStrFortranType(void) ; |
|---|
| 38 | |
|---|
| 39 | template <class T> |
|---|
| 40 | static string getStrFortranKind(void) ; |
|---|
| 41 | |
|---|
| 42 | template <class T> |
|---|
| 43 | static string getStrFortranKindC(void) ; |
|---|
| 44 | |
|---|
| 45 | template <class T> |
|---|
| 46 | static bool matchingTypeCFortran(void) ; |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | }; |
|---|
| 50 | /* |
|---|
| 51 | template<> string CInterface::getStrFortranType<int>(void) {return string("INTEGER") ;} |
|---|
| 52 | template<> string CInterface::getStrFortranType<bool>(void) {return string("LOGICAL") ;} |
|---|
| 53 | template<> string CInterface::getStrFortranType<double>(void) {return string("REAL") ;} |
|---|
| 54 | template<> string CInterface::getStrFortranType<float>(void) {return string("REAL") ;} |
|---|
| 55 | |
|---|
| 56 | template<> string CInterface::getStrFortranKind<int>(void) {return string("") ;} |
|---|
| 57 | template<> string CInterface::getStrFortranKind<bool>(void) {return string("") ;} |
|---|
| 58 | template<> string CInterface::getStrFortranKind<double>(void) {return string("(KIND=8)") ;} |
|---|
| 59 | template<> string CInterface::getStrFortranKind<float>(void) {return string("(KIND=4)") ;} |
|---|
| 60 | |
|---|
| 61 | template<> string CInterface::getStrFortranKindC<int>(void) {return string("(KIND=C_INT)") ;} |
|---|
| 62 | template<> string CInterface::getStrFortranKindC<bool>(void) {return string("(KIND=C_BOOL)") ;} |
|---|
| 63 | template<> string CInterface::getStrFortranKindC<double>(void) {return string("(KIND=C_DOUBLE)") ;} |
|---|
| 64 | template<> string CInterface::getStrFortranKindC<float>(void) {return string("(KIND=C_FLOAT)") ;} |
|---|
| 65 | |
|---|
| 66 | template<> bool CInterface::matchingTypeCFortran<int>(void) { return true ; } |
|---|
| 67 | template<> bool CInterface::matchingTypeCFortran<bool>(void) { return false ;} |
|---|
| 68 | template<> bool CInterface::matchingTypeCFortran<double>(void) { return true; } |
|---|
| 69 | template<> bool CInterface::matchingTypeCFortran<float>(void) { return true; } |
|---|
| 70 | */ |
|---|
| 71 | } |
|---|
| 72 | #endif |
|---|