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


C++ Restart函数代码示例

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


在下文中一共展示了Restart函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

HRESULT CScnWait::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled )
{
	switch(pTimer->nId) {
		case TM_DELETE:
			if(FileOperationManager::getInstance().isDone()) {
				// File Operation is complete
				KillTimer(TM_DELETE);

				if(waitReboot)
					Restart();
				else
					NavigateBack(XUSER_INDEX_ANY);

				bHandled = TRUE;
			}
			break;
		case TM_TIMEOUT:
			if(RemovePathCallBack::getInstance().getDone()) {
				// File Operation is complete
				KillTimer(TM_DELETE);

				if(waitReboot)
					Restart();
				else
					NavigateBack(XUSER_INDEX_ANY);

				bHandled = TRUE;
			}
			break;
	};

    return S_OK;
}
开发者ID:DeezNuts12,项目名称:freestyledash,代码行数:33,代码来源:ScnWait.cpp

示例2: Handle_Home

void Handle_Home(int disable_screenshot)
{
	if (CFG.home == CFG_HOME_EXIT) {
		Con_Clear();
		printf("\n");
		printf_("Exiting...");
		__console_flush(0);
		Sys_Exit();
	} else if (CFG.home == CFG_HOME_SCRSHOT) {
		__console_flush(0);
		Make_ScreenShot();
		if (disable_screenshot)	CFG.home = CFG_HOME_EXIT;
	} else if (CFG.home == CFG_HOME_HBC) {
		Con_Clear();
		printf("\n");
		printf_("HBC...");
		__console_flush(0);
		Sys_HBC();
	} else if (CFG.home == CFG_HOME_REBOOT) { 
		Con_Clear();
		Restart();
	} else {
		// Priiloader magic words, and channels
		if ((CFG.home & 0xFF) < 'a') {
			// upper case final letter implies channel
			Con_Clear();
			Sys_Channel(CFG.home);
		} else {
			// lower case final letter implies magic word
			Con_Clear();
			*(vu32*)0x8132FFFB = CFG.home;
			Restart();
		}
	}
}
开发者ID:smurk-too,项目名称:wodebrew,代码行数:35,代码来源:menu.c

示例3: lock

void CClient::TimeRoutine(int now)
{
	CLock lock(&m_criticalSection);
	switch (m_status)
	{
	case NETSTATUS_CompletionNotify:
		{
			if (m_lastActionTime)
			{
				if (now-m_lastActionTime > MAX_IDLE_TIME)
				{
					LOG("Client[%d] has been idled for a long time.", GetID());
					Restart(NETOP_Receive);
				}
			}
			else
			{
				DWORD connectTime = 0;
				int optSize = sizeof(connectTime);
				if (getsockopt(m_socket, SOL_SOCKET, SO_CONNECT_TIME, (char*)&connectTime, &optSize) == SOCKET_ERROR)
				{
					LOGNET("Client[%d] fail to get socket connection time.", GetID());
				}
				else
				{
					if (connectTime!=0xFFFFFFFF && connectTime>DENIAL_SERVICE_TIME)
					{
						LOG("Client[%d] may be a malicious application.", GetID());
						Restart(NETOP_Receive);
					}
				}
			}
		}
		break;
	case NETSTATUS_Disconnecting:
		{
			if (m_lastActionTime)
			{
				if (now-m_lastActionTime > MAX_DISCONNECT_TIME)
				{
					LOG("Client[%d] has been in disconnecting for a long time.", GetID());
					Restart(NETOP_Disconnect);
				}
			}
			else
			{
				LOG("Client[%d] has been in disconnecting, but last action time is zero.", GetID());
			}
		}
		break;
	default:
		break;
	}
}
开发者ID:linse073,项目名称:BaseLib,代码行数:54,代码来源:Client.cpp

示例4: Restart

