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

C++ post_event函数代码示例

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

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



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

示例1: process_post_priority_event

process_post_event_status
process_post_priority_event(process* p, process_event_t ev, process_data_t data,
		   process_event_priority pri)
{
  if (pri >= NB_PROCESS_EVENT_PRIORITIES) {
    return PROCESS_POST_EVENT_INVALID_PRIORITY;
  }
  return post_event(p, &queues[pri], ev, data);
}
开发者ID:Pagten,项目名称:lab-psu,代码行数:9,代码来源:process.c


示例2: load_url

static audio_result_t load_url(void* _mp3_info, const char* url)
{
  mp3_t* mp3_info = (mp3_t*) _mp3_info;
  mc_free(mp3_info->file_or_url);
  mp3_info->file_or_url = mc_strdup(url);
  post_event(mp3_info->player_control, INTERNAL_CMD_LOAD_URL, -1);
  psem_wait(mp3_info->length_set);
  return AUDIO_OK;
}
开发者ID:hdijkema,项目名称:BackToBasics,代码行数:9,代码来源:mp3.c


示例3: load_file

static audio_result_t load_file(void* _minfo, const char* file)
{
  ogg_t* minfo = (ogg_t*) _minfo;
  mc_free(minfo->file_or_url);
  minfo->file_or_url = mc_strdup(file);
  post_event(minfo->player_control, INTERNAL_CMD_LOAD_FILE, -1);
  psem_wait(minfo->length_set);
  return AUDIO_OK;
}
开发者ID:hdijkema,项目名称:BackToBasics,代码行数:9,代码来源:ogg.c


示例4: TraceLogger

boost::statechart::result QuittingGame::react(const StartQuittingGame& u) {
    TraceLogger(FSM) << "(HumanClientFSM) QuittingGame";

    m_server_process = &u.m_server;
    m_after_server_shutdown_action = u.m_after_server_shutdown_action;

    post_event(ShutdownServer());
    return discard_event();
}
开发者ID:cpeosphoros,项目名称:freeorion,代码行数:9,代码来源:HumanClientFSM.cpp


示例5: my_base

Approaching::Approaching(my_context ctx) : my_base(ctx)
{
    UISubState uiSubState = PRINTENGINE->PauseRequested() ? AboutToPause : 
                                                            NoUISubState;
    PRINTENGINE->SendStatus(ApproachingState, Entering, uiSubState);
    
    if (context<PrinterStateMachine>()._motionCompleted)
        post_event(EvMotionCompleted());
}
开发者ID:nerginer,项目名称:ember-firmware,代码行数:9,代码来源:PrinterStateMachine.cpp


示例6: channel_server_connected

static void channel_server_connected(Channel * c1) {
    trace(LOG_ALWAYS, "channel server connected");

    assert(c1->state == ChannelStateConnected);

    /* Connect to destination on next dispatch since we are limited in
     * what we can do in a callback, e.g. cannot close channel. */
    post_event(connect_dest, c1);
}
开发者ID:wind-river-cdt,项目名称:tcf.agent,代码行数:9,代码来源:main_log.c


示例7: connect_event_handler

