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

Method gen_const

java/idl2jni/codegen/im_java.cpp:499–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497} // namespace
498
499bool idl_mapping_java::gen_const(UTL_ScopedName *name, bool nestedInInteface,
500 AST_Expression::ExprType type, AST_Expression::AST_ExprValue *ev)
501{
502 //Constants within interfaces have an alternate mapping, which we are not
503 //going to implement at this time.
504 if (nestedInInteface) {
505 cerr << "ERROR - Constants within Interfaces are not supported\n";
506 return false;
507 }
508
509 string type_str;
510
511 switch (type) {
512 case AST_Expression::EV_short:
513 case AST_Expression::EV_ushort:
514 type_str = "short";
515 break;
516 case AST_Expression::EV_long:
517 case AST_Expression::EV_ulong:
518 type_str = "int";
519 break;
520 case AST_Expression::EV_longlong:
521 case AST_Expression::EV_ulonglong:
522 type_str = "long";
523 break;
524 case AST_Expression::EV_float:
525 type_str = "float";
526 break;
527 case AST_Expression::EV_double:
528 type_str = "double";
529 break;
530 case AST_Expression::EV_char:
531 case AST_Expression::EV_wchar:
532 type_str = "char";
533 break;
534#if OPENDDS_HAS_EXPLICIT_INTS
535 case AST_Expression::EV_int8:
536 case AST_Expression::EV_uint8:
537#endif
538 case AST_Expression::EV_octet:
539 type_str = "byte";
540 break;
541 case AST_Expression::EV_bool:
542 type_str = "boolean";
543 break;
544 case AST_Expression::EV_string:
545 case AST_Expression::EV_wstring:
546 type_str = "String";
547 break;
548 case AST_Expression::EV_longdouble:
549 case AST_Expression::EV_enum:
550 case AST_Expression::EV_any:
551 case AST_Expression::EV_object:
552 case AST_Expression::EV_void:
553 case AST_Expression::EV_none:
554 default: {
555 cerr << "ERROR - " << __FILE__ << ":" << __LINE__ << " - Constant of type " << ev->et
556 << " is not supported\n";

Callers 1

visit_constantMethod · 0.45

Calls 4

java_class_genFunction · 0.85
JavaNameClass · 0.85
BE_abortFunction · 0.70
strMethod · 0.45

Tested by

no test coverage detected