这篇教程C++ GET_STATE函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GET_STATE函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_STATE函数的具体用法?C++ GET_STATE怎么用?C++ GET_STATE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GET_STATE函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: if//.........这里部分代码省略......... { if(ui.label_deathOverlay->isHidden()) { ui.label_deathOverlay->show(); ui.frame_top->hide(); ui.label_aim->hide(); ui.label_firingMode->hide(); ui.frame_bottom->hide(); schedulingHud.hide(); ui.progressBar_health->hide(); ui.progressBar_ammo->hide(); } } else { if(!ui.label_deathOverlay->isHidden()) { ui.label_deathOverlay->hide(); ui.frame_top->show(); ui.label_aim->show(); ui.label_firingMode->show(); ui.frame_bottom->show(); schedulingHud.show(); } } // // Update Scoreboard // scoreboard.refresh(); if(ptr_player->detectedAsDead || GET_STATE() == STATE_GAMEOVER || ptr_player->showScoreboard) { if(ptr_player->showScoreboard) scoreboardFade = 0.0f; // Show scoreboard if delay has expired if(scoreboardFade > 0.0f) scoreboardFade -= SETTINGS->trueDeltaTime; if(scoreboardFade <= 0.0f) { // Show scoreboard if hidden if(ui.frame_scoreboard->isHidden()) { hudMessage_manager.silenceAllMessages(); ui.frame_scoreboard->show(); ptr_player->isScoreBoardVisible = true; // Hide aim if(!ui.label_aim->isHidden()) { ui.label_aim->hide(); ui.label_firingMode->hide(); } } } } else { // Reset scoreboard timer scoreboardFade = 2.0f; // Hide scoreboard if shown if(!ui.frame_scoreboard->isHidden())
开发者ID:CaterHatterPillar,项目名称:xkill-source,代码行数:67,
示例2: GET_STATEvoid sc_generator::push_state(bool is_system){ state->push_back(real_gen_state()); GET_STATE().system_context = is_system;}
开发者ID:energyfive,项目名称:sc-core,代码行数:5,
示例3: initng_depend_stop_dep_met/* * This will check with plug-ins if dependencies for stop is met. * If this returns FALSE deps for stopping are not met, try again later. * If this returns FAIL stop deps, wont EVER be met, stop trying. */int initng_depend_stop_dep_met(active_db_h * service, int verbose){ active_db_h *currentA = NULL; int count = 0; assert(service); /* * Check so all deps, that needs service, is down. * if there are services depending on this one still running, * return false and still try. */ while_active_db(currentA) { count++; if (service->depend_cache >= count) continue; /* temporary increase depend_cache - will degrese before * reutrn (FALSE) */ service->depend_cache++; if (currentA == service) continue; /* Does service depends on current ?? */ if (initng_depend(currentA, service) == FALSE) continue; switch (GET_STATE(currentA)) { /* if its done, this is perfect */ case IS_DOWN: continue; /* If the dep is failed, continue */ case IS_FAILED: continue; /* BIG TODO. * This is not correct, but if we wait for a service that is * starting to stop, and that service is waiting for this * service to start, until it starts, makes a deadlock. * * Asuming that STARTING services WAITING_FOR_START_DEP are * down for now. */ case IS_STARTING: if (strstr(currentA->current_state->name, "WAITING_FOR_START_DEP")) continue; break; }#ifdef DEBUG /* else RETURN */ if (verbose) D_("still waiting for service %s state %s/n", currentA->name, currentA->current_state->name); else D_("still waiting for service %s state %s/n", currentA->name, currentA->current_state->name);#endif /* no, the dependency are not met YET */ service->depend_cache--; return FALSE; } /* run the global module dep check */ { s_event event; event.event_type = &EVENT_STOP_DEP_MET; event.data = service; initng_event_send(&event); if (event.status == FAILED) { if (verbose) { F_("Service %s can not be started because a " "module (START_DEP_MET) says so./n", service->name); } return FALSE; } } service->depend_cache = 0; return TRUE;}
开发者ID:initng,项目名称:initng,代码行数:94,
示例4: cState_allow_nan_p/* * call-seq: allow_nan? * * Returns true, if NaN, Infinity, and -Infinity should be generated, otherwise * returns false. */static VALUE cState_allow_nan_p(VALUE self){ GET_STATE(self); return state->allow_nan ? Qtrue : Qfalse;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,
示例5: cState_remember/* * call-seq: remember(object) * * Remember _object_, to find out if it was already encountered (if a cyclic * data structure is rendered). */static VALUE cState_remember(VALUE self, VALUE object){ GET_STATE(self); return rb_hash_aset(state->seen, rb_obj_id(object), Qtrue);}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,
示例6: cState_array_nl/* * call-seq: array_nl() * * This string is put at the end of a line that holds a JSON array. */static VALUE cState_array_nl(VALUE self){ GET_STATE(self); return state->array_nl;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:10,
示例7: cState_check_circular_p/* * call-seq: check_circular? * * Returns true, if circular data structures should be checked, * otherwise returns false. */static VALUE cState_check_circular_p(VALUE self){ GET_STATE(self); return state->check_circular ? Qtrue : Qfalse;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,
示例8: cState_quirks_mode_set/* * call-seq: quirks_mode=(enable) * * If set to true, enables the quirks_mode mode. */static VALUE cState_quirks_mode_set(VALUE self, VALUE enable){ GET_STATE(self); state->quirks_mode = RTEST(enable); return Qnil;}
开发者ID:imageoptimiser,项目名称:json,代码行数:11,
示例9: cState_depth/* * call-seq: depth * * This integer returns the current depth of data structure nesting. */static VALUE cState_depth(VALUE self){ GET_STATE(self); return LONG2FIX(state->depth);}
开发者ID:imageoptimiser,项目名称:json,代码行数:10,
示例10: cState_ascii_only_p/* * call-seq: ascii_only? * * Returns true, if NaN, Infinity, and -Infinity should be generated, otherwise * returns false. */static VALUE cState_ascii_only_p(VALUE self){ GET_STATE(self); return state->ascii_only ? Qtrue : Qfalse;}
开发者ID:imageoptimiser,项目名称:json,代码行数:11,
示例11: cState_quirks_mode_p/* * call-seq: quirks_mode? * * Returns true, if quirks mode is enabled. Otherwise returns false. */static VALUE cState_quirks_mode_p(VALUE self){ GET_STATE(self); return state->quirks_mode ? Qtrue : Qfalse;}
开发者ID:imageoptimiser,项目名称:json,代码行数:10,
示例12: cState_max_nesting_set/* * call-seq: max_nesting=(depth) * * This sets the maximum level of data structure nesting in the generated JSON * to the integer depth, max_nesting = 0 if no maximum should be checked. */static VALUE cState_max_nesting_set(VALUE self, VALUE depth){ GET_STATE(self); Check_Type(depth, T_FIXNUM); return state->max_nesting = FIX2LONG(depth);}
开发者ID:imageoptimiser,项目名称:json,代码行数:12,
示例13: cState_array_nl/* * call-seq: array_nl() * * This string is put at the end of a line that holds a JSON array. */static VALUE cState_array_nl(VALUE self){ GET_STATE(self); return state->array_nl ? rb_str_new(state->array_nl, state->array_nl_len) : rb_str_new2("");}
开发者ID:imageoptimiser,项目名称:json,代码行数:10,
示例14: cState_space_before/* * call-seq: space_before() * * This string is used to insert a space before the ':' in JSON objects. */static VALUE cState_space_before(VALUE self){ GET_STATE(self); return state->space_before ? rb_str_new(state->space_before, state->space_before_len) : rb_str_new2("");}
开发者ID:imageoptimiser,项目名称:json,代码行数:10,
示例15: cState_object_nl/* * call-seq: object_nl() * * This string is put at the end of a line that holds a JSON object (or * Hash). */static VALUE cState_object_nl(VALUE self){ GET_STATE(self); return state->object_nl;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,
示例16: cState_buffer_initial_length/* * call-seq: buffer_initial_length * * This integer returns the current inital length of the buffer. */static VALUE cState_buffer_initial_length(VALUE self){ GET_STATE(self); return LONG2FIX(state->buffer_initial_length);}
开发者ID:imageoptimiser,项目名称:json,代码行数:10,
示例17: cState_object_nl_set/* * call-seq: object_nl=(object_nl) * * This string is put at the end of a line that holds a JSON object (or * Hash). */static VALUE cState_object_nl_set(VALUE self, VALUE object_nl){ GET_STATE(self); Check_Type(object_nl, T_STRING); return state->object_nl = object_nl;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:12,
示例18: cState_configure/* * call-seq: configure(opts) * * Configure this State instance with the Hash _opts_, and return * itself. */static VALUE cState_configure(VALUE self, VALUE opts){ VALUE tmp; GET_STATE(self); tmp = rb_convert_type(opts, T_HASH, "Hash", "to_hash"); if (NIL_P(tmp)) tmp = rb_convert_type(opts, T_HASH, "Hash", "to_h"); if (NIL_P(tmp)) { rb_raise(rb_eArgError, "opts has to be hash like or convertable into a hash"); } opts = tmp; tmp = rb_hash_aref(opts, ID2SYM(i_indent)); if (RTEST(tmp)) { unsigned long len; Check_Type(tmp, T_STRING); len = RSTRING_LEN(tmp); state->indent = fstrndup(RSTRING_PTR(tmp), len + 1); state->indent_len = len; } tmp = rb_hash_aref(opts, ID2SYM(i_space)); if (RTEST(tmp)) { unsigned long len; Check_Type(tmp, T_STRING); len = RSTRING_LEN(tmp); state->space = fstrndup(RSTRING_PTR(tmp), len + 1); state->space_len = len; } tmp = rb_hash_aref(opts, ID2SYM(i_space_before)); if (RTEST(tmp)) { unsigned long len; Check_Type(tmp, T_STRING); len = RSTRING_LEN(tmp); state->space_before = fstrndup(RSTRING_PTR(tmp), len + 1); state->space_before_len = len; } tmp = rb_hash_aref(opts, ID2SYM(i_array_nl)); if (RTEST(tmp)) { unsigned long len; Check_Type(tmp, T_STRING); len = RSTRING_LEN(tmp); state->array_nl = fstrndup(RSTRING_PTR(tmp), len + 1); state->array_nl_len = len; } tmp = rb_hash_aref(opts, ID2SYM(i_object_nl)); if (RTEST(tmp)) { unsigned long len; Check_Type(tmp, T_STRING); len = RSTRING_LEN(tmp); state->object_nl = fstrndup(RSTRING_PTR(tmp), len + 1); state->object_nl_len = len; } tmp = ID2SYM(i_max_nesting); state->max_nesting = 100; if (option_given_p(opts, tmp)) { VALUE max_nesting = rb_hash_aref(opts, tmp); if (RTEST(max_nesting)) { Check_Type(max_nesting, T_FIXNUM); state->max_nesting = FIX2LONG(max_nesting); } else { state->max_nesting = 0; } } tmp = ID2SYM(i_depth); state->depth = 0; if (option_given_p(opts, tmp)) { VALUE depth = rb_hash_aref(opts, tmp); if (RTEST(depth)) { Check_Type(depth, T_FIXNUM); state->depth = FIX2LONG(depth); } else { state->depth = 0; } } tmp = ID2SYM(i_buffer_initial_length); if (option_given_p(opts, tmp)) { VALUE buffer_initial_length = rb_hash_aref(opts, tmp); if (RTEST(buffer_initial_length)) { long initial_length; Check_Type(buffer_initial_length, T_FIXNUM); initial_length = FIX2LONG(buffer_initial_length); if (initial_length > 0) state->buffer_initial_length = initial_length; } } tmp = rb_hash_aref(opts, ID2SYM(i_allow_nan)); state->allow_nan = RTEST(tmp); tmp = rb_hash_aref(opts, ID2SYM(i_ascii_only)); state->ascii_only = RTEST(tmp); tmp = rb_hash_aref(opts, ID2SYM(i_quirks_mode)); state->quirks_mode = RTEST(tmp); return self;}
开发者ID:imageoptimiser,项目名称:json,代码行数:96,
示例19: cState_array_nl_set/* * call-seq: array_nl=(array_nl) * * This string is put at the end of a line that holds a JSON array. */static VALUE cState_array_nl_set(VALUE self, VALUE array_nl){ GET_STATE(self); Check_Type(array_nl, T_STRING); return state->array_nl = array_nl;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,
示例20: mArray_json_transfrominline static VALUE mArray_json_transfrom(VALUE self, VALUE Vstate, VALUE Vdepth) { long i, len = RARRAY_LEN(self); VALUE shift, result; long depth = NIL_P(Vdepth) ? 0 : FIX2LONG(Vdepth); VALUE delim = rb_str_new2(","); GET_STATE(Vstate); check_max_nesting(state, depth); if (state->check_circular) { VALUE self_id = rb_obj_id(self); rb_hash_aset(state->seen, self_id, Qtrue); result = rb_str_buf_new(len); if (RSTRING_LEN(state->array_nl)) rb_str_append(delim, state->array_nl); shift = rb_str_times(state->indent, LONG2FIX(depth + 1)); rb_str_buf_cat2(result, "["); OBJ_INFECT(result, self); rb_str_buf_append(result, state->array_nl); for (i = 0; i < len; i++) { VALUE element = RARRAY_PTR(self)[i]; if (RTEST(rb_hash_aref(state->seen, rb_obj_id(element)))) { rb_raise(eCircularDatastructure, "circular data structures not supported!"); } OBJ_INFECT(result, element); if (i > 0) rb_str_buf_append(result, delim); rb_str_buf_append(result, shift); element = rb_funcall(element, i_to_json, 2, Vstate, LONG2FIX(depth + 1)); Check_Type(element, T_STRING); rb_str_buf_append(result, element); } if (RSTRING_LEN(state->array_nl)) { rb_str_buf_append(result, state->array_nl); rb_str_buf_append(result, rb_str_times(state->indent, LONG2FIX(depth))); } rb_str_buf_cat2(result, "]"); rb_hash_delete(state->seen, self_id); } else { result = rb_str_buf_new(len); OBJ_INFECT(result, self); if (RSTRING_LEN(state->array_nl)) rb_str_append(delim, state->array_nl); shift = rb_str_times(state->indent, LONG2FIX(depth + 1)); rb_str_buf_cat2(result, "["); rb_str_buf_append(result, state->array_nl); for (i = 0; i < len; i++) { VALUE element = RARRAY_PTR(self)[i]; OBJ_INFECT(result, element); if (i > 0) rb_str_buf_append(result, delim); rb_str_buf_append(result, shift); element = rb_funcall(element, i_to_json, 2, Vstate, LONG2FIX(depth + 1)); Check_Type(element, T_STRING); rb_str_buf_append(result, element); } rb_str_buf_append(result, state->array_nl); if (RSTRING_LEN(state->array_nl)) { rb_str_buf_append(result, rb_str_times(state->indent, LONG2FIX(depth))); } rb_str_buf_cat2(result, "]"); } return result;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:62,
示例21: cState_max_nesting/* * call-seq: max_nesting * * This integer returns the maximum level of data structure nesting in * the generated JSON, max_nesting = 0 if no maximum is checked. */static VALUE cState_max_nesting(VALUE self){ GET_STATE(self); return LONG2FIX(state->max_nesting);}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,
示例22: cState_indent/* * call-seq: indent() * * This string is used to indent levels in the JSON text. */static VALUE cState_indent(VALUE self){ GET_STATE(self); return state->indent;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:10,
示例23: cState_seen_p/* * call-seq: seen?(object) * * Returns _true_, if _object_ was already seen during this generating run. */static VALUE cState_seen_p(VALUE self, VALUE object){ GET_STATE(self); return rb_hash_aref(state->seen, rb_obj_id(object));}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:10,
示例24: cState_indent_set/* * call-seq: indent=(indent) * * This string is used to indent levels in the JSON text. */static VALUE cState_indent_set(VALUE self, VALUE indent){ GET_STATE(self); Check_Type(indent, T_STRING); return state->indent = indent;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,
示例25: cState_forget/* * call-seq: forget(object) * * Forget _object_ for this generating run. */static VALUE cState_forget(VALUE self, VALUE object){ GET_STATE(self); return rb_hash_delete(state->seen, rb_obj_id(object));}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:10,
示例26: cState_space_before/* * call-seq: space_before() * * This string is used to insert a space before the ':' in JSON objects. */static VALUE cState_space_before(VALUE self){ GET_STATE(self); return state->space_before;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:10,
示例27: cState_space_before_set/* * call-seq: space_before=(space_before) * * This string is used to insert a space before the ':' in JSON objects. */static VALUE cState_space_before_set(VALUE self, VALUE space_before){ GET_STATE(self); Check_Type(space_before, T_STRING); return state->space_before = space_before;}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:11,
示例28: cState_indent/* * call-seq: indent() * * This string is used to indent levels in the JSON text. */static VALUE cState_indent(VALUE self){ GET_STATE(self); return state->indent ? rb_str_new(state->indent, state->indent_len) : rb_str_new2("");}
开发者ID:bradleesand,项目名称:json,代码行数:10,
示例29: cState_generate/* * call-seq: generate(obj) * * Generates a valid JSON document from object +obj+ and returns the * result. If no valid JSON document can be created this method raises a * GeneratorError exception. */static VALUE cState_generate(VALUE self, VALUE obj){ VALUE result = cState_partial_generate(self, obj); GET_STATE(self); return result;}
开发者ID:0x00xw,项目名称:json-2,代码行数:13,
注:本文中的GET_STATE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GET_STR函数代码示例 C++ GET_SLOT函数代码示例 |