当前位置: 首页>>代码示例>>C++>>正文


C++ NotifyObservers函数代码示例

本文整理汇总了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() );
}
开发者ID:StrongZhu,项目名称:amule,代码行数:26,代码来源:DownloadQueue.cpp

示例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");
}
开发者ID:kuailexs,项目名称:symbiandump-os2,代码行数:31,代码来源:LogServBackupManager.cpp

示例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);
	}

}
开发者ID:Crant,项目名称:Game_Project,代码行数:25,代码来源:Actor.cpp

示例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();
}
开发者ID:krzysztof-jelski,项目名称:stereo-gaze-tracker,代码行数:27,代码来源:Parameter.cpp

示例5: NotifyObservers

Parameter::~Parameter(void)
{
    m_Destroyed = true;
    NotifyObservers();
    if (m_pSizeData != NULL)
        m_pSizeData->RemoveObserver(this);
}
开发者ID:krzysztof-jelski,项目名称:stereo-gaze-tracker,代码行数:7,代码来源:Parameter.cpp

示例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();
  }
}
开发者ID:Strongc,项目名称:DC_source,代码行数:15,代码来源:AlarmConfig.cpp

示例7: NotifyObservers

bool
CUDPChannel::DoNotifyObservers( const CORE::CEvent& eventid               ,
                                CORE::CICloneable* eventData /* = NULL */ )
{GUCEF_TRACE;
    
    return NotifyObservers( eventid   ,
                            eventData );
}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:8,代码来源:CUDPChannel.cpp

示例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 );
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:8,代码来源:CItemSlot.cpp

示例9: Hide

bool
CFileSystemDialogImp::OnCancelButtonClick( const CEGUI::EventArgs& e )
{GUCE_TRACE;

    Hide();
    NotifyObservers( CancelPressedEvent );
    return true;
}
开发者ID:LiberatorUSA,项目名称:GUCE,代码行数:8,代码来源:guceCEGUIOgre_CFileSystemDialogImp.cpp

示例10: IsSnapAvailable

// -----------------------------------------------------------------------------
// CSipSnapAvailabilityMonitor::RunL
// -----------------------------------------------------------------------------
//
void CSipSnapAvailabilityMonitor::RunL()
{
    if ( iStatus == KErrNone )
    {
        iSnapAvailable = IsSnapAvailable( iSnapInfoBuf(), iSnapId );
        NotifyObservers();
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:12,代码来源:sipsnapavailabilitymonitor.cpp

示例11: NotifyObservers

void HourDataPoint::Update(Subject* pSubject)
{
  I32 value = ActTime::GetInstance()->GetTime(HOURS);
  if (mValue != value)
  {
    mValue = value;
    NotifyObservers();
  }
}
开发者ID:Strongc,项目名称:DC_source,代码行数:9,代码来源:TimeDatapoint.cpp

示例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);
  }
}
开发者ID:AFFLUENTSOCIETY,项目名称:SPMC,代码行数:9,代码来源:AddonManager.cpp

示例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 );
}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:9,代码来源:guceMyGUI_CButtonImp.cpp

示例14: NotifyObservers

void
CTSGNotifier::OnPumpedNotify( CNotifier* notifier                 ,
                              const CEvent& eventid               ,
                              CICloneable* eventdata /* = NULL */ )
{GUCEF_TRACE;

    NotifyObservers( eventid   ,
                     eventdata );
}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:9,代码来源:CTSGNotifier.cpp

示例15: NotifyObservers

Model::Model()
{
	isGameOver = false;
	isGameWin = false;
	secondsPassed = 0;
	minutesPassed = 0;
	mtable = ntable = 0;
	NotifyObservers(Change::TIME);
}
开发者ID:AlexCracanel,项目名称:MVC-Minesweeper,代码行数:9,代码来源:Model.cpp


注:本文中的NotifyObservers函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。