• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ NotifyObservers函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中NotifyObservers函数的典型用法代码示例。如果您正苦于以下问题:C++ NotifyObservers函数的具体用法?C++ NotifyObservers怎么用?C++ NotifyObservers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NotifyObservers函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: LogDebug

///////////////////////////////////////////////////////////////////////////////
// Function: int CResourceGroup::PrimOnMediaCommandResponse(const CSipCallInfoSptr &a_sipCallInfo)
//
// Description: Handle a MSML server response for a command
//
// Return: int - 0 on success, otherwise failure
//
// Parameters: const CSipCallInfoSptr &a_sipCallInfo
//
///////////////////////////////////////////////////////////////////////////////
int CResourceGroup::PrimOnMediaCommandResponse( const CSipCallInfoSptr& a_sipCallInfo)
{
   LogDebug("PrimOnMediaCommandResponse");

 // TODO:   There may be an HMP bug on Linux because the 200 OK message 
 //         in Ethereal has the correct data but the GC event doesnt.  
 //         Works OK on Windows.
 //         There is an INFO message for setting video attribs that
 //         arrives immediately after the 200 OK.


   CMsmlResponseSptr l_responseData( new CMsmlResponse( a_sipCallInfo->MimeData()));

 #ifdef _WIN32

//   std::string l_response = a_sipCallInfo->MimeData();
//   std::string l_responseCode;
//   const std::string l_responseCodeLabel = "result response=\"";
//   unsigned int l_seperatorPos = l_response.find(l_responseCodeLabel);
//   if ( l_seperatorPos != l_response.npos)
//   {
//      l_responseCode = l_response.substr( l_seperatorPos + l_responseCodeLabel.size(), 3);
//   }

   if ( l_responseData->ResponseCode() == "200")

#else

   if ( a_sipCallInfo->ResponseCode() == 200)

#endif
   {
      LogDebug("PrimOnMediaCommandResponse", "started");
      NotifyObservers( RESOURCEGROUP_MEDIA_COMMAND_COMPLETE, l_responseData);
   }
   else
   {
      LogDebug("PrimOnMediaCommandResponse", "failed");
      NotifyObservers( RESOURCEGROUP_MEDIA_COMMAND_FAILED, l_responseData);
      return -1;
   }

   return 0;
}
开发者ID:BNHale,项目名称:dialogic-msml,代码行数:54,代码来源:CResourceGroup.cpp


示例17: DeleteAll

void
URLSearchParams::ParseInput(const nsACString& aInput,
                            URLSearchParamsObserver* aObserver)
{
  // Remove all the existing data before parsing a new input.
  DeleteAll();

  nsACString::const_iterator start, end;
  aInput.BeginReading(start);
  aInput.EndReading(end);
  nsACString::const_iterator iter(start);

  while (start != end) {
    nsAutoCString string;

    if (FindCharInReadable('&', iter, end)) {
      string.Assign(Substring(start, iter));
      start = ++iter;
    } else {
      string.Assign(Substring(start, end));
      start = end;
    }

    if (string.IsEmpty()) {
      continue;
    }

    nsACString::const_iterator eqStart, eqEnd;
    string.BeginReading(eqStart);
    string.EndReading(eqEnd);
    nsACString::const_iterator eqIter(eqStart);

    nsAutoCString name;
    nsAutoCString value;

    if (FindCharInReadable('=', eqIter, eqEnd)) {
      name.Assign(Substring(eqStart, eqIter));

      ++eqIter;
      value.Assign(Substring(eqIter, eqEnd));
    } else {
      name.Assign(string);
    }

    nsAutoCString decodedName;
    DecodeString(name, decodedName);

    nsAutoCString decodedValue;
    DecodeString(value, decodedValue);

    AppendInternal(NS_ConvertUTF8toUTF16(decodedName),
                   NS_ConvertUTF8toUTF16(decodedValue));
  }

  NotifyObservers(aObserver);
}
开发者ID:adamroach,项目名称:gecko-dev,代码行数:56,代码来源:URLSearchParams.cpp


示例18: NotifyObservers

nsresult nsMsgRDFDataSource::NotifyPropertyChanged(nsIRDFResource *resource,
                                                   nsIRDFResource *propertyResource,
                                                   nsIRDFNode *newNode,
                                                   nsIRDFNode *oldNode /* = nullptr */)
{

  NotifyObservers(resource, propertyResource, newNode, oldNode, false, true);
  return NS_OK;

}
开发者ID:MoonchildProductions,项目名称:FossaMail,代码行数:10,代码来源:nsMsgRDFDataSource.cpp


示例19: while

//**************************
//Description : Function managing all input events
//Parameters : None
//Return Value : None
//Note : None
//**************************
void CEventManager::ManageEvents()
{
    while ( m_RenderWindow->GetEvent(m_CurrentEvent) )
    {
        if ( m_CurrentEvent.Type == sf::Event::Closed )
            m_RenderWindow->Close();

        NotifyObservers(m_CurrentEvent);
    }
}
开发者ID:flamester43,项目名称:creaconnect4,代码行数:16,代码来源:CEventManager.cpp


示例20: NotifyObservers

nsresult
nsMsgAccountManagerDataSource::OnItemBoolPropertyChanged(nsIRDFResource *aItem,
                                                         nsIAtom *aProperty,
                                                         PRBool aOldValue,
                                                         PRBool aNewValue)
{
  if (aProperty == kDefaultServerAtom)
    NotifyObservers(aItem, kNC_IsDefaultServer, kTrueLiteral, nsnull, aNewValue, PR_FALSE);
  return NS_OK;
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:10,代码来源:nsMsgAccountManagerDS.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NotifyStatusChanged函数代码示例发布时间:2022-05-30
下一篇:
C++ NotifyEventHooks函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap