while(true) { \
OksXmlAttribute attr(read_params.s); \
if(oks::cmp_str1(attr.name(), ">") || oks::cmp_str1(attr.name(), "/")) { break; } \
else if(F1(attr.name(), S1)) { \
std::shared_lock lock(read_params.oks_kernel->p_schema_mutex); \
c = read_params.oks_kernel->find_class(attr.value()); \
if( __builtin_expect((c == nullptr), 0) ) { \
std::ostringstream text; \
text << "cannot find class \"" << attr.value() << "\" (line " \
<< read_params.s.get_line_no() << ", char " \
<< read_params.s.get_line_pos() << ')'; \
throw std::runtime_error( text.str().c_str() ); \
} \
} \
else if(F2(attr.name(), S2)) id.assign(attr.value(), attr.value_len()); \
else { \
read_params.s.throw_unexpected_attribute(attr.name()); \
} \
}
332#define READ_OBJ_HEADER(F1, S1, F2, S2) \
333 while(true) { \
334 OksXmlAttribute attr(read_params.s); \
335 if(oks::cmp_str1(attr.name(), ">") || oks::cmp_str1(attr.name(), "/")) { break; } \
336 else if(F1(attr.name(), S1)) { \
337 std::shared_lock lock(read_params.oks_kernel->p_schema_mutex); \
338 c = read_params.oks_kernel->find_class(attr.value()); \
339 if( __builtin_expect((c == nullptr), 0) ) { \
340 std::ostringstream text; \
341 text << "cannot find class \"" << attr.value() << "\" (line " \
342 << read_params.s.get_line_no() << ", char " \
343 << read_params.s.get_line_pos() << ')'; \
344 throw std::runtime_error( text.str().c_str() ); \
345 } \
346 } \
347 else if(F2(attr.name(), S2)) id.assign(attr.value(), attr.value_len()); \
348 else { \
349 read_params.s.throw_unexpected_attribute(attr.name()); \
350 } \
351 }