| 93 | } |
| 94 | |
| 95 | void debug_message_callback_impl( |
| 96 | McContext contextHandle, |
| 97 | pfn_mcDebugOutput_CALLBACK cb, |
| 98 | const McVoid* userParam) |
| 99 | { |
| 100 | MCUT_ASSERT(contextHandle != nullptr); |
| 101 | MCUT_ASSERT(cb != nullptr); |
| 102 | |
| 103 | std::shared_ptr<context_t> context_ptr = g_contexts.find_first_if([=](const std::shared_ptr<context_t> cptr) { return cptr->m_user_handle == contextHandle; }); |
| 104 | |
| 105 | // std::map<McContext, std::unique_ptr<context_t>>::iterator context_entry_iter = g_contexts.find(contextHandle); |
| 106 | |
| 107 | if (context_ptr == nullptr) { |
| 108 | // "contextHandle" may not be NULL but that does not mean it maps to |
| 109 | // a valid object in "g_contexts" |
| 110 | throw std::invalid_argument("invalid context"); |
| 111 | } |
| 112 | // const std::unique_ptr<context_t>& context_uptr = context_entry_iter->second; |
| 113 | |
| 114 | // set callback function ptr, and user pointer |
| 115 | context_ptr->set_debug_callback_data(cb, userParam); |
| 116 | } |
| 117 | |
| 118 | void get_debug_message_log_impl(McContext context, |
| 119 | McUint32 count, McSize bufSize, |
no test coverage detected