Changeset 2120 for XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_template.hpp
- Timestamp:
- 03/30/21 17:11:36 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_template.hpp
r2118 r2120 12 12 #include "buffer_out.hpp" 13 13 #include "type.hpp" 14 #include "tv_data_display.h"15 16 #ifdef __GNUC__17 #include <typeinfo>18 #include <cxxabi.h>19 #endif20 14 21 15 namespace xios … … 97 91 // virtual void generateFortranInterfaceIsDefinedDeclaration(ostream& oss,const string& className) ; 98 92 99 static int show_TV_ttf_display_type ( const CAttributeTemplate<T>* attr)100 {101 int status ;102 if (attr->isEmpty())103 {104 status = TV_ttf_add_row("State", TV_ttf_type_ascii_string,"(empty)") ;105 if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ;106 else return TV_ttf_format_ok_elide ;107 }108 else109 {110 char tname[128] ;111 char bname[128] = "ValueType" ;112 #ifdef __GNUC__113 size_t size = sizeof(bname) ;114 abi::__cxa_demangle(typeid(T).name(), bname, &size, &status) ;115 if (status !=0) return TV_ttf_format_raw ;116 #endif117 snprintf (tname, sizeof(tname), "%s", bname);118 if (typeid(T)==typeid(string))119 status = TV_ttf_add_row("values", TV_ttf_type_ascii_string, ((string*)(attr->ptrValue))->c_str() );120 else status = TV_ttf_add_row("values", tname, attr->ptrValue) ;121 if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ;122 else return TV_ttf_format_ok_elide ;123 }124 }125 126 static int TV_ttf_display_type ( const CAttributeTemplate<T>* attr )127 {128 return show_TV_ttf_display_type (attr) ;129 }130 131 93 132 94 protected : … … 145 107 }; // class CAttribute 146 108 147 #define macrotype(_TYPE_)\148 template<> int CAttributeTemplate<_TYPE_>::TV_ttf_display_type( const CAttributeTemplate<_TYPE_>* attr );149 150 macrotype(double)151 macrotype(int)152 macrotype(bool)153 macrotype(string)154 //macrotype(CDate)155 //macrotype(CDuration)156 #undef macrotype157 109 158 110 template <class T> void FromBinary(StdIStream & is, T & obj);
Note: See TracChangeset
for help on using the changeset viewer.