本文整理汇总了C++中NotifyObservers函数的典型用法代码示例。如果您正苦于以下问题:C++ NotifyObservers函数的具体用法?C++ NotifyObservers怎么用?C++ NotifyObservers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NotifyObservers函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxCHECK_RET
void CDownloadQueue::AddDownload(CPartFile* file, bool paused, uint8 category)
{
wxCHECK_RET(!IsFileExisting(file->GetFileHash()), wxT("Adding duplicate part-file"));
if (file->GetStatus(true) == PS_ALLOCATING) {
file->PauseFile();
} else if (paused && GetFileCount()) {
file->StopFile();
}
{
wxMutexLocker lock(m_mutex);
m_filelist.push_back( file );
DoSortByPriority();
}
NotifyObservers( EventType( EventType::INSERTED, file ) );
if (category < theApp->glob_prefs->GetCatCount()) {
file->SetCategory(category);
} else {
AddDebugLogLineN( logDownloadQueue, wxT("Tried to add download into invalid category.") );
}
Notify_DownloadCtrlAddFile( file );
theApp->searchlist->UpdateSearchFileByHash(file->GetFileHash()); // Update file in the search dialog if it's still open
AddLogLineC(CFormat(_("Downloading %s")) % file->GetFileName() );
}
示例2: LOGTEXT2
void CLogServBackupManager::RunL()
//
// This method does two things
//
// 1) Keeps trying to create a backup object - which may fail on device
// bootup until the ui framework starts the backup server.
//
// 2) Handles the case where the server fails to restart correctly after a backup - it keeps trying
//
{
LOGTEXT2("CLogServBackupManager::RunL(%d)", iStatus.Int());
if (!iBackup)
{
LOGTEXT("CLogServBackupManager::RunL() - trying to create backup object");
// Keep trying to create backup object
iBackup = CreateBackupL(*iDatabaseName);
LOGTEXT("CLogServBackupManager::RunL() - backup object created okay");
}
else
{
// This branch is executed if we failed to create the backup object on our first
// attempt in BISetDatabaseNameL
LOGTEXT("CLogServBackupManager::RunL() - notifying observers about dummy backup ended event");
NotifyObservers(MLogServBackupObserver::EBackupEnded);
}
LOGTEXT("CLogServBackupManager::RunL() - end");
}
示例3: NotifyObservers
void Actor::SetPosition( const Vector3& pos, const bool notify /*= true*/ )
{
if(pos.x != pos.x || pos.y != pos.y || pos.z != pos.z)
{
throw "Invalid position";
}
this->zPreviousPos = this->zPos;
this->zPos = pos;
if (this->zPhysicsObject)
{
this->zPhysicsObject->SetPosition(pos);
}
if(notify)
{
ActorPositionEvent APE;
APE.zActor = this;
NotifyObservers(&APE);
}
}
示例4: switch
void LongParameter::UpdatePercRef()
{
if (m_pSizeData == NULL)
return;
switch (m_PercType)
{
case AREA:
m_PercRef = m_pSizeData->GetArea();
break;
case HEIGHT:
m_PercRef = m_pSizeData->GetHeight();
break;
case WIDTH:
m_PercRef = m_pSizeData->GetWidth();
break;
case COLOUR_RANGE:
m_PercRef = 255;
break;
default:
m_PercRef = -1;
}
if (IsPercentModification())
UpdateValueFromPercent();
else
UpdatePercentValue();
NotifyObservers();
}
示例5: NotifyObservers
Parameter::~Parameter(void)
{
m_Destroyed = true;
NotifyObservers();
if (m_pSizeData != NULL)
m_pSizeData->RemoveObserver(this);
}
示例6: NotifyObservers
/*****************************************************************************
* Function -
* DESCRIPTION:
* Update subscribers when the alarm limit or warning limit datapoint
* have been changed through the interface obtained by calls to
* GetAlarmLimit() and GetWarningLimit()
****************************************************************************/
void AlarmConfig::Update(Subject* pSubject)
{
if (!mLimitDatapointsChangedByAlarmConfig)
{
NotifyObservers();
NotifyObserversE();
}
}
示例7: NotifyObservers
bool
CUDPChannel::DoNotifyObservers( const CORE::CEvent& eventid ,
CORE::CICloneable* eventData /* = NULL */ )
{GUCEF_TRACE;
return NotifyObservers( eventid ,
eventData );
}
示例8: GetItem
void CItemSlot::ChangeItemStatus( int iInvenIdx )
{
m_pEvent->SetID( CTEventItem::EID_CHANGE_ITEM );
m_pEvent->SetIndex( iInvenIdx );
m_pEvent->SetItem( GetItem( iInvenIdx ) );
SetChanged();
NotifyObservers( m_pEvent );
}
示例9: Hide
bool
CFileSystemDialogImp::OnCancelButtonClick( const CEGUI::EventArgs& e )
{GUCE_TRACE;
Hide();
NotifyObservers( CancelPressedEvent );
return true;
}
示例10: IsSnapAvailable
// -----------------------------------------------------------------------------
// CSipSnapAvailabilityMonitor::RunL
// -----------------------------------------------------------------------------
//
void CSipSnapAvailabilityMonitor::RunL()
{
if ( iStatus == KErrNone )
{
iSnapAvailable = IsSnapAvailable( iSnapInfoBuf(), iSnapId );
NotifyObservers();
}
}
示例11: NotifyObservers
void HourDataPoint::Update(Subject* pSubject)
{
I32 value = ActTime::GetInstance()->GetTime(HOURS);
if (mValue != value)
{
mValue = value;
NotifyObservers();
}
}
示例12: SetChanged
void CAddonMgr::RemoveAddon(const CStdString& ID)
{
if (m_cpluff && m_cp_context)
{
m_cpluff->uninstall_plugin(m_cp_context,ID.c_str());
SetChanged();
NotifyObservers(ObservableMessageAddons);
}
}
示例13: GUCEF_USER_LOG
void
CButtonImp::OnMouseClick( MyGUI::Widget* sender )
{GUCEF_TRACE;
GUCEF_USER_LOG( GUCEF::CORE::LOGLEVEL_NORMAL, "MyGUIOgre: User clicked button \"" + GetName() + "\"" );
CWidgetImp< GUCEF::GUI::CButton >::OnMouseClick( sender );
NotifyObservers( ButtonClickedEvent );
}
示例14: NotifyObservers
void
CTSGNotifier::OnPumpedNotify( CNotifier* notifier ,
const CEvent& eventid ,
CICloneable* eventdata /* = NULL */ )
{GUCEF_TRACE;
NotifyObservers( eventid ,
eventdata );
}
示例15: NotifyObservers
Model::Model()
{
isGameOver = false;
isGameWin = false;
secondsPassed = 0;
minutesPassed = 0;
mtable = ntable = 0;
NotifyObservers(Change::TIME);
}