MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / writeUnionDefaultValue

Function writeUnionDefaultValue

java/idl2jni/codegen/im_java.cpp:839–885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837
838namespace {
839void writeUnionDefaultValue(ostream &os, AST_Expression::ExprType udisc_type,
840 const AST_Union::DefaultValue &dv)
841{
842 switch (udisc_type) {
843 case AST_Expression::EV_short:
844 os << dv.u.short_val;
845 break;
846 case AST_Expression::EV_ushort:
847 os << dv.u.ushort_val;
848 break;
849 case AST_Expression::EV_long:
850 os << dv.u.long_val;
851 break;
852 case AST_Expression::EV_ulong:
853 os << dv.u.ulong_val;
854 break;
855#if OPENDDS_HAS_EXPLICIT_INTS
856 case AST_Expression::EV_int8:
857 os << signed(dv.u.char_val);
858 break;
859 case AST_Expression::EV_uint8:
860 os << unsigned(dv.u.char_val);
861 break;
862#endif
863 case AST_Expression::EV_char:
864 os << dv.u.char_val;
865 break;
866 case AST_Expression::EV_wchar:
867 os << unicode_escape(dv.u.wchar_val);
868 break;
869 case AST_Expression::EV_bool:
870 os << boolalpha << static_cast<bool>(dv.u.bool_val);
871 break;
872 case AST_Expression::EV_enum:
873 os << dv.u.enum_val;
874 break;
875 case AST_Expression::EV_longlong:
876 os << dv.u.longlong_val;
877 break;
878 case AST_Expression::EV_ulonglong:
879 os << dv.u.ulonglong_val;
880 break;
881 default:
882 cerr << "ERROR - " << __FILE__ << ":" << __LINE__ << " - Bad discriminant type '" << udisc_type << "' (shouldn't happen here)\n";
883 BE_abort();
884 }
885}
886}
887
888bool idl_mapping_java::gen_union(UTL_ScopedName *name,

Callers 1

gen_unionMethod · 0.85

Calls 2

unicode_escapeFunction · 0.85
BE_abortFunction · 0.70

Tested by

no test coverage detected