Example #1
0
 /*static*/ void header_type::register_header_signature(int32_t sig, network_header_format type)
 {
     auto it = s_fmt_map.find(sig);
     if (it != s_fmt_map.end())
     {
         if (it->second != type)
         {
             dassert(false, "signature %08x is already registerd for header type %s",
                 sig, type.to_string()
                 );
         }
     }
     else
     {
         s_fmt_map.emplace(sig, type);
     }
 }
Example #2
0
 std::pair<message_parser::factory2, size_t>  network::get_message_parser_info(network_header_format hdr_format)
 {
     auto& pinfo = message_parser_manager::instance().get(hdr_format);
     dassert(pinfo.factory2, "message parser '%s' not registerd or invalid!", hdr_format.to_string());
     return std::make_pair(pinfo.factory2, pinfo.parser_size);
 }