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

C++ event类代码示例

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

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



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

示例1: cmp

	bool operator < (const event &rhs) const {
		if (cmp() != rhs.cmp())
			return cmp() < rhs.cmp();
		if (start != rhs.start)
			return start < rhs.start;
		return radius > rhs.radius;
	}
开发者ID:baactree,项目名称:PS,代码行数:7,代码来源:10000.cpp14.cpp


示例2: write

void journal::write( const event& e )
{
    LOG_DEBUG( l, "journal " << e.get_length() << " bytes" );
    _file.seekp( 0, std::ios_base::end );
    _file.write( (char*)&e.get_header(), e.get_length() );
    if( !_file.good() ) {
        eva_exception( "failed to write to journal" );
    }
}
开发者ID:mmcilroy,项目名称:eva_cpp,代码行数:9,代码来源:journal.cpp


示例3: print

 bool print(Iterator& out, event const& e) const {
   using namespace printers;
   if (e.type().name().empty() && !str.print(out, "<anonymous>"))
     return false;
   return str.print(out, e.type().name()) && str.print(out, " [")
          && u64.print(out, e.id()) && any.print(out, '|')
          && make_printer<time::point>{}.print(out, e.timestamp())
          && str.print(out, "] ") && make_printer<value>{}.print(out, e);
 }
开发者ID:ChallenChenZhiPeng,项目名称:vast,代码行数:9,代码来源:event.hpp


示例4: mouse_move

bool checkbox_w::mouse_move( const event &e )
{
	if ( _tracking )
	{
		if ( contains( e.from_native( e.raw_mouse().x, e.raw_mouse().y ) ) )
			_current = !_state;
		else
			_current = _state;
		invalidate();
		return true;
	}
	return false;
}
开发者ID:kdt3rd,项目名称:gecko,代码行数:13,代码来源:checkbox.cpp


示例5:

  std::vector<fsw_event_flag> monitor::filter_flags(const event& evt) const
  {
    // If there is nothing to filter, just return the original vector.
    if (event_type_filters.empty()) return evt.get_flags();

    std::vector<fsw_event_flag> filtered_flags;

    for (auto const& flag : evt.get_flags())
    {
      if (accept_event_type(flag)) filtered_flags.push_back(flag);
    }

    return filtered_flags;
  }
开发者ID:focusware,项目名称:fswatch,代码行数:14,代码来源:monitor.cpp


示例6: print_event_flags

static void print_event_flags(const event & evt)
{
  const vector<fsw_event_flag> & flags = evt.get_flags();

  if (nflag)
  {
    int mask = 0;
    for (const fsw_event_flag &flag : flags)
    {
      mask += static_cast<int> (flag);
    }

    cout << mask;
  }
  else
  {
    for (size_t i = 0; i < flags.size(); ++i)
    {
      cout << flags[i];

      // Event flag separator is currently hard-coded.
      if (i != flags.size() - 1) cout << event_flag_separator;
    }
  }
}
开发者ID:ailnitskiy,项目名称:fswatch,代码行数:25,代码来源:fswatch.cpp


示例7: to_string

std::string
to_string (const event & ev)
{
    std::string result("event: ");
    midibyte d0, d1;
    ev.get_data(d0, d1);
    char temp[128];
    snprintf
    (
        temp, sizeof temp,
        "[%04lu] status = 0x%02X; channel = 0x%02X; data = [0x%02X, 0x%02X]\n",
        ev.get_timestamp(), ev.get_status(), ev.get_channel(), d0, d1
    );
    result += std::string(temp);
    return result;
}
开发者ID:0rel,项目名称:sequencer64,代码行数:16,代码来源:event.cpp


示例8: Core_EnableStepping

void Core_EnableStepping(bool step)
{
	if (step)
	{
		//PowerPC::Pause();
		// Sleep(1);
		sleep_ms(1);
#if _DEBUG
		host->SetDebugMode(true);
#endif
		coreState=CORE_STEPPING;
	}
	else
	{
#if _DEBUG
		host->SetDebugMode(false);
#endif
		coreState = CORE_RUNNING;
		//PowerPC::Start();
		///SetEvent(m_hStepEvent); //TODO: pulseevent is flawed and can be lost
		m_hStepEvent.notify_one();

	}

}
开发者ID:SanJaroICS,项目名称:ppsspp,代码行数:25,代码来源:Core.cpp


示例9: get_rank

bool
event::operator < (const event & rhs) const
{
    if (m_timestamp == rhs.m_timestamp)
        return get_rank() < rhs.get_rank();
    else
        return m_timestamp < rhs.m_timestamp;
}
开发者ID:0rel,项目名称:sequencer64,代码行数:8,代码来源:event.cpp


