FileMonitorPtr FileMonitor::Create(){
	if (sMonitor.expired()){
		FileMonitorPtr p(new FileMonitor, [](FileMonitor* obj){ delete obj; });
		sMonitor = p;
		return p;
	}
	return sMonitor.lock();
}
示例#2
0
bool FileMonitor::HasInstance(){
	return !sMonitor.expired();
}
示例#3
0
FileMonitor& FileMonitor::GetInstance(){
	if (sMonitor.expired()){
		Logger::Log(FB_ERROR_LOG_ARG, "FileMonitor is deleted. Program will crash...");
	}
	return *sMonitorRaw;
}