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


C++ event类代码示例

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


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

示例15: 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


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