示例10: mouse_release

bool checkbox_w::mouse_release( const event &e )
{
	if ( e.raw_mouse().button != 1 )
		return false;

	if ( _tracking )
	{
		_tracking = false;
		if ( contains( e.from_native( e.raw_mouse().x, e.raw_mouse().y ) ) )
			set_state( _current );
		_current = _state;
		invalidate();
		context::current().release_source( e );
		return true;
	}

	return false;
}
开发者ID:kdt3rd,项目名称:gecko,代码行数:18,代码来源:checkbox.cpp


示例11: switch

/*--------------------------------------------------------------------
 * event handler
 *
 * when a event occurs, this function is invoked
 */
void src_viewer::handle_event( event& e ) {
  inherited::handle_event( e );

  switch ( e.kind() ) {
  case SELECTION:
    {
      vnode* vn = e.get_object();
      void* event_source = e.get_source();
      if ( event_source == text ) return; // ignore local event
      show( vn );
    }
    break;

  case CLOSE_FILESET:
    {
      clear_cache();
      clear();
    }
    break;

  case NEW_FILESET:
    {
      /* show the first file_block */
      FileSetBlock* file_set = suif_env->get_file_set_block();
      if (file_set) {
        view(file_set->get_file_block(0));
      }
    }
    break;
  case REFRESH:
  case PROC_MODIFIED:
  case FSE_MODIFIED:
    {
      refresh();
    }
    break;

  default:
    break;
  }
}
开发者ID:,项目名称:,代码行数:46,代码来源:


示例12: mouse_press

bool checkbox_w::mouse_press( const event &e )
{
	if ( e.raw_mouse().button != 1 )
		return false;

	context::current().grab_source( e, shared_from_this() );

	_tracking = true;
	_current = !_state;
	invalidate();

	return _tracking;
}
开发者ID:kdt3rd,项目名称:gecko,代码行数:13,代码来源:checkbox.cpp


示例13: print_event_timestamp

static void print_event_timestamp(const event & evt)
{
  const time_t & evt_time = evt.get_time();

  char time_format_buffer[TIME_FORMAT_BUFF_SIZE];
  struct tm * tm_time = uflag ? gmtime(&evt_time) : localtime(&evt_time);

  string date =
    strftime(time_format_buffer,
             TIME_FORMAT_BUFF_SIZE,
             tformat.c_str(),
             tm_time) ? string(time_format_buffer) : string(_("<date format error>"));

  cout << date;
}
开发者ID:ailnitskiy,项目名称:fswatch,代码行数:15,代码来源:fswatch.cpp


示例14: do_go_cmd

static void
do_go_cmd(const event& e, void*)
{
  binding *b;
  char *node_name;
  char *node_info;

  vmenu *menu = (vmenu *) e.get_source();
  menu->clear("Go");

  b = new binding((bfun) &do_go_back_cmd, 0);
  menu->add_command(b, "Go", "Back");

  menu->add_separator("Go");

  /* construct list of previously selected objects */
  vnode_list *hist = vman->get_selection_history();

  for ( s_count_t i=1; /* jump over current object */
        (i<20) && (i<hist->size()); i++ ) {
    vnode *vn = (*hist)[i];
    char *tag = vn->get_tag();

    if ( tag == tag_suif_object ) {
      SuifObject *obj = (SuifObject *) vn->get_object();
      node_info = (char*)obj->get_meta_class()->get_class_name().c_str();
    } else if (tag == tag_code_fragment) {
      node_info = "";
    } else {
      suif_assert_message( false, ("Unknown tag") );
    }

    node_name = new char[strlen(tag)+strlen(node_info)+100 /*just to be safe*/];

    sprintf(node_name, "[%s] (0x%p) %s", tag, vn->get_object(), node_info);

    b = new binding((bfun) &do_go_to_node_cmd, vn);
    menu->add_command(b, "Go", node_name);

    delete [] node_name;
  }
}
开发者ID:,项目名称:,代码行数:42,代码来源:


示例15: on_transport_closed

void connector::on_transport_closed(event &e) {
    if (!connection_) return;
    if (connection_.state() & endpoint::LOCAL_ACTIVE) {
        if (reconnect_timer_) {
            e.connection().transport().unbind();
            transport_configured_ = false;
            int delay = reconnect_timer_->next_delay();
            if (delay >= 0) {
                if (delay == 0) {
                    // log "Disconnected, reconnecting..."
                    connect();
                    return;
                }
                else {
                    // log "Disconnected, reconnecting in " <<  delay << " milliseconds"
                    connection_.container().schedule(delay, this);
                    return;
                }
            }
        }
    }
    connection_.release();
    connection_  = 0;
}
开发者ID:marcelmeulemans,项目名称:qpid-proton-1,代码行数:24,代码来源:connector.cpp


