本文整理汇总了C++中CPVRDatabasePtr::Persist方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRDatabasePtr::Persist方法的具体用法?C++ CPVRDatabasePtr::Persist怎么用?C++ CPVRDatabasePtr::Persist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRDatabasePtr
的用法示例。
在下文中一共展示了CPVRDatabasePtr::Persist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Persist
bool CPVRChannelGroup::Persist(void)
{
bool bReturn(true);
const CPVRDatabasePtr database(g_PVRManager.GetTVDatabase());
CSingleLock lock(m_critSection);
/* only persist if the group has changes and is fully loaded or never has been saved before */
if (!HasChanges() || (!m_bLoaded && m_iGroupId != -1))
return bReturn;
// Mark newly created groups as loaded so future updates will also be persisted...
if (m_iGroupId == -1)
m_bLoaded = true;
if (database)
{
CLog::Log(LOGDEBUG, "CPVRChannelGroup - %s - persisting channel group '%s' with %d channels",
__FUNCTION__, GroupName().c_str(), (int) m_members.size());
m_bChanged = false;
lock.Leave();
bReturn = database->Persist(*this);
}
else
{
bReturn = false;
}
return bReturn;
}
示例2: Persist
bool CPVRChannel::Persist()
{
{
// not changed
CSingleLock lock(m_critSection);
if (!m_bChanged && m_iChannelId > 0)
return true;
}
const CPVRDatabasePtr database(g_PVRManager.GetTVDatabase());
if (database)
{
bool bReturn = database->Persist(*this) && database->CommitInsertQueries();
CSingleLock lock(m_critSection);
m_bChanged = !bReturn;
return bReturn;
}
return false;
}
示例3: Persist
bool CPVRChannel::Persist()
{
{
// not changed
CSingleLock lock(m_critSection);
if (!m_bChanged && m_iChannelId > 0)
return true;
}
const CPVRDatabasePtr database = CServiceBroker::GetPVRManager().GetTVDatabase();
if (database)
{
bool bReturn = database->Persist(*this, true);
CSingleLock lock(m_critSection);
m_bChanged = !bReturn;
return bReturn;
}
return false;
}