NS_IMETHODIMP sbSeekableChannel::SetPos(
    PRUint64                    pos)
{
    DataSet::iterator           dataSetIterator;
    Segment                     findSegment;
    nsresult                    result = NS_OK;

    /* Check if channel is restarting. */
    if (mRestarting)
        result = NS_ERROR_SONGBIRD_SEEKABLE_CHANNEL_RESTART;

    /* Find a segment containing the new position. */
    if (NS_SUCCEEDED(result) && (pos < mContentLength))
    {
        findSegment.offset = pos;
        findSegment.length = 0;
        dataSetIterator = mChannelData.find(&findSegment);
        if (dataSetIterator == mChannelData.end())
            result = NS_ERROR_SONGBIRD_SEEKABLE_CHANNEL_RESTART;
    }

    /* Restart channel if needed. */
    if (!mRestarting && (result == NS_ERROR_SONGBIRD_SEEKABLE_CHANNEL_RESTART))
        Restart(pos);

    /* Set the channel position. */
    if (NS_SUCCEEDED(result))
        mPos = pos;

    return (result);
}
开发者ID:AntoineTurmel,项目名称:nightingale-hacking,代码行数:31,代码来源:SeekableChannel.cpp

示例5: Restart

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 构造函数
HWND CChildWnd::Create()
{
	// 转到开始
	Restart();

	// 获取窗口状态
	BOOL bMaximized = CClientWnd::GetChildCount() ? 
		((GetWindowLong(CClientWnd::m_hWnd, GWL_EXSTYLE) & WS_EX_CLIENTEDGE) == FALSE) : CIni::GetInt(INI_MaxOnOpen);

	// 创建窗口	
	m_hWnd = CreateMDIWindow(STR_AppName TEXT("ChildWnd"), m_tzFileName, 0, 
		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 
		CClientWnd::m_hWnd, g_hInst, (LPARAM) this);

	if (m_hWnd)
	{
		// 调整播放窗口大小
		SetVideoSize(m_uWidth, m_uHeight);
		_ExIf(bMaximized, ShowWindow(m_hWnd, SW_MAXIMIZE));

		// 播放设置
		SetPlayWnd(m_hPlayWnd);
		_ExIf(CIni::GetInt(INI_DirectDraw, TRUE), EnableDDraw());
		_ExIf(CIni::GetInt(INI_PlayOnOpen), Play());
	}

	return m_hWnd;
}
开发者ID:Yonsm,项目名称:RawPlayer,代码行数:30,代码来源:ChildWnd.cpp

示例6: __Menu_Controls

void __Menu_Controls(void)
{
	u32 buttons = Wpad_WaitButtons();

	/* UP/DOWN buttons */
	if (buttons & WPAD_BUTTON_UP)
		__Menu_MoveList(-1);
	if (buttons & WPAD_BUTTON_DOWN)
		__Menu_MoveList(1);

	/* LEFT/RIGHT buttons */
	if (buttons & WPAD_BUTTON_LEFT)
		__Menu_MoveList(-ENTRIES_PER_PAGE);
	if (buttons & WPAD_BUTTON_RIGHT)
		__Menu_MoveList(ENTRIES_PER_PAGE);


	/* HOME button */
	if (buttons & WPAD_BUTTON_HOME)
		Restart();

	/* PLUS (+) button */
	if (buttons & WPAD_BUTTON_PLUS)
		Menu_Manage(selected, 'i');

	/* MINUS (-) button */
	if (buttons & WPAD_BUTTON_MINUS)
		Menu_Manage(selected, 'u');

	/* ONE (1) button */
	if (buttons & WPAD_BUTTON_1)
		Menu_Device();
}
开发者ID:ccfman2004,项目名称:wad-manager,代码行数:33,代码来源:menu.c

示例7: fscanf

