27 lines
653 B
C++
27 lines
653 B
C++
#include "CameraHalMock.h"
|
|
#include "Log.h"
|
|
#include <thread>
|
|
void CameraHalMock::MockResponseThread(void)
|
|
{
|
|
auto responseThread = [](std::shared_ptr<CameraHalMock> camera)
|
|
{
|
|
camera->MockResponse();
|
|
};
|
|
std::thread pThread(responseThread, shared_from_this());
|
|
pThread.detach();
|
|
}
|
|
void CameraHalMock::MockResponse(void)
|
|
{
|
|
LogInfo("CameraHalMock::MockResponse.\n");
|
|
auto owner = mOwner.lock();
|
|
if (!owner)
|
|
{
|
|
LogWarning("Owner is nullptr.\n");
|
|
return;
|
|
}
|
|
if (mOwner.expired())
|
|
{
|
|
LogWarning("Owner shared ptr expired failed.\n");
|
|
return;
|
|
}
|
|
} |