本文整理汇总了C++中LLTimer::getStarted方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTimer::getStarted方法的具体用法?C++ LLTimer::getStarted怎么用?C++ LLTimer::getStarted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTimer
的用法示例。
在下文中一共展示了LLTimer::getStarted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onMainLoop
bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event)
{
if(mTimer.getStarted() && mTimer.hasExpired())
{
stopTimer();
// Check for failed install.
if(LLFile::isfile(ll_install_failed_marker_path()))
{
int requiredValue = 0;
{
llifstream stream(ll_install_failed_marker_path());
stream >> requiredValue;
if(stream.fail()) requiredValue = 0;
}
// TODO: notify the user.
llinfos << "found marker " << ll_install_failed_marker_path() << llendl;
llinfos << "last install attempt failed" << llendl;
LLFile::remove(ll_install_failed_marker_path());
LLSD event;
event["type"] = LLSD(LLUpdaterService::INSTALL_ERROR);
event["required"] = LLSD(requiredValue);
LLEventPumps::instance().obtain(LLUpdaterService::pumpName()).post(event);
setState(LLUpdaterService::TERMINAL);
}
else
{
示例2: onMainLoop
bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event)
{
if(mTimer.getStarted() && mTimer.hasExpired())
{
stopTimer();
// Check for failed install.
if(LLFile::isfile(ll_install_failed_marker_path()))
{
LL_DEBUGS("UpdaterService") << "found marker " << ll_install_failed_marker_path() << LL_ENDL;
int requiredValue = 0;
{
llifstream stream(ll_install_failed_marker_path().c_str());
stream >> requiredValue;
if(stream.fail())
{
requiredValue = 0;
}
}
// TODO: notify the user.
LL_WARNS("UpdaterService") << "last install attempt failed" << LL_ENDL;;
LLFile::remove(ll_install_failed_marker_path());
LLSD event;
event["type"] = LLSD(LLUpdaterService::INSTALL_ERROR);
event["required"] = LLSD(requiredValue);
LLEventPumps::instance().obtain(LLUpdaterService::pumpName()).post(event);
setState(LLUpdaterService::TERMINAL);
}
//<FS:TM> 3.6.4 check this, commented out to compile
//else
//{
// std::string query_url = LLGridManager::getInstance()->getUpdateServiceURL();
// if ( !query_url.empty() )
// {
// mUpdateChecker.checkVersion(query_url, mChannel, mVersion,
// mPlatform, mPlatformVersion, mUniqueId,
// mWillingToTest);
// setState(LLUpdaterService::CHECKING_FOR_UPDATE);
// }
// else
// {
// LL_WARNS("UpdaterService")
// << "No updater service defined for grid '" << LLGridManager::getInstance()->getGrid()
// << "' will check again in " << mCheckPeriod << " seconds"
// << LL_ENDL;
// // Because the grid can be changed after the viewer is started (when the first check takes place)
// // but before the user logs in, the next check may be on a different grid, so set the retry timer
// // even though this check did not happen. The default time is once an hour, and if we're not
// // doing the check anyway the performance impact is completely insignificant.
// restartTimer(mCheckPeriod);
// }
//}
}