bool CHC_GameSystem::LoadMap(char * filename) {
	FILE * fin;
	if ((fin = fopen(filename, "r")) == NULL) return false;

	fscanf(fin, "%d%d", &map_w, &map_h);	
	for (int i = 0; i != map_w; i++)
		for (int j = 0; j != map_h; j++)
			ori_map[i][j].setBlank();

	fscanf(fin, "%d%d", &num_sender, &num_receiver);
	int x, y, d, r, g, b;
	for (int i = 0; i != num_sender; i++) {
		fscanf(fin, "%d%d%d", &x, &y, &d);
		ori_map[x][y].dir = d;
		ori_map[x][y].obj = SENDER_ID;
		fscanf(fin, "%d%d%d", &r, &g, &b);
		ori_map[x][y].col[d / 2].setColor(r, g, b);
	}
	for (int i = 0; i != num_receiver; i++) {
		fscanf(fin, "%d%d", &x, &y);
		ori_map[x][y].obj = RECEIVER_ID;
		fscanf(fin, "%d%d%d", &r, &g, &b);
		ori_map[x][y].col[0].setColor(r, g, b);
	}
	for (int i = 0; i != NUM_MIRROR_SORT; i++) {
		fscanf(fin, "%d", &num_mirror[i]);
	}
	Restart();

	return true;
}
开发者ID:Sths,项目名称:MirrorMiddle,代码行数:31,代码来源:CHC_GameSystem.cpp

示例8: Disclaimer

void Disclaimer(void)
{
	/* Print disclaimer */
	printf("  [DISCLAIMER]:\n\n");

	printf("    THIS APPLICATION COMES WITH NO WARRANTY AT ALL,\n");
	printf("    NEITHER EXPRESS NOR IMPLIED.\n");
	printf("    I DO NOT TAKE ANY RESPONSIBILITY FOR ANY DAMAGE IN YOUR\n");
	printf("    WII CONSOLE BECAUSE OF A IMPROPER USAGE OF THIS SOFTWARE.\n\n");

	printf(">>  If you agree and install the streamed wad\n");
	printf(">>  press A button to continue.\n");
	printf(">>  Otherwise, press B button to restart your Wii.\n");

	/* Wait for user answer */
	for (;;) {
		u32 buttons = Wpad_WaitButtons();

		/* A button */
		if ((buttons & WPAD_BUTTON_A)||(buttons & PAD_BUTTON_A))
			break;

		/* B button */
		if ((buttons & WPAD_BUTTON_B)||(buttons & WPAD_CLASSIC_BUTTON_B))
			Restart();
	}
}
开发者ID:leoetlino,项目名称:crapwii,代码行数:27,代码来源:wad-manager.c

示例9: Stop

void btTracker::RestartTracker()
{
  // Stop/finish the tracker, then call Restart() after DT_TRACKER_FINISHED.
  Stop();
  m_f_restart = 1;
  if( DT_TRACKER_FINISHED == m_status ) Restart();
}
开发者ID:timpalpant,项目名称:dtorrent,代码行数:7,代码来源:tracker.cpp

示例10: shutdown

void btTracker::Reset(time_t new_interval)
{
  m_interval = new_interval ? new_interval : m_default_interval;

  if( INVALID_SOCKET != m_sock ){
    if( *cfg_verbose && DT_TRACKER_READY==m_status )
      CONSOLE.Debug("Disconnected from tracker at %s", m_spec->url);
    if( !g_secondary_process )
      shutdown(m_sock, SHUT_RDWR);
    CLOSE_SOCKET(m_sock);
    m_sock = INVALID_SOCKET;
  }

  if( m_redirect ){
    delete m_spec;
    m_spec = m_redirect;
    m_redirect = (tracker_spec *)0;
  }

  m_request_buffer.Reset();
  m_response_buffer.Reset();
  if( now < m_last_timestamp ) m_last_timestamp = now;  // time reversed

  if( m_f_stop ){
    if( m_f_restart )
      m_status = m_f_started ? DT_TRACKER_FREE : DT_TRACKER_FINISHED;
    else m_status = DT_TRACKER_FINISHED;

    if( DT_TRACKER_FINISHED == m_status ){
      m_f_started = 0;
      if( m_f_restart ) Restart();
    }
  }
  else m_status = DT_TRACKER_FREE;
}
开发者ID:timpalpant,项目名称:dtorrent,代码行数:35,代码来源:tracker.cpp

示例11: if

    void World::Update()
    {
        if(m_state == IDLE)
        {
            if(LoadResources())
            {

            }
        }
        else if(m_state == PLAYING)
        {
            if(!IsBallInBounds())
            {
                ChangeState(GAMEOVER);
            }
            else
            {
                UpdateBall();
                UpdatePlayer1();
                UpdatePlayer2(); 
            }
        }
        else if(m_state == GAMEOVER)
        {
            if(HasBallCollideLeft())
            {
                m_player2.UpdateScore(1);
            }
            else if(HasBallCollideRight())
            {
                m_player1.UpdateScore(1);
            }
            Restart();
        }
    }
开发者ID:pavelsimo,项目名称:Pong,代码行数:35,代码来源:World.cpp

示例12: Restart

void APawn::PawnClientRestart()
{
	Restart();

	APlayerController* PC = Cast<APlayerController>(Controller);
	if (PC && PC->IsLocalController())
	{
		// Handle camera possession
		if (PC->bAutoManageActiveCameraTarget)
		{
			PC->AutoManageActiveCameraTarget(this);
		}

		// Set up player input component, if there isn't one already.
		if (InputComponent == NULL)
		{
			InputComponent = CreatePlayerInputComponent();
			if (InputComponent)
			{
				SetupPlayerInputComponent(InputComponent);
				InputComponent->RegisterComponent();
				if (UInputDelegateBinding::SupportsInputDelegate(GetClass()))
				{
					InputComponent->bBlockInput = bBlockInput;
					UInputDelegateBinding::BindInputDelegates(GetClass(), InputComponent);
				}

			}
		}
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:31,代码来源:Pawn.cpp

示例13: Restart

Snake::Snake(unsigned headcolor, unsigned segmentcolor, unsigned coincolor)
{
    this->headcolor = headcolor;
    this->segmentcolor = segmentcolor;
    this->coincolor = coincolor;
    Restart();
}
开发者ID:johnnietirado,项目名称:TiledSnake,代码行数:7,代码来源:Snake.cpp

示例14: AssertValidKeyLength

void HMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength)
{
    AssertValidKeyLength(keylength);

    Restart();

    HashTransformation &hash = AccessHash();
    unsigned int blockSize = hash.BlockSize();

    if (!blockSize)
        throw InvalidArgument("HMAC: can only be used with a block-based hash function");

    if (keylength <= blockSize)
        memcpy(AccessIpad(), userKey, keylength);
    else
    {
        AccessHash().CalculateDigest(AccessIpad(), userKey, keylength);
        keylength = hash.DigestSize();
    }

    assert(keylength <= blockSize);
    memset(AccessIpad()+keylength, 0, blockSize-keylength);

    for (unsigned int i=0; i<blockSize; i++)
    {
        AccessOpad()[i] = AccessIpad()[i] ^ OPAD;
        AccessIpad()[i] ^= IPAD;
    }
}
开发者ID:LjApps,项目名称:eMule-VeryCD,代码行数:29,代码来源:hmac.cpp

示例15: main

int main( int argc, char * argv[] )
{
	// 屏蔽信号
	signal( SIGCLD, SIG_IGN );
	signal( SIGILL, SIG_IGN );
	signal( SIGIOT, SIG_IGN );
	signal( SIGFPE, SIG_IGN );
	signal( SIGBUS, SIG_IGN );
	signal( SIGSYS, SIG_IGN );
	signal( SIGTRAP, SIG_IGN );
	signal( SIGSEGV, SIG_IGN );
	
	if( argc > 1 )
	{
		if( strcmp( argv[1], "start" ) == 0 )
		{
			Start();
			return 0;
		}
		else if( strcmp( argv[1], "stop" ) == 0 )
		{
			Stop();
			return 0;
		}
		else if( strcmp( argv[1], "restart" ) == 0 )
		{
			Restart();
			return 0;
		}
	}
	
	printf( " Usage   : ./PgSqlService start|stop|restart\n" );
    return 0;
}
开发者ID:HannibalMSmith,项目名称:updatesystem,代码行数:34,代码来源:PgSqlService.cpp


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