void facade::init(std::vector<std::string> args)
{
	base::app::app::init(args);
	///////////////////////////////////////////////////
	base::event::event* new_event=NULL;
	///////////////////////////////////////////////////
	connect_event_handler("event.base.app.shutdown",
		boost::bind(&base::app::app::handle_shutdown, this, _1));
	///////////////////////////////////////////////////
	std::string config_file("config/bj.client.dev.ini");
	try
	{
		boost::property_tree::ini_parser::read_ini(config_file, *get_configuration("default"));
	}
	catch(const std::exception& e)
	{
		std::cerr<<"[facade::init] Exception: "<<e.what()<<"."<<std::endl;
		std::cout<<"usage: "<<args[0]<<" [host_ip] [host_port]"<<std::endl;
		///////////////////////////////////////////
		new_event=base::event::Factory::get("event.base.app.shutdown");
		new_event->set_debug_info(_DEBUG_INFO_());
		post_event(new_event);
		///////////////////////////////////////////
		return;
	}
	//std::cout<<base::formatting::to_string(_options)<<std::endl;
	merge_configuration_options("default");
	//std::cout<<base::ptree::str(*get_configuration("default"))<<std::endl;
	///////////////////////////////////////////////////
//	connect_event_handler("event.base.deadlinetimer.timeout", boost::bind(&facade::handle_timeout, this, _1));
	///////////////////////////////////////////////////
	_xml=new xml(this);
	_cli=new cli(this);
	_cli->init();
	_server_settings=new server_settings();
	///////////////////////////////////////////////////
	_session=new session(this);
	_session->init();
	std::string host_ip=get_configuration("default")->get<std::string>("server.ip");
	int port=get_configuration("default")->get<int>("common.tcp_port");
	boost::asio::ip::tcp::endpoint* endpoint=
		new boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(host_ip), port);
	_session->connect(endpoint);
	///////////////////////////////////////////////////
	_player=new player(this);
	_player->set_name(get_configuration("default")->get<std::string>("player.name"));
	_player->set_nick(get_configuration("default")->get<std::string>("player.nick"));
	_player->set_pass(get_configuration("default")->get<std::string>("player.pass"));
	_player->set_skin_id(get_configuration("default")->get<int>("player.skin_id"));
	///////////////////////////////////////////////////
	_player_controller=new player_controller(this);
	_player_controller->set_player(_player);
	_player_controller->init();
	///////////////////////////////////////////////////
	get_thread_group()->add_thread(new boost::thread(boost::bind(&cli::poll_std_cin, _cli)));
}
开发者ID:alexandry-augustin,项目名称:bj,代码行数:56,代码来源:facade.cpp


示例8: signal_handler

static void signal_handler(int sig) {
    if (is_dispatch_thread()) {
        discovery_stop();
        signal(sig, SIG_DFL);
        raise(sig);
    }
    else {
        post_event(shutdown_event, NULL);
    }
}
开发者ID:wind-river-cdt,项目名称:tcf.agent,代码行数:10,代码来源:main.c


示例9: ftdi_change

// respond to connection or disconnection of ftdi device.
// may be called from an interrupt
void ftdi_change(uhc_device_t* dev, u8 plug) {
  print_dbg("\r\n changed FTDI connection status");
  if(plug) { 
    e.eventType = kEventFtdiConnect; 
  } else {
    e.eventType = kEventFtdiDisconnect;
  }
  // posting an event so the main loop can respond
  post_event(&e); 
}
开发者ID:Someone101,项目名称:aleph,代码行数:12,代码来源:ftdi.c


示例10: Base

////////////////////////////////////////////////////////////
// PlayingTurn
////////////////////////////////////////////////////////////
PlayingTurn::PlayingTurn(my_context ctx) :
    Base(ctx)
{
    TraceLogger(FSM) << "(HumanClientFSM) PlayingTurn";
    Client().Register(Client().GetClientUI().GetMapWnd());
    Client().GetClientUI().GetMapWnd()->InitTurn();
    Client().GetClientUI().GetMapWnd()->RegisterWindows(); // only useful at game start but InitTurn() takes a long time, don't want to display windows before content is ready.  could go in WaitingForGameStart dtor but what if it is given e.g. an error reaction?
    // TODO: reselect last fleet if stored in save game ui data?
    Client().GetClientUI().GetMessageWnd()->HandleGameStatusUpdate(
        boost::io::str(FlexibleFormat(UserString("TURN_BEGIN")) % CurrentTurn()) + "\n");
    Client().GetClientUI().GetMessageWnd()->HandlePlayerStatusUpdate(Message::PLAYING_TURN, Client().PlayerID());
    Client().GetClientUI().GetPlayerListWnd()->Refresh();
    Client().GetClientUI().GetPlayerListWnd()->HandlePlayerStatusUpdate(Message::PLAYING_TURN, Client().PlayerID());

    if (Client().GetApp()->GetClientType() != Networking::CLIENT_TYPE_HUMAN_OBSERVER)
        Client().GetClientUI().GetMapWnd()->EnableOrderIssuing(true);

    if (Client().GetApp()->GetClientType() == Networking::CLIENT_TYPE_HUMAN_OBSERVER) {
        // observers can't do anything but wait for the next update, and need to
        // be back in WaitingForTurnData, so posting TurnEnded here has the effect
        // of keeping observers in the WaitingForTurnData state so they can receive
        // updates from the server.
        post_event(TurnEnded());

    } else if (Client().GetApp()->GetClientType() == Networking::CLIENT_TYPE_HUMAN_PLAYER) {
        if (Client().GetClientUI().GetMapWnd()->AutoEndTurnEnabled()) {
            // if in-game-GUI auto turn advance enabled, set auto turn counter to 1
            Client().InitAutoTurns(1);
        }

        // if no auto turns left, and supposed to quit then autosave
        // which will lead to a quit when the save completes
        if (Client().AutoTurnsLeft() <= 0 && GetOptionsDB().Get<bool>("auto-quit"))
            Client().Autosave();

        // if there are still auto turns left, advance the turn automatically,
        // and decrease the auto turn counter
        if (Client().AutoTurnsLeft() > 0) {
            post_event(AdvanceTurn());
            Client().DecAutoTurns();
        }
    }
}
开发者ID:matt474,项目名称:freeorion,代码行数:46,代码来源:HumanClientFSM.cpp


