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

C++ Alarm函数代码示例

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

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



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

示例1: Prot_set_down_queue

void	Prot_set_down_queue( int queue_type )
{
        switch(queue_type) {
        case NORMAL_DOWNQUEUE:
                Down_queue_ptr = &Protocol_down_queue[NORMAL_DOWNQUEUE];
                break;
        case GROUPS_DOWNQUEUE:
                Down_queue_ptr = &Protocol_down_queue[GROUPS_DOWNQUEUE];
                break;
        default:
                Alarm(EXIT, "Prot_set_down_queue: Illegal queue_type (%d)\n", queue_type);
        }
}
开发者ID:liyu1981,项目名称:postgresql-r-hack,代码行数:13,代码来源:protocol.c


示例2: step

//vrider borren 1 steg
int step(void){
	if(ML4IN &(2)){
		//är i toppläge
		Outone(1);
		Outone(0);
		hold((time_type)250);
		Outzero(0);
		hold((time_type)500);
		return 1; 
	}
	Alarm(2);
	return 0;
}
开发者ID:Rektorn,项目名称:GruDreit,代码行数:14,代码来源:drill.c


示例3: LOGERROR

int CMFPI::N_Close()
{
    int ret = m_apiCtrl.LFSAsyncClose(&m_CurrRequestID);

    if(LFS_SUCCESS!=ret)
	{
		LOGERROR("%s,关闭失败!错误码:ret = %d",__FUNCTION__,ret);
        Alarm("07000000");
        emit CloseFailed();
	}

	return ret;
}
开发者ID:EricLLLLLL,项目名称:LeoLei,代码行数:13,代码来源:mfpi.cpp


示例4: IdentifyFailed

//执行LFS_CMD_IDC_Get_RAW_DATA
int CMFPI::N_ReadRawData(WORD readData,LONG timeout)
{
	m_FingerData = "";

	timeout = (-1==timeout) ? 0 : timeout;//

	if(timeout<0)
	{
        if ( readData == LFS_IDC_TRACK1)
		{
            emit IdentifyFailed();
		}
		else
		{
            emit DataAcquireFailed();
		}
		LOGERROR("%s,时间参数错误。设置了-1之外的负数,timeout = %d",__FUNCTION__,timeout);
        Alarm("07000001");
		return HM_PARAM_ERROR;
	}

    int ret=m_apiCtrl.LFSAsyncExecute(LFS_CMD_IDC_READ_RAW_DATA,&readData,timeout,&m_CurrRequestID);
    if(LFS_SUCCESS!=ret)
	{
        if ( readData == LFS_IDC_TRACK1)
		{
            emit IdentifyFailed();
		}
		else
		{
            emit DataAcquireFailed();
		}
		LOGERROR("%s,执行错误,错误码:ret = %d",__FUNCTION__,ret);
        Alarm("07000001");
	}

	return ret;
}
开发者ID:EricLLLLLL,项目名称:LeoLei,代码行数:39,代码来源:mfpi.cpp


示例5: E_sub_time

sp_time	E_sub_time( sp_time t, sp_time delta_t )
{
	sp_time	res;

	res.sec  = t.sec  - delta_t.sec;
	res.usec = t.usec - delta_t.usec;
	if ( res.usec < 0 )
	{
		res.usec = res.usec + 1000000;
		res.sec--;
	} 
	if ( res.sec < 0 ) Alarm( EVENTS, "E_sub_time: negative time result.\n");
	return ( res );
}
开发者ID:liyu1981,项目名称:postgresql-r-hack,代码行数:14,代码来源:events.c


示例6: Log

void ErrorHandler::CreateErrorMsg(const char *ArcName,const wchar *ArcNameW,const char *FileName,const wchar *FileNameW)
{
#ifndef SILENT
  if (FileName!=NULL)
    Log(ArcName,St(MCannotCreate),FileName);
  Alarm();

#if defined(_WIN_ALL) && !defined(_WIN_CE) && defined(MAX_PATH)
  CheckLongPathErrMsg(FileName,FileNameW);
#endif

  SysErrMsg();
#endif
}
开发者ID:089git,项目名称:calibre,代码行数:14,代码来源:errhnd.cpp


示例7: E_get_time_monotonic

static sp_time E_get_time_monotonic(void)
#ifdef HAVE_CLOCK_GETTIME_CLOCK_MONOTONIC
{
  struct timespec t;

  if (clock_gettime(CLOCK_MONOTONIC, &t) != 0) {
    Alarm( EXIT, "E_get_time_monotonic: clock_gettime problems: %d '%s'\n", errno, strerror(errno) );
  }

  Now.sec  = t.tv_sec;
  Now.usec = (t.tv_nsec + 500) / 1000;

  return Now;
}
开发者ID:Fran89,项目名称:seiscomp3,代码行数:14,代码来源:events.c


示例8: N_Close

// 收到打开完成消息后调用该函数
void  CMFPI::WR_OpenComplete(DWORD dwCommand, HRESULT hResult, LPVOID lpBuffer)
{
	//异步打开成功
    if(LFS_SUCCESS == hResult)
	{
		DWORD dwEvent = SERVICE_EVENTS | USER_EVENTS | SYSTEM_EVENTS | EXECUTE_EVENTS;
        int ret = m_apiCtrl.LFSAsyncRegister(dwEvent,&m_CurrRequestID);

        if(LFS_SUCCESS != ret)
		{
			N_Close();
            emit OpenFailed();
			LOGERROR("%s,注册事件失败,错误码:ret = %d",__FUNCTION__,ret);
            Alarm("07000000");
		}
	}
	else
	{
        emit OpenFailed();
		LOGERROR("%s,打开失败,错误码:hResult = %d",__FUNCTION__,hResult);
        Alarm("07000000");
	}
}
开发者ID:EricLLLLLL,项目名称:LeoLei,代码行数:24,代码来源:mfpi.cpp


示例9: while

void bhvm::execute_program (void)
{
    try{


        while (program_counter < int(program.size()))
        {
	    //std::cout << program[program_counter] << std::endl;    // debug... traza todo
            exec_instruction(program[program_counter]);
            ++program_counter;
        }
        signal_debug(Alarm(MTK_HERE, "bhvm",  MTK_SS("end of program." << std::endl << get_status()), alPriorDebug));


    } catch(const mtk::Alarm& error) {
        Alarm al(MTK_HERE, "bhvm",  get_status(), alPriorCritic);
        al.Add(error);
        signal_error(al);
    } catch (std::exception& e) {
        signal_error(Alarm(MTK_HERE, "bhvm",  MTK_SS("c++ exception " << e.what()  << get_status()), alPriorCritic));
    } catch(...) {
        signal_error(Alarm(MTK_HERE, "bhvm",  MTK_SS("unknown error  " << get_status()), alPriorCritic));
    }
}
开发者ID:jleahred,项目名称:maiquel-toolkit-cpp,代码行数:24,代码来源:bhvm.cpp


示例10: handler

void handler(int sig)
{
	static int beeps = 0;

	if( beeps++ <5)
	{
		printf("beef\n");	
		Alarm(1);
	}
	else
	{
		printf("boom!\n");
		exit(0);
	}
}
开发者ID:jack-lijing,项目名称:system,代码行数:15,代码来源:alarm.c


示例11: ConnectionClosed

// 收到关闭完成消息后调用该函数
void CMFPI::WR_CloseComplete(DWORD dwCommand, HRESULT hResult, LPVOID lpBuffer)
{
    if(LFS_SUCCESS == hResult)
	{
		m_bOpened = false;
        emit ConnectionClosed();
		LOGINFO("%s,事件:ConnectionClosed()",__FUNCTION__);
	}
	else
	{
        emit CloseFailed();
		LOGERROR("%s,关闭设备失败,错误码:hResult = %d",__FUNCTION__,hResult);
        Alarm("07000000");
	}
}
开发者ID:EricLLLLLL,项目名称:LeoLei,代码行数:16,代码来源:mfpi.cpp


示例12: Alarm

