本文整理汇总了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;
}
示例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;
}
示例3: Restore
void TopWindow::Reject()
{
for(Ctrl *q = GetFirstChild(); q; q = q->GetNext())
q->Reject();
if(!backup.IsEmpty())
Restore();
}
示例4: Restore
void DirectxState::Initialize() {
if(initialized) return;
Restore();
initialized = true;
}
示例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);
}
示例6: Restore
GC::~GC()
{
Restore();
if (handle && needDelete) {
DeleteDC(handle);
}
}
示例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();
}
示例8: Restore
void OpenGLState::Initialize() {
if (initialized)
return;
initialized = true;
Restore();
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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.";
}
示例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;
}
示例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;
}
}
示例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;
}