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

Method check_member

dds/DCPS/XTypes/DynamicDataBase.cpp:199–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199DDS::ReturnCode_t DynamicDataBase::check_member(
200 DDS::MemberDescriptor_var& md, DDS::DynamicType_var& type,
201 const char* method, const char* action, DDS::MemberId id, DDS::TypeKind tk)
202{
203 DDS::ReturnCode_t rc = DDS::RETCODE_OK;
204 switch (type_->get_kind()) {
205 case TK_STRING8:
206 case TK_STRING16:
207 case TK_SEQUENCE:
208 case TK_ARRAY:
209 case TK_MAP:
210 type = get_base_type(type_desc_->element_type());
211 break;
212 case TK_BITMASK:
213 case TK_STRUCTURE:
214 case TK_UNION:
215 rc = get_descriptor(md, id);
216 if (rc != DDS::RETCODE_OK) {
217 return rc;
218 }
219 type = get_base_type(md->type());
220 if (!type) {
221 return DDS::RETCODE_ERROR;
222 }
223 break;
224 default:
225 return DDS::RETCODE_BAD_PARAMETER;
226 }
227
228 const TypeKind type_kind = type->get_kind();
229 TypeKind cmp_type_kind = type_kind;
230 switch (type_kind) {
231 case TK_ENUM:
232 rc = enum_bound(type, cmp_type_kind);
233 if (rc != DDS::RETCODE_OK) {
234 return rc;
235 }
236 break;
237 case TK_BITMASK:
238 rc = bitmask_bound(type, cmp_type_kind);
239 if (rc != DDS::RETCODE_OK) {
240 return rc;
241 }
242 break;
243 }
244
245 bool invalid_tk = true;
246 if (is_basic(cmp_type_kind)) {
247 invalid_tk = cmp_type_kind != tk;
248 } else if (tk == TK_NONE) {
249 invalid_tk = !is_complex(type_kind);
250 }
251 if (invalid_tk) {
252 if (log_level >= LogLevel::Notice) {
253 const CORBA::String_var member_name = md->name();
254 const CORBA::String_var type_name = type_->get_name();
255 ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: %C: "
256 "trying to %C %C.%C id %u kind %C (%C) as an invalid kind %C\n",

Callers

nothing calls this directly

Calls 12

get_base_typeFunction · 0.85
enum_boundFunction · 0.85
bitmask_boundFunction · 0.85
is_basicFunction · 0.85
is_complexFunction · 0.85
typekind_to_stringFunction · 0.85
get_kindMethod · 0.80
element_typeMethod · 0.80
typeMethod · 0.45
nameMethod · 0.45
get_nameMethod · 0.45
inMethod · 0.45

Tested by

no test coverage detected