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