Property& Property::operator=(const Property& value) {
    if (type==value.type  ||  type==propTypeNone) {
        name = value.name;
        number=value.number;
        text = value.text;
        type = value.type;
        date = value.date;
        return *this;
    }
    else
        throw Alarm (
                    MTK_HERE, "property",
                    "Tipos no compatibles",
                    alPriorError, alTypeNoPermisions
                );
}
开发者ID:jleahred,项目名称:maiquel-toolkit-cpp,代码行数:16,代码来源:property.cpp


示例13: make_cptr

CountPtr< Signal<bhvm*> >
bhvm::register_external_command (const std::string& command)
{
    CountPtr< Signal<bhvm*> > new_signal = make_cptr(new Signal<bhvm*>());

    std::map    <std::string, CountPtr < Signal<bhvm*> > >::iterator it = map_signal_external_commands.find(command);
    if (it == map_signal_external_commands.end())
    {
        map_signal_external_commands.insert(std::make_pair(command, new_signal));
        map_signal_external_commands[command].DANGEROUS_ThisInstance_NOT_Delete();
    }
    else
        throw Alarm(MTK_HERE, "bhvm",  MTK_SS("command already registered "), alPriorCritic);

    return new_signal;
}
开发者ID:jleahred,项目名称:maiquel-toolkit-cpp,代码行数:16,代码来源:bhvm.cpp


示例14: Nstep

int Nstep(int a){   //a == antal steg att steppa
	int i;
	for(i = 0; i<a; i++){	//steppa a gånger
		if(0 == (BORR_STATUS & 0x2)){	//borren uppe?
			Alarm(2);
			return 0;
		}
		OutOne(1);
		hold((time_type)250);    //250 ms delay
		OutOne(0);
		hold((time_type)500);
		OutZero(0);
		
	}
	return 1;
}
开发者ID:sumsarj,项目名称:xcc,代码行数:16,代码来源:drill.c


示例15: Ask

int Ask(const wchar *AskStr)
{
  Alarm();

  const int MaxItems=10;
  wchar Item[MaxItems][40];
  int ItemKeyPos[MaxItems],NumItems=0;

  for (const wchar *NextItem=AskStr;NextItem!=NULL;NextItem=wcschr(NextItem+1,'_'))
  {
    wchar *CurItem=Item[NumItems];
    wcsncpyz(CurItem,NextItem+1,ASIZE(Item[0]));
    wchar *EndItem=wcschr(CurItem,'_');
    if (EndItem!=NULL)
      *EndItem=0;
    int KeyPos=0,CurKey;
    while ((CurKey=CurItem[KeyPos])!=0)
    {
      bool Found=false;
      for (int I=0;I<NumItems && !Found;I++)
        if (toupperw(Item[I][ItemKeyPos[I]])==toupperw(CurKey))
          Found=true;
      if (!Found && CurKey!=' ')
        break;
      KeyPos++;
    }
    ItemKeyPos[NumItems]=KeyPos;
    NumItems++;
  }

  for (int I=0;I<NumItems;I++)
  {
    eprintf(I==0 ? (NumItems>4 ? L"\n":L" "):L", ");
    int KeyPos=ItemKeyPos[I];
    for (int J=0;J<KeyPos;J++)
      eprintf(L"%c",Item[I][J]);
    eprintf(L"[%c]%ls",Item[I][KeyPos],&Item[I][KeyPos+1]);
  }
  eprintf(L" ");
  wchar Str[50];
  getwstr(Str,ASIZE(Str));
  wchar Ch=toupperw(Str[0]);
  for (int I=0;I<NumItems;I++)
    if (Ch==Item[I][ItemKeyPos[I]])
      return I+1;
  return 0;
}
开发者ID:BSzili,项目名称:aros-stuff,代码行数:47,代码来源:consio.cpp


示例16: E_delay

void	E_delay( sp_time t )
{
	struct timeval 	tmp_t;

	tmp_t.tv_sec = t.sec;
	tmp_t.tv_usec = t.usec;

#ifndef ARCH_PC_WIN95
        if (select(0, NULL, NULL, NULL, &tmp_t ) < 0)
        {
                Alarm( EVENTS, "E_delay: select delay returned error: %s\n", strerror(errno));
        }
#else  /* ARCH_PC_WIN95 */
        SleepEx( tmp_t.tv_sec*1000+tmp_t.tv_usec/1000, 0 );
#endif /* ARCH_PC_WIN95 */   

}
开发者ID:liyu1981,项目名称:postgresql-r-hack,代码行数:17,代码来源:events.c


示例17: GetPassword

bool GetPassword(PASSWORD_TYPE Type,const char *FileName,char *Password,int MaxLength)
{
  Alarm();
  while (true)
  {
    char PromptStr[256];
#if defined(_EMX) || defined(_BEOS)
    strcpy(PromptStr,St(MAskPswEcho));
#else
    strcpy(PromptStr,St(MAskPsw));
#endif
    if (Type!=PASSWORD_GLOBAL)
    {
      strcat(PromptStr,St(MFor));
      strcat(PromptStr,PointToName(FileName));
    }
    eprintf("\n%s: ",PromptStr);
    GetPasswordText(Password,MaxLength);
    if (*Password==0 && Type==PASSWORD_GLOBAL)
      return(false);
    if (Type==PASSWORD_GLOBAL)
    {
      strcpy(PromptStr,St(MReAskPsw));
      eprintf(PromptStr);
      char CmpStr[256];
      GetPasswordText(CmpStr,sizeof(CmpStr));
      if (*CmpStr==0 || strcmp(Password,CmpStr)!=0)
      {
        strcpy(PromptStr,St(MNotMatchPsw));
/*
#ifdef _WIN_32
        CharToOem(PromptStr,PromptStr);
#endif
*/
        eprintf(PromptStr);
        memset(Password,0,MaxLength);
        memset(CmpStr,0,sizeof(CmpStr));
        continue;
      }
      memset(CmpStr,0,sizeof(CmpStr));
    }
    break;
  }
  return(true);
}
开发者ID:cahocachi,项目名称:DEFCON,代码行数:45,代码来源:consio.cpp


示例18: va_start

void ErrorHandler::ErrMsg(const char *ArcName,const char *fmt,...)
{
  safebuf char Msg[NM+1024];
  va_list argptr;
  va_start(argptr,fmt);
  vsprintf(Msg,fmt,argptr);
  va_end(argptr);
#ifdef _WIN_ALL
  if (UserBreak)
    Sleep(5000);
#endif
  Alarm();
  if (*Msg)
  {
    Log(ArcName,"\n%s",Msg);
    mprintf("\n%s\n",St(MProgAborted));
  }
}
开发者ID:089git,项目名称:calibre,代码行数:18,代码来源:errhnd.cpp


示例19: main

void main()
{
	/*time_t currentTime = time(NULL);
	printf("현재시간 = %u\n", currentTime);
	printf("현재시간 = %s\n", asctime(localtime(&currentTime)));*/
	
	//1. 기준 시간 ( 프로그램 시작 시간 )
	const time_t timeBegin = time(NULL);

	while (true)
	{
		if (Alarm( timeBegin, 4) )
		{
			printf("%d 초가 경과 .. !\n", 4);
			break;
		}
	}//while()

}
开发者ID:contacoonta,项目名称:sgap-ccpp,代码行数:19,代码来源:main.cpp


示例20: Log

void Log(const wchar *ArcName,const wchar *fmt,...)
{
  // Preserve the error code for possible following system error message.
  int Code=ErrHandler.GetSystemErrorCode();

  Alarm();

  // This buffer is for format string only, not for entire output,
  // so it can be short enough.
  wchar fmtw[1024];
  PrintfPrepareFmt(fmt,fmtw,ASIZE(fmtw));

  safebuf wchar Msg[2*NM+1024];
  va_list arglist;
  va_start(arglist,fmt);
  vswprintf(Msg,ASIZE(Msg),fmtw,arglist);
  va_end(arglist);
  eprintf(L"%ls",Msg);
  ErrHandler.SetSystemErrorCode(Code);
}
开发者ID:Armada651,项目名称:comicsreader,代码行数:20,代码来源:log.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ AlarmsClear函数代码示例发布时间:2022-05-30
下一篇:
C++ Aig_ObjFanin0函数代码示例发布时间: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