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


C++ Alarm函数代码示例

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


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


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