示例16: SendGPUWait

void QtHost::SendGPUWait(u32 cmd, u32 addr, void *data)
{
	EmuThread_LockDraw(false);

	if((m_GPUFlag == 1 && (cmd == GE_CMD_PRIM || cmd == GE_CMD_BEZIER || cmd == GE_CMD_SPLINE)))
	{
		// Break after the draw
		m_GPUFlag = 0;
	}
	else if(m_GPUFlag == 0)
	{
		mainWindow->GetDialogDisasm()->UpdateDisplayList();
		mainWindow->GetDialogDisplaylist()->Update();
		m_hGPUStepEvent.wait(m_hGPUStepMutex);
	}
	else if(m_GPUFlag == 2 && addr == m_GPUData)
	{
		mainWindow->GetDialogDisasm()->UpdateDisplayList();
		mainWindow->GetDialogDisplaylist()->Update();
		m_hGPUStepEvent.wait(m_hGPUStepMutex);
	}
	else if(m_GPUFlag == 3 && (cmd == GE_CMD_PRIM || cmd == GE_CMD_BEZIER || cmd == GE_CMD_SPLINE))
	{
		GPUgstate *state = (GPUgstate*)data;
		u32 texAddr = (state->texaddr[0] & 0xFFFFF0) | ((state->texbufwidth[0]<<8) & 0x0F000000);
		if(texAddr == m_GPUData)
		{
			mainWindow->GetDialogDisasm()->UpdateDisplayList();
			mainWindow->GetDialogDisplaylist()->Update();
			m_hGPUStepEvent.wait(m_hGPUStepMutex);
		}
	}

	EmuThread_LockDraw(true);
}
开发者ID:Carter07,项目名称:ppsspp,代码行数:35,代码来源:QtHost.cpp


示例17: arr_cust

void arr_cust()
{
	create("arr_cust");

	line.reserve();	// join the line and wait to be head
    vendingMachineRequested.set();    // i am the front of the line
    waitVendingMachineOpen.queue();   // wait for an open machine
    vendingMachineRequested.clear();  // vending machine is open and im taking it clear for next in line
    vendingMachineIsOpen.set(); // tell vending machine that i am about to use it.
    line.release();  // i am not the head of the line anymore pass it to next in line.
    doneWithMachine.wait(); // I am done after time to use machine is free and im leaving and dying.
    
    // set up shuttle process
	
}
开发者ID:joamjoamjoam,项目名称:airport,代码行数:15,代码来源:airportVendingMachineModel.c


示例18: Core_EnableStepping

void Core_EnableStepping(bool step) {
	if (step) {
		sleep_ms(1);
#if defined(_DEBUG)
		host->SetDebugMode(true);
#endif
		m_hStepEvent.reset();
		Core_UpdateState(CORE_STEPPING);
	} else {
#if defined(_DEBUG)
		host->SetDebugMode(false);
#endif
		coreState = CORE_RUNNING;
		coreStatePending = false;
		m_hStepEvent.notify_one();
	}
}
开发者ID:A671DR218,项目名称:ppsspp,代码行数:17,代码来源:Core.cpp


示例19: SendGPUWait

void QtHost::SendGPUWait()
{
	EmuThread_LockDraw(false);

	mainWindow->GetDialogDisasm()->UpdateDisplayList();
	m_hGPUStepEvent.wait(m_hGPUStepMutex);

	EmuThread_LockDraw(true);
}
开发者ID:Almamu,项目名称:ppsspp,代码行数:9,代码来源:QtHost.cpp


示例20: manageMachines

void manageMachines(){
    create("manageMachines");

    double B,timeUsingMachine;
    
    while (1) {
        vendingMachineRequested.wait();
        
        B = uniform(10,60);
        timeUsingMachine = 150 + uniform((B/2),30);
        
        waitVendingMachineOpen.set();
        vendingMachineIsOpen.wait();
        numberOfMachinesBeingUsed++;
        hold(timeUsingMachine);
        doneWithMachine.set();
        numberOfMachinesBeingUsed--;
        }
}
开发者ID:joamjoamjoam,项目名称:airport,代码行数:19,代码来源:airportVendingMachineModel.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ event_list_t类代码示例发布时间:2022-05-31
下一篇:
C++ error_code类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap