| 1070 | } |
| 1071 | |
| 1072 | DDS::ReturnCode_t enum_bound(DDS::DynamicType_ptr enum_type, DDS::TypeKind& bound_kind) |
| 1073 | { |
| 1074 | const DDS::TypeKind kind = enum_type->get_kind(); |
| 1075 | if (kind != TK_ENUM) { |
| 1076 | if (log_level >= LogLevel::Notice) { |
| 1077 | ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: enum_bound: " |
| 1078 | "expected enum, got %C\n", |
| 1079 | typekind_to_string(kind))); |
| 1080 | } |
| 1081 | return DDS::RETCODE_BAD_PARAMETER; |
| 1082 | } |
| 1083 | |
| 1084 | DDS::TypeDescriptor_var td; |
| 1085 | const DDS::ReturnCode_t rc = enum_type->get_descriptor(td); |
| 1086 | if (rc != DDS::RETCODE_OK) { |
| 1087 | return rc; |
| 1088 | } |
| 1089 | |
| 1090 | const size_t bound_size = td->bound()[0]; |
| 1091 | if (bound_size >= 1 && bound_size <= 8) { |
| 1092 | bound_kind = TK_INT8; |
| 1093 | } else if (bound_size >= 9 && bound_size <= 16) { |
| 1094 | bound_kind = TK_INT16; |
| 1095 | } else if (bound_size >= 17 && bound_size <= 32) { |
| 1096 | bound_kind = TK_INT32; |
| 1097 | } else { |
| 1098 | if (log_level >= LogLevel::Notice) { |
| 1099 | ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: enum_bound: " |
| 1100 | "Got unexpected bound size %B\n", |
| 1101 | bound_size)); |
| 1102 | } |
| 1103 | return DDS::RETCODE_BAD_PARAMETER; |
| 1104 | } |
| 1105 | return DDS::RETCODE_OK; |
| 1106 | } |
| 1107 | |
| 1108 | DDS::ReturnCode_t get_enum_value( |
| 1109 | DDS::Int32& value, DDS::DynamicType_ptr enum_type, DDS::DynamicData_ptr src, DDS::MemberId id) |
no test coverage detected