#ifndef __XIOS_GENERATE_INTERFACE_IMPL_HPP__ #define __XIOS_GENERATE_INTERFACE_IMPL_HPP__ #include "xmlioserver_spl.hpp" #include "generate_interface.hpp" #include "type_util.hpp" #include "indent.hpp" #include "array.hpp" namespace xios { template<> string CInterface::getStrFortranType(void) {return string("INTEGER") ;} template<> string CInterface::getStrFortranType(void) {return string("LOGICAL") ;} template<> string CInterface::getStrFortranType(void) {return string("REAL") ;} template<> string CInterface::getStrFortranType(void) {return string("REAL") ;} template<> string CInterface::getStrFortranKind(void) {return string("") ;} template<> string CInterface::getStrFortranKind(void) {return string("") ;} template<> string CInterface::getStrFortranKind(void) {return string("(KIND=8)") ;} template<> string CInterface::getStrFortranKind(void) {return string("(KIND=4)") ;} template<> string CInterface::getStrFortranKindC(void) {return string("(KIND=C_INT)") ;} template<> string CInterface::getStrFortranKindC(void) {return string("(KIND=C_BOOL)") ;} template<> string CInterface::getStrFortranKindC(void) {return string("(KIND=C_DOUBLE)") ;} template<> string CInterface::getStrFortranKindC(void) {return string("(KIND=C_FLOAT)") ;} template<> bool CInterface::matchingTypeCFortran(void) { return true ; } template<> bool CInterface::matchingTypeCFortran(void) { return false ;} template<> bool CInterface::matchingTypeCFortran(void) { return true; } template<> bool CInterface::matchingTypeCFortran(void) { return true; } // ///////////////////////////////////////////////// // // C Interface // // ///////////////////////////////////////////////// template void CInterface::AttributeCInterface(ostream& oss, const string& className,const string& name) { string typeName=getStrType() ; oss<<"void cxios_set_"<"<sendAttributToServer("<"<"< void CInterface::AttributeCInterface(ostream& oss, const string& className,const string& name) { oss<<"void cxios_set_"<"<sendAttributToServer("<"<"<mask.getValue(), mask, extent1, extent2)) // ERROR("cxios_get_domain_mask(XDomainPtr domain_hdl, bool * mask, int extent1, int extent2)",<<"Output array size is not conform to array size attribut") ; #define macro(T) \ template <>\ void CInterface::AttributeCInterface(ostream& oss, const string& className,const string& name)\ {\ string typeName=getStrType() ;\ \ oss<<"void cxios_set_"<(boost::extents[extent1]));"<num_elements()]), array_tmp->data());"<"<sendAttributToServer("<"<"< \ void CInterface::AttributeCInterface(ostream& oss, const string& className,const string& name)\ {\ string typeName=getStrType() ;\ \ oss<<"void cxios_set_"<(boost::extents[extent1][extent2]));"<num_elements()]), array_tmp->data());"<"<sendAttributToServer("<"<"<\ void CInterface::AttributeCInterface(ostream& oss, const string& className,const string& name)\ {\ string typeName=getStrType() ;\ \ oss<<"void cxios_set_"<(boost::extents[extent1][extent2][extent3]));"<num_elements()]), array_tmp->data());"<"<sendAttributToServer("<"<"< void CInterface::AttributeFortran2003Interface(ostream& oss,const string& className,const string& name) { string fortranType=getStrFortranType() ; string fortranKindC=getStrFortranKindC() ; oss<<"SUBROUTINE cxios_set_"< void CInterface::AttributeFortran2003Interface(ostream& oss,const string& className,const string& name) { oss<<"SUBROUTINE cxios_set_"<\ void CInterface::AttributeFortran2003Interface(ostream& oss,const string& className,const string& name) \ { \ string fortranType=getStrFortranType() ; \ string fortranKindC=getStrFortranKindC() ; \ \ oss<<"SUBROUTINE cxios_set_"< \ void CInterface::AttributeFortran2003Interface(ostream& oss,const string& className,const string& name) \ { \ string fortranType=getStrFortranType() ; \ string fortranKindC=getStrFortranKindC() ; \ \ oss<<"SUBROUTINE cxios_set_"< \ void CInterface::AttributeFortran2003Interface(ostream& oss,const string& className,const string& name) \ { \ string fortranType=getStrFortranType() ; \ string fortranKindC=getStrFortranKindC() ; \ \ oss<<"SUBROUTINE cxios_set_"< void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss,const string& className,const string& name) { oss<()<<" "<< getStrFortranKind() <<" , OPTIONAL, INTENT(IN) :: "<()) oss<()<<" "<()<<" :: "< void CInterface::AttributeFortranInterfaceGetDeclaration(ostream& oss,const string& className,const string& name) { oss<()<<" "<< getStrFortranKind() <<" , OPTIONAL, INTENT(OUT) :: "<()) oss<()<<" "<()<<" :: "< void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss,const string& className,const string& name) { oss<<"CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: "< void CInterface::AttributeFortranInterfaceGetDeclaration(ostream& oss,const string& className,const string& name) { oss<<"CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: "< \ void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss,const string& className,const string& name) \ { \ oss<()<<" "<() <<" , OPTIONAL, INTENT(IN) :: "<()) oss<()<<" "<() <<" , ALLOCATABLE :: "< \ void CInterface::AttributeFortranInterfaceGetDeclaration(ostream& oss,const string& className,const string& name) \ { \ oss<()<<" "<() <<" , OPTIONAL, INTENT(OUT) :: "<()) oss<()<<" "<() <<" , ALLOCATABLE :: "< \ void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss,const string& className,const string& name) \ { \ oss<()<<" "<() <<" , OPTIONAL, INTENT(IN) :: "<()) oss<()<<" "<() <<" , ALLOCATABLE :: "< \ void CInterface::AttributeFortranInterfaceGetDeclaration(ostream& oss,const string& className,const string& name) \ { \ oss<()<<" "<() <<" , OPTIONAL, INTENT(OUT) :: "<()) oss<()<<" "<() <<" , ALLOCATABLE :: "< \ void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss,const string& className,const string& name) \ { \ oss<()<<" "<() <<" , OPTIONAL, INTENT(IN) :: "<()) oss<()<<" "<() <<" , ALLOCATABLE :: "< \ void CInterface::AttributeFortranInterfaceGetDeclaration(ostream& oss,const string& className,const string& name) \ { \ oss<()<<" "<() <<" , OPTIONAL, INTENT(OUT) :: "<()) oss<()<<" "<() <<" , ALLOCATABLE :: "< void CInterface::AttributeFortranInterfaceBody(ostream& oss,const string& className,const string& name) { string name_tmp=name+"__tmp" ; oss<<"IF (PRESENT("<()) { oss<<" "< void CInterface::AttributeFortranInterfaceGetBody(ostream& oss,const string& className,const string& name) { string name_tmp=name+"__tmp" ; oss<<"IF (PRESENT("<()) { oss<<" CALL cxios_get_"< void CInterface::AttributeFortranInterfaceBody(ostream& oss,const string& className,const string& name) { oss<<"IF (PRESENT("< void CInterface::AttributeFortranInterfaceGetBody(ostream& oss,const string& className,const string& name) { oss<<"IF (PRESENT("< \ void CInterface::AttributeFortranInterfaceBody< ARRAY(T,1) >(ostream& oss,const string& className,const string& name) \ { \ string name_tmp=name+"__tmp" ; \ \ oss<<"IF (PRESENT("<()) \ { \ oss<<" ALLOCATE("< \ void CInterface::AttributeFortranInterfaceBody< ARRAY(T,2) >(ostream& oss,const string& className,const string& name) \ { \ string name_tmp=name+"__tmp" ; \ \ oss<<"IF (PRESENT("<()) \ { \ oss<<" ALLOCATE("< \ void CInterface::AttributeFortranInterfaceBody< ARRAY(T,3) >(ostream& oss,const string& className,const string& name) \ { \ string name_tmp=name+"__tmp" ; \ \ oss<<"IF (PRESENT("<()) \ { \ oss<<" ALLOCATE("< \ void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,1) >(ostream& oss,const string& className,const string& name) \ { \ string name_tmp=name+"__tmp" ; \ \ oss<<"IF (PRESENT("<()) \ { \ oss<<" ALLOCATE("< \ void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,2) >(ostream& oss,const string& className,const string& name) \ { \ string name_tmp=name+"__tmp" ; \ \ oss<<"IF (PRESENT("<()) \ { \ oss<<" ALLOCATE("< \ void CInterface::AttributeFortranInterfaceGetBody< ARRAY(T,3) >(ostream& oss,const string& className,const string& name) \ { \ string name_tmp=name+"__tmp" ; \ \ oss<<"IF (PRESENT("<()) \ { \ oss<<" ALLOCATE("<