MCPcopy Create free account
hub / github.com/assimp/assimp / attachStream

Method attachStream

code/Common/DefaultLogger.cpp:315–340  ·  view source on GitHub ↗

---------------------------------------------------------------------------------- Will attach a new stream

Source from the content-addressed store, hash-verified

313// ----------------------------------------------------------------------------------
314// Will attach a new stream
315bool DefaultLogger::attachStream(LogStream *pStream, unsigned int severity) {
316 if (nullptr == pStream) {
317 return false;
318 }
319
320 if (0 == severity) {
321 severity = SeverityAll;
322 }
323
324#ifndef ASSIMP_BUILD_SINGLETHREADED
325 std::lock_guard<std::mutex> lock(m_arrayMutex);
326#endif
327
328 for (StreamIt it = m_StreamArray.begin();
329 it != m_StreamArray.end();
330 ++it) {
331 if ((*it)->m_pStream == pStream) {
332 (*it)->m_uiErrorSeverity |= severity;
333 return true;
334 }
335 }
336
337 m_StreamArray.push_back(new LogStreamInfo(severity, pStream));
338
339 return true;
340}
341
342// ----------------------------------------------------------------------------------
343// Detach a stream

Callers 4

_tWinMainFunction · 0.80
TEST_FFunction · 0.80
aiAttachLogStreamFunction · 0.80
createMethod · 0.80

Calls 3

beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected