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


C++ Restore函数代码示例

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


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

示例1: f_ArgAbstractDeclarator

static Declarator_t f_ArgAbstractDeclarator( void )
{
   Declarator_t Declarator;
   Save();

   if(( Declarator = f_AbstractDeclarator()))
   {
      if( token( 0 ) == '=' )
      {
         step( 1 );
         Declarator->Expr = f_AssignmentExpression();
      }

      switch( token( 0 ))
      {
         case ',':
         case ')':
         case SN_ELLIPSIS:
            return Declarator;
         default:
            f_DeclaratorDestroy( Declarator );
            Restore();  /* 21.02.97 rigo */
            return 0;
      }
   }
   Restore();  /* 21.02.97 rigo */
   return 0;
}
开发者ID:mildrock,项目名称:dummy,代码行数:28,代码来源:cp_argument.c

示例2: Restore

LRESULT CView::OnTrayIcon(WPARAM wParam, LPARAM lParam)
{
	// For a NOTIFYICONDATA with uVersion= 0, wParam and lParam have the following values:
	// The wParam parameter contains the identifier of the taskbar icon in which the event occurred.
	// The lParam parameter holds the mouse or keyboard message associated with the event.
    if (wParam != IDW_MAIN)
		return 0L;

	if (lParam == WM_LBUTTONUP)
    {
        Restore();
    }
    else if (lParam == WM_RBUTTONUP)
    {
		CMenu TopMenu(IDM_MINIMIZED);
		CMenu* pSubMenu = TopMenu.GetSubMenu(0);

        SetForegroundWindow();
		CPoint pt = GetCursorPos();
		UINT uSelected = pSubMenu->TrackPopupMenu(TPM_RETURNCMD | TPM_NONOTIFY, pt.x, pt.y, this, NULL);

		switch (uSelected)
		{
		case IDM_MIN_RESTORE: Restore(); break;
		case IDM_MIN_ABOUT:   OnAbout(); break;
		case IDM_MIN_EXIT:    Destroy(); break;
		}
    }

	return 0;
}
开发者ID:quinsmpang,项目名称:Tools,代码行数:31,代码来源:View.cpp

示例3: Restore

void TopWindow::Reject()
{
	for(Ctrl *q = GetFirstChild(); q; q = q->GetNext())
		q->Reject();
	if(!backup.IsEmpty())
		Restore();
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:7,代码来源:TopWindow.cpp

示例4: Restore

void DirectxState::Initialize() {
	if(initialized) return;

	Restore();

	initialized = true;
}
开发者ID:AbandonedCart,项目名称:PPSSPPXperia,代码行数:7,代码来源:dx_state.cpp

示例5: sizeof

/***************************************************************************\
  Clears the specified surface.
\***************************************************************************/
void IMR_DirectXInterface::Clear_Surface(LPDIRECTDRAWSURFACE4 Surface)
{
HRESULT ddflag;
RECT Area;
DDSURFACEDESC2 DDSurfaceDesc;
char *Mem;

// Make sure the surface exists:
if (!Surface) return;

// Lock the surface:
DDSurfaceDesc.dwSize = sizeof(DDSurfaceDesc);
ddflag = Surface->Lock(&Area, &DDSurfaceDesc, DDLOCK_WAIT, NULL);
if (ddflag == DDERR_SURFACELOST)
    {
    Restore(Surface);
    ddflag = Surface->Lock(NULL, &DDSurfaceDesc, DDLOCK_WAIT, NULL);
     }
if (ddflag != DD_OK) return;
Mem = (char *)DDSurfaceDesc.lpSurface;

// Clear the surface:
if (Mem) memset(Mem, 0, DDSurfaceDesc.dwSize);

// And unlock the surface:
Surface->Unlock(NULL);
 }
开发者ID:dhawt,项目名称:Immerse,代码行数:30,代码来源:imr_directx.cpp

示例6: Restore

GC::~GC()
{
	Restore();
	if (handle && needDelete) {
		DeleteDC(handle);
	}
}
开发者ID:carriercomm,项目名称:WalCommander,代码行数:7,代码来源:swl_wincoreMS.cpp

示例7: L_ACT

TError TContainerHolder::Restore(TScopedLock &holder_lock, const std::string &name,
                                 const kv::TNode &node) {
    if (name == ROOT_CONTAINER || name == PORTO_ROOT_CONTAINER)
        return TError::Success();

    L_ACT() << "Restore container " << name << " (" << node.ShortDebugString() << ")" << std::endl;

    auto parent = GetParent(name);
    if (!parent)
        return TError(EError::InvalidValue, "invalid parent container");

    int id = 0;
    TError error = RestoreId(node, id);
    if (error)
        return error;

    if (!id)
        return TError(EError::Unknown, "Couldn't restore container id");

    auto c = std::make_shared<TContainer>(shared_from_this(), Storage, name, parent, id);
    error = c->Restore(holder_lock, node);
    if (error) {
        L_ERR() << "Can't restore container " << name << ": " << error << std::endl;
        return error;
    }

    Containers[name] = c;
    Statistics->Created++;
    return TError::Success();
}
开发者ID:darkk,项目名称:porto,代码行数:30,代码来源:holder.cpp

示例8: Restore

void OpenGLState::Initialize() {
	if (initialized)
		return;
	initialized = true;

	Restore();
}
开发者ID:Summeli,项目名称:native,代码行数:7,代码来源:gl_state.cpp

示例9: RecDelete

int RecDelete(KeyType k,BTNode *p)
/*查找并删除关键字k*/
{
	int i;
	int found;
	if (p==NULL)
		return 0;
	else
	{
		if ((found=SearchNode(k,p,i))==1)		/*查找关键字k*/
		{
			if (p->ptr[i-1]!=NULL)				/*若为非叶子结点*/
			{
				Successor(p,i);					/*由其后继代替它*/
				RecDelete(p->key[i],p->ptr[i]);	/*p->key[i]在叶子结点中*/
			}
			else
				Remove(p,i);					/*从*p结点中位置i处删除关键字*/
		}
		else
			found=RecDelete(k,p->ptr[i]);		/*沿孩子结点递归查找并删除关键字k*/
		if (p->ptr[i]!=NULL)
			if (p->ptr[i]->keynum<Min)			/*删除后关键字个数小于MIN*/
				Restore(p,i);
		return found;
	}
}
开发者ID:Mandarava,项目名称:Data-Structure,代码行数:27,代码来源:btree.cpp

示例10: Restore

void MY_UI::Controls::Window::Maximize(){
	if(!Internal_Window.Maximizeable) return;
	auto skin = MY_UI::Internal::WidgetSkin;
	if(Internal_Window.Maximized){// the window is in a maximized state.. this function should restore the window
		TitleBar->Maximize_Button->ClearImages();
		TitleBar->Maximize_Button->Set_UnPressed_Texture(skin->Maximize_Window_Button);// take a copy of the UI skin for the texture
		TitleBar->Maximize_Button->Set_Pressed_Texture(skin->Maximize_Window_Button_Pressed);// take a copy of the UI skin for the texture

		Restore();
		Internal_Window.Maximized = false;
	}else {// window is being maximized.. save old settings so it can be restored	
		if(Internal_Window.Minimized){ // if maximizing from a minimized state, make sure to set minimized to false and set the texture correctly
			Internal_Window.Minimized = false;
			TitleBar->Minimize_Button->ClearImages();
			TitleBar->Minimize_Button->Set_UnPressed_Texture(skin->Minimize_Window_Button);// take a copy of the UI skin for the texture
			TitleBar->Minimize_Button->Set_Pressed_Texture(skin->Minimize_Window_Button_Pressed);// take a copy of the UI skin for the texture

		} else {
			Internal_Window.Old_Size = GetSize();
			Internal_Window.Old_Pos = GetPos();
		}
		SetPos(0, 0);
		Utilities::Point p = Internal_Widget.Parent->GetSize();// get the parents size so the maximized window can be sized correctly
	
		SetSize(p.x, p.y);	

		TitleBar->Maximize_Button->ClearImages();
		TitleBar->Maximize_Button->Set_UnPressed_Texture(skin->Restore_Window_Button);// take a copy of the UI skin for the texture
		TitleBar->Maximize_Button->Set_Pressed_Texture(skin->Restore_Window_Button_Pressed);// take a copy of the UI skin for the texture

		Internal_Window.Maximized = true;
	}
}
开发者ID:LazyNarwhal,项目名称:Destination_Toolkit,代码行数:33,代码来源:Window.cpp

示例11: DXASSERT

//////////////////////////////////////////////////////////////////////
// Descripcion:
// - Reproduce el sonido almacenado (o asociado) en el buffer secundario.
// Parametros:
// - dwFlags: Modo de reproduccion. Por defecto reproduce una 
//   sola vez el sonido y acaba. Si recibe DSBPLAY_LOOPING se
//   reproducira el sonido continuamente.
// Devuelve:
// - true: Si la operacion se realiza con exito.
// - false: Existe algun problema.
// Notas:
////////////////////////////////////////////////////////////////////// 
bool DXDSWAVSound::Play(const dword dwFlags)
{
  // SOLO si hay buffer secundario
  DXASSERT(m_lpDSBuffer != NULL);
  
  DWORD dwStatus;    // Estado del buffer secundario

  // Inicializaciones  
  dwStatus = m_lpDSBuffer->GetStatus(&dwStatus);

  // ¿Se ha perdido el buffer?
  if (dwStatus &  DSBSTATUS_BUFFERLOST) {
    // Si; se llama al metodo Restore para recuperarlo    
    Restore();
  }

  // Se pone en marcha el sonido
  m_CodeResult = m_lpDSBuffer->Play(0, 0, dwFlags);
  if (FAILED(m_CodeResult)) {
    // Hay problemas
    DXDSError::DXDSErrorToString(m_CodeResult, m_sLastCode);
    return false;
  } 

  // Todo correcto
  return true;
}
开发者ID:Frodrig,项目名称:CrisolEngine,代码行数:39,代码来源:DXDSWAVSound.cpp

示例12: LOG

void Solver<Dtype>::Solve(const char* resume_file) {
  LOG(INFO) << "Solving " << net_->name();
  LOG(INFO) << "Learning Rate Policy: " << param_.lr_policy();

  if (resume_file) {
    LOG(INFO) << "Restoring previous solver status from " << resume_file;
    Restore(resume_file);
  }

  // For a network that is trained by the solver, no bottom or top vecs
  // should be given, and we will just provide dummy vecs.
  Step(param_.max_iter() - iter_);
  // If we haven't already, save a snapshot after optimization, unless
  // overridden by setting snapshot_after_train := false
  if (param_.snapshot_after_train()
      && (!param_.snapshot() || iter_ % param_.snapshot() != 0)) {
    Snapshot();
  }
  // After the optimization is done, run an additional train and test pass to
  // display the train and test loss/outputs if appropriate (based on the
  // display and test_interval settings, respectively).  Unlike in the rest of
  // training, for the train net we only run a forward pass as we've already
  // updated the parameters "max_iter" times -- this final pass is only done to
  // display the loss, which is computed in the forward pass.
  if (param_.display() && iter_ % param_.display() == 0) {
    Dtype loss;
    net_->ForwardPrefilled(&loss);
    LOG(INFO) << "Iteration " << iter_ << ", loss = " << loss;
  }
  if (param_.test_interval() && iter_ % param_.test_interval() == 0) {
    TestAll();
  }
  LOG(INFO) << "Optimization Done.";
}
开发者ID:madiken,项目名称:skaffe_private_old,代码行数:34,代码来源:solver.cpp

示例13: Exchange

//Also resets the data in the animation.//
WSL::Components::Algorithimic::SubBase::AllAnimationData WSL::Components::Algorithimic::Animation::GatherData()
{
	WSL::Components::Algorithimic::SubBase::AllAnimationData temp;
	temp = Exchange( temp );
	Restore();
	return temp;
}
开发者ID:draab,项目名称:White-StormLightning,代码行数:8,代码来源:Animation.cpp

示例14: mLKFilePath

CScreenOrientation::CScreenOrientation(const LPCTSTR szPath) : mLKFilePath(szPath), mOSFilePath(szPath)  {

    if(!mOSFilePath.empty() && (*mOSFilePath.rbegin()) != L'\\') {
        mOSFilePath += _T(DIRSEP);
    }
    mOSFilePath += TEXT(LKD_CONF);
    mOSFilePath += TEXT(DIRSEP ".OSScreen");
    
    // if we have OS saved state, previous don't shutdown correctly
    // so don't save current state.
    if(GetSavedSetting(mOSFilePath.c_str()) == invalid) {
        if(!Save(mOSFilePath.c_str())) {
            // TODO : Log Error;
        }
    }

    
    if(!mLKFilePath.empty() && (*mLKFilePath.rbegin()) != L'\\') {
        mLKFilePath += _T(DIRSEP);
    }
    mLKFilePath += TEXT(LKD_CONF);
    mLKFilePath += TEXT(DIRSEP ".LKScreen");
    
    if(!Restore(mLKFilePath.c_str())) {
        // TODO : Log Error;
    }
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:27,代码来源:CScreenOrientation.cpp

示例15: f_Enum

extern Enum_t f_Enum( void )
{
   Enum_t Enum;
   Save();
   niveau++;

   if( token( 0 ) != SN_ENUM )
   {
      niveau--;
      Restore();
      return 0;
   }

   Enum = f_EnumCreate();

   step( 1 );

   if( token( 0 ) != LBRACE ) /* SN_IDENTIFIER or SN_NEW or ... */
   {
      Enum->Name = f_NameCreate( ident( 0 ));
      step( 1 );
   }

   if( token( 0 ) == LBRACE )
   {
//      step( 1 );										//- MTP (bugfix -- skipped 1st enum)
      Enum->ListEnumerator = f_EnumeratorList();
      f_StepTo( RBRACE, 0 );
      step( 1 );
   }

   niveau--;
   return Enum;
}
开发者ID:mildrock,项目名称:dummy,代码行数:34,代码来源:cp_enum.c


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