示例11: np_trigger_message

static void np_trigger_message(InputBuf * ibuf) {
    ChannelNP * c = ibuf2np(ibuf);

    assert(is_dispatch_thread());
    assert(c->ibuf.message_count > 0);
    if (c->ibuf.handling_msg == HandleMsgIdle) {
        post_event(handle_channel_msg, c);
        c->ibuf.handling_msg = HandleMsgTriggered;
    }
}
开发者ID:WindRiver-OpenSourceLabs,项目名称:wr-appcloud-core,代码行数:10,代码来源:channel_np.c


示例12: seek

static audio_result_t seek(void* _minfo, long position_in_ms)
{
  ogg_t* minfo = (ogg_t*) _minfo;
  if (minfo->can_seek) {
    post_event(minfo->player_control, INTERNAL_CMD_SEEK, position_in_ms);
    return AUDIO_OK;
  } else {
    return AUDIO_NOT_SUPPORTED;
  }
}
开发者ID:hdijkema,项目名称:BackToBasics,代码行数:10,代码来源:ogg.c


示例13: virtual_stream_get_data

int virtual_stream_get_data(VirtualStream * stream, char * buf, size_t buf_size, size_t * data_size, int * eos) {
    size_t len;

    assert(stream->magic == STREAM_MAGIC);
    len = (stream->buf_inp + stream->buf_len - stream->buf_out) % stream->buf_len;

    if (len > buf_size) {
        len = buf_size;
        *eos = 0;
    }
    else {
        *eos = stream->eos_inp;
    }
    *data_size = len;
    if (*eos) stream->eos_out = 1;
    if (stream->buf_out + len <= stream->buf_len) {
        memcpy(buf, stream->buf + stream->buf_out, len);
    }
    else {
        size_t x = stream->buf_len - stream->buf_out;
        size_t y = len - x;
        memcpy(buf, stream->buf + stream->buf_out, x);
        memcpy(buf + x, stream->buf, y);
    }
    if (stream->access & VS_ENABLE_REMOTE_WRITE) {
        LINK * l;
        for (l = stream->clients.next; l != &stream->clients; l = l->next) {
            StreamClient * client = stream2client(l);
            if (!list_is_empty(&client->write_requests)) {
                WriteRequest * r = client2write_request(client->write_requests.next);
                size_t done = 0;
                int error = 0;
                if (virtual_stream_add_data(client->stream, r->data + r->offs,
                    r->size - r->offs, &done, r->eos) < 0) error = errno;
                r->offs += done;
                if (error || r->offs >= r->size) {
                    delete_write_request(r, error);
                }
                while (error && !list_is_empty(&client->write_requests)) {
                    r = client2write_request(client->write_requests.next);
                    delete_write_request(r, ERR_COMMAND_CANCELLED);
                }
            }
        }
    }
    if ((stream->access & VS_ENABLE_REMOTE_READ) == 0 && len > 0) {
        stream->buf_out = (stream->buf_out + len) % stream->buf_len;
        assert(!*eos || stream->buf_out == stream->buf_inp);
        if (!stream->space_available_posted) {
            post_event(notify_space_available, stream);
            stream->space_available_posted = 1;
        }
    }
    return 0;
}
开发者ID:eclipse,项目名称:tcf.agent,代码行数:55,代码来源:streamsservice.c


示例14: execOutput

static void execOutput(acalcoutRecord *pcalc)
{
	long		status;

	/* Determine output data */
	if (aCalcoutRecordDebug >= 10)
		printf("acalcoutRecord(%s):execOutput:entry\n", pcalc->name);

	/* Check to see what to do if INVALID */
	if (pcalc->nsev < INVALID_ALARM) {
		/* Output the value */
		if (aCalcoutRecordDebug >= 10)
			printf("acalcoutRecord(%s):execOutput:calling writeValue\n", pcalc->name);
		status = writeValue(pcalc);
		/* post event if output event != 0 */
		if (pcalc->oevt > 0) post_event((int)pcalc->oevt);
	} else {
		switch (pcalc->ivoa) {
		case menuIvoaContinue_normally:
			/* write the new value */
			status = writeValue(pcalc);
			/* post event if output event != 0 */
			if (pcalc->oevt > 0) post_event((int)pcalc->oevt);
			break;

		case menuIvoaDon_t_drive_outputs:
			break;

		case menuIvoaSet_output_to_IVOV:
			pcalc->oval=pcalc->ivov;
			status = writeValue(pcalc);
			/* post event if output event != 0 */
			if (pcalc->oevt > 0) post_event((int)pcalc->oevt);
			break;

		default:
			status=-1;
			recGblRecordError(S_db_badField,(void *)pcalc,
				"acalcout:process Illegal IVOA field");
		}
	} 
}
开发者ID:ukaea,项目名称:epics,代码行数:42,代码来源:aCalcoutRecord.c


示例15: CtrlHandler

static BOOL CtrlHandler(DWORD ctrl) {
    switch(ctrl) {
    case CTRL_C_EVENT:
    case CTRL_CLOSE_EVENT:
    case CTRL_BREAK_EVENT:
    case CTRL_SHUTDOWN_EVENT:
        post_event(shutdown_event, NULL);
        return TRUE;
    }
    return FALSE;
}
开发者ID:wind-river-cdt,项目名称:tcf.agent,代码行数:11,代码来源:main.c


示例16: panel_close_callback

int panel_close_callback(int event, struct widget *from, s32 param, int owner, const u8 *data) {
  struct widget *p;
  p = from->callback_owner;
  if (p && event==PG_WE_ACTIVATE) {

    /* Send a close event from the panel widget */
    post_event(PG_WE_CLOSE, p, 0,0,NULL);
  
  }
  return 1; /* Absorb event */
}
开发者ID:static-void,项目名称:picogui,代码行数:11,代码来源:panel.c


示例17: check_safe_events

static void check_safe_events(Context * ctx) {
    assert(ctx->stopped || ctx->exited);
    assert(ctx->pending_safe_event);
    assert(safe_event_list != NULL);
    assert(safe_event_pid_count > 0);
    ctx->pending_safe_event = 0;
    safe_event_pid_count--;
    if (safe_event_pid_count == 0) {
        post_event(run_safe_events, (void *)++safe_event_generation);
    }
}
开发者ID:coachal,项目名称:TCF-Target-Agent-for-ARM,代码行数:11,代码来源:runctrl.c


示例18: TraceLogger

boost::statechart::result PlayingTurn::react(const TurnUpdate& msg) {
    TraceLogger(FSM) << "(HumanClientFSM) PlayingTurn.TurnUpdate";

     Client().GetClientUI().GetMessageWnd()->HandleLogMessage(UserString("ERROR_EARLY_TURN_UPDATE") + "\n");

    // need to re-post the game start message to be re-handled after
    // transitioning into WaitingForTurnData
    post_event(msg);

    return transit<WaitingForTurnData>();
}
开发者ID:matt474,项目名称:freeorion,代码行数:11,代码来源:HumanClientFSM.cpp


示例19: task_delete_hook

static void task_delete_hook(WIND_TCB * tcb) {
    if (tcb != main_thread && taskIdCurrent != main_thread) {
        EventInfo info;
        VX_COUNTING_SEMAPHORE(signal_mem);
        info.signal = semCInitialize(signal_mem, SEM_Q_FIFO, 0);
        info.pid = (UINT32)tcb;
        post_event(task_delete_event, &info);
        semTake(info.signal, WAIT_FOREVER);
        semTerminate(info.signal);
    }
}
开发者ID:wind-river-cdt,项目名称:tcf.agent,代码行数:11,代码来源:waitpid.c


示例20: cisco_dissector

static int
cisco_dissector(orchids_t *ctx, mod_entry_t *mod, event_t *e, void *data)
{
  DebugLog(DF_MOD, DS_DEBUG, "cisco_dissector()\n");

  /* dissect event top attribute here, and add them to it */

  /* then, post resulting event */
  post_event(ctx, mod, e);

  return (0);
}
开发者ID:triplekill,项目名称:orchids,代码行数:12,代码来源:mod_cisco.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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