本文整理汇总了C++中build函数的典型用法代码示例。如果您正苦于以下问题:C++ build函数的具体用法?C++ build怎么用?C++ build使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了build函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: NumArray
NumArray(vector<int> nums) {
head = build(nums,0,nums.size()-1,head);
}
开发者ID:FeibHwang,项目名称:OJ-Leetcode,代码行数:3,代码来源:307_Range_Sum_Query_Mutable.cpp
示例2: setIsChrome
AORemoteCtrl::AORemoteCtrl()
{
setIsChrome(TRUE);
build();
setFocusRoot(TRUE);
}
开发者ID:ArminW,项目名称:imprudence,代码行数:6,代码来源:aoremotectrl.cpp
示例3: SFBerlekamp
void SFBerlekamp(vec_ZZ_pX& factors, const ZZ_pX& ff, long verbose)
{
ZZ_pX f = ff;
if (!IsOne(LeadCoeff(f)))
LogicError("SFBerlekamp: bad args");
if (deg(f) == 0) {
factors.SetLength(0);
return;
}
if (deg(f) == 1) {
factors.SetLength(1);
factors[0] = f;
return;
}
double t;
const ZZ& p = ZZ_p::modulus();
long n = deg(f);
ZZ_pXModulus F;
build(F, f);
ZZ_pX g, h;
if (verbose) { cerr << "computing X^p..."; t = GetTime(); }
PowerXMod(g, p, F);
if (verbose) { cerr << (GetTime()-t) << "\n"; }
vec_long D;
long r;
vec_ZZVec M;
if (verbose) { cerr << "building matrix..."; t = GetTime(); }
BuildMatrix(M, n, g, F, verbose);
if (verbose) { cerr << (GetTime()-t) << "\n"; }
if (verbose) { cerr << "diagonalizing..."; t = GetTime(); }
NullSpace(r, D, M, verbose);
if (verbose) { cerr << (GetTime()-t) << "\n"; }
if (verbose) cerr << "number of factors = " << r << "\n";
if (r == 1) {
factors.SetLength(1);
factors[0] = f;
return;
}
if (verbose) { cerr << "factor extraction..."; t = GetTime(); }
vec_ZZ_p roots;
RandomBasisElt(g, D, M);
MinPolyMod(h, g, F, r);
if (deg(h) == r) M.kill();
FindRoots(roots, h);
FindFactors(factors, f, g, roots);
ZZ_pX g1;
vec_ZZ_pX S, S1;
long i;
while (factors.length() < r) {
if (verbose) cerr << "+";
RandomBasisElt(g, D, M);
S.kill();
for (i = 0; i < factors.length(); i++) {
const ZZ_pX& f = factors[i];
if (deg(f) == 1) {
append(S, f);
continue;
}
build(F, f);
rem(g1, g, F);
if (deg(g1) <= 0) {
append(S, f);
continue;
}
MinPolyMod(h, g1, F, min(deg(f), r-factors.length()+1));
FindRoots(roots, h);
S1.kill();
FindFactors(S1, f, g1, roots);
append(S, S1);
}
swap(factors, S);
}
if (verbose) { cerr << (GetTime()-t) << "\n"; }
if (verbose) {
cerr << "degrees:";
long i;
//.........这里部分代码省略.........
开发者ID:tell,项目名称:ntl-unix,代码行数:101,代码来源:ZZ_pXFactoring.cpp
示例4: m_doc_file
DocParser::DocParser(const QString &name)
: m_doc_file(name),
m_dom(0) {
build();
}
开发者ID:Smarre,项目名称:qtjambi,代码行数:5,代码来源:docparser.cpp
示例5: _name
Entity::Entity(const std::string& name, const std::string& type, Engine* engine)
: _name(name), _type(type), _engine(engine), _id(0)
{
build();
}
开发者ID:scottbuettner,项目名称:tehrpg,代码行数:5,代码来源:rpgentity.cpp
示例6: _isLocked
MM_BEGIN_NAMESPACE
MShape::MShape(const QVector<QPointF>& vertices_) : _isLocked(false) {
setVertices(vertices_);
build();
}
开发者ID:vliaskov,项目名称:mapmap,代码行数:6,代码来源:Shape.cpp
示例7: init
void init(int n){root=build(1, n);}
开发者ID:cjsoft,项目名称:inasdfz,代码行数:1,代码来源:name.cpp
示例8: do_build_assign_ref
static void
do_build_assign_ref (tree fndecl)
{
tree parm = TREE_CHAIN (DECL_ARGUMENTS (fndecl));
tree compound_stmt;
compound_stmt = begin_compound_stmt (/*has_no_scope=*/false);
parm = convert_from_reference (parm);
if (TYPE_HAS_TRIVIAL_ASSIGN_REF (current_class_type)
&& is_empty_class (current_class_type))
/* Don't copy the padding byte; it might not have been allocated
if *this is a base subobject. */;
else if (TYPE_HAS_TRIVIAL_ASSIGN_REF (current_class_type))
{
tree t = build (MODIFY_EXPR, void_type_node, current_class_ref, parm);
finish_expr_stmt (t);
}
else
{
tree fields;
int cvquals = cp_type_quals (TREE_TYPE (parm));
int i;
/* Assign to each of the direct base classes. */
for (i = 0; i < CLASSTYPE_N_BASECLASSES (current_class_type); ++i)
{
tree binfo;
tree converted_parm;
binfo = BINFO_BASETYPE (TYPE_BINFO (current_class_type), i);
/* We must convert PARM directly to the base class
explicitly since the base class may be ambiguous. */
converted_parm = build_base_path (PLUS_EXPR, parm, binfo, 1);
/* Call the base class assignment operator. */
finish_expr_stmt
(build_special_member_call (current_class_ref,
ansi_assopname (NOP_EXPR),
build_tree_list (NULL_TREE,
converted_parm),
binfo,
LOOKUP_NORMAL | LOOKUP_NONVIRTUAL));
}
/* Assign to each of the non-static data members. */
for (fields = TYPE_FIELDS (current_class_type);
fields;
fields = TREE_CHAIN (fields))
{
tree comp = current_class_ref;
tree init = parm;
tree field = fields;
tree expr_type;
int quals;
if (TREE_CODE (field) != FIELD_DECL || DECL_ARTIFICIAL (field))
continue;
expr_type = TREE_TYPE (field);
if (CP_TYPE_CONST_P (expr_type))
{
error ("non-static const member `%#D', can't use default assignment operator", field);
continue;
}
else if (TREE_CODE (expr_type) == REFERENCE_TYPE)
{
error ("non-static reference member `%#D', can't use default assignment operator", field);
continue;
}
if (DECL_NAME (field))
{
if (VFIELD_NAME_P (DECL_NAME (field)))
continue;
/* True for duplicate members. */
if (IDENTIFIER_CLASS_VALUE (DECL_NAME (field)) != field)
continue;
}
else if (ANON_AGGR_TYPE_P (expr_type) && TYPE_FIELDS (expr_type))
/* Just use the field; anonymous types can't have
nontrivial copy ctors or assignment ops. */;
else
continue;
comp = build (COMPONENT_REF, TREE_TYPE (field), comp, field);
/* Compute the type of init->field */
quals = cvquals;
if (DECL_MUTABLE_P (field))
quals &= ~TYPE_QUAL_CONST;
expr_type = cp_build_qualified_type (expr_type, quals);
init = build (COMPONENT_REF, expr_type, init, field);
if (DECL_NAME (field))
init = build_modify_expr (comp, NOP_EXPR, init);
else
init = build (MODIFY_EXPR, TREE_TYPE (comp), comp, init);
finish_expr_stmt (init);
//.........这里部分代码省略.........
开发者ID:Fokycnuk,项目名称:gcc,代码行数:101,代码来源:method.c
示例9: RELEASE_ASSERT
void BinarySwitch::build(unsigned start, bool hardStart, unsigned end)
{
unsigned size = end - start;
RELEASE_ASSERT(size);
// This code uses some random numbers to keep things balanced. It's important to keep in mind
// that this does not improve average-case throughput under the assumption that all cases fire
// with equal probability. It just ensures that there will not be some switch structure that
// when combined with some input will always produce pathologically good or pathologically bad
// performance.
const unsigned leafThreshold = 3;
if (size <= leafThreshold) {
// It turns out that for exactly three cases or less, it's better to just compare each
// case individually. This saves 1/6 of a branch on average, and up to 1/3 of a branch in
// extreme cases where the divide-and-conquer bottoms out in a lot of 3-case subswitches.
//
// This assumes that we care about the cost of hitting some case more than we care about
// bottoming out in a default case. I believe that in most places where we use switch
// statements, we are more likely to hit one of the cases than we are to fall through to
// default. Intuitively, if we wanted to improve the performance of default, we would
// reduce the value of leafThreshold to 2 or even to 1. See below for a deeper discussion.
bool allConsecutive = false;
if ((hardStart || (start && m_cases[start - 1].value == m_cases[start].value - 1))
&& start + size < m_cases.size()
&& m_cases[start + size - 1].value == m_cases[start + size].value - 1) {
allConsecutive = true;
for (unsigned i = 0; i < size - 1; ++i) {
if (m_cases[i].value + 1 != m_cases[i + 1].value) {
allConsecutive = false;
break;
}
}
}
Vector<unsigned, 3> localCaseIndices;
for (unsigned i = 0; i < size; ++i)
localCaseIndices.append(start + i);
std::random_shuffle(
localCaseIndices.begin(), localCaseIndices.end(),
[this] (unsigned n) {
// We use modulo to get a random number in the range we want fully knowing that
// this introduces a tiny amount of bias, but we're fine with such tiny bias.
return m_weakRandom.getUint32() % n;
});
for (unsigned i = 0; i < size - 1; ++i) {
m_branches.append(BranchCode(NotEqualToPush, localCaseIndices[i]));
m_branches.append(BranchCode(ExecuteCase, localCaseIndices[i]));
m_branches.append(BranchCode(Pop));
}
if (!allConsecutive)
m_branches.append(BranchCode(NotEqualToFallThrough, localCaseIndices.last()));
m_branches.append(BranchCode(ExecuteCase, localCaseIndices.last()));
return;
}
// There are two different strategies we could consider here:
//
// Isolate median and split: pick a median and check if the comparison value is equal to it;
// if so, execute the median case. Otherwise check if the value is less than the median, and
// recurse left or right based on this. This has two subvariants: we could either first test
// equality for the median and then do the less-than, or we could first do the less-than and
// then check equality on the not-less-than path.
//
// Ignore median and split: do a less-than comparison on a value that splits the cases in two
// equal-sized halves. Recurse left or right based on the comparison. Do not test for equality
// against the median (or anything else); let the recursion handle those equality comparisons
// once we bottom out in a list that case 3 cases or less (see above).
//
// I'll refer to these strategies as Isolate and Ignore. I initially believed that Isolate
// would be faster since it leads to less branching for some lucky cases. It turns out that
// Isolate is almost a total fail in the average, assuming all cases are equally likely. How
// bad Isolate is depends on whether you believe that doing two consecutive branches based on
// the same comparison is cheaper than doing the compare/branches separately. This is
// difficult to evaluate. For small immediates that aren't blinded, we just care about
// avoiding a second compare instruction. For large immediates or when blinding is in play, we
// also care about the instructions used to materialize the immediate a second time. Isolate
// can help with both costs since it involves first doing a < compare+branch on some value,
// followed by a == compare+branch on the same exact value (or vice-versa). Ignore will do a <
// compare+branch on some value, and then the == compare+branch on that same value will happen
// much later.
//
// To evaluate these costs, I wrote the recurrence relation for Isolate and Ignore, assuming
// that ComparisonCost is the cost of a compare+branch and ChainedComparisonCost is the cost
// of a compare+branch on some value that you've just done another compare+branch for. These
// recurrence relations compute the total cost incurred if you executed the switch statement
// on each matching value. So the average cost of hitting some case can be computed as
// Isolate[n]/n or Ignore[n]/n, respectively for the two relations.
//
// Isolate[1] = ComparisonCost
// Isolate[2] = (2 + 1) * ComparisonCost
// Isolate[3] = (3 + 2 + 1) * ComparisonCost
//.........这里部分代码省略.........
开发者ID:cheekiatng,项目名称:webkit,代码行数:101,代码来源:BinarySwitch.cpp
示例10: do_build_copy_constructor
static void
do_build_copy_constructor (tree fndecl)
{
tree parm = FUNCTION_FIRST_USER_PARM (fndecl);
tree t;
parm = convert_from_reference (parm);
if (TYPE_HAS_TRIVIAL_INIT_REF (current_class_type)
&& is_empty_class (current_class_type))
/* Don't copy the padding byte; it might not have been allocated
if *this is a base subobject. */;
else if (TYPE_HAS_TRIVIAL_INIT_REF (current_class_type))
{
t = build (INIT_EXPR, void_type_node, current_class_ref, parm);
finish_expr_stmt (t);
}
else
{
tree fields = TYPE_FIELDS (current_class_type);
int n_bases = CLASSTYPE_N_BASECLASSES (current_class_type);
tree binfos = TYPE_BINFO_BASETYPES (current_class_type);
tree member_init_list = NULL_TREE;
int cvquals = cp_type_quals (TREE_TYPE (parm));
int i;
/* Initialize all the base-classes with the parameter converted
to their type so that we get their copy constructor and not
another constructor that takes current_class_type. We must
deal with the binfo's directly as a direct base might be
inaccessible due to ambiguity. */
for (t = CLASSTYPE_VBASECLASSES (current_class_type); t;
t = TREE_CHAIN (t))
{
tree binfo = TREE_VALUE (t);
member_init_list
= tree_cons (binfo,
build_tree_list (NULL_TREE,
build_base_path (PLUS_EXPR, parm,
binfo, 1)),
member_init_list);
}
for (i = 0; i < n_bases; ++i)
{
tree binfo = TREE_VEC_ELT (binfos, i);
if (TREE_VIA_VIRTUAL (binfo))
continue;
member_init_list
= tree_cons (binfo,
build_tree_list (NULL_TREE,
build_base_path (PLUS_EXPR, parm,
binfo, 1)),
member_init_list);
}
for (; fields; fields = TREE_CHAIN (fields))
{
tree init = parm;
tree field = fields;
tree expr_type;
if (TREE_CODE (field) != FIELD_DECL)
continue;
expr_type = TREE_TYPE (field);
if (DECL_NAME (field))
{
if (VFIELD_NAME_P (DECL_NAME (field)))
continue;
/* True for duplicate members. */
if (IDENTIFIER_CLASS_VALUE (DECL_NAME (field)) != field)
continue;
}
else if (ANON_AGGR_TYPE_P (expr_type) && TYPE_FIELDS (expr_type))
/* Just use the field; anonymous types can't have
nontrivial copy ctors or assignment ops. */;
else
continue;
/* Compute the type of "init->field". If the copy-constructor
parameter is, for example, "const S&", and the type of
the field is "T", then the type will usually be "const
T". (There are no cv-qualified variants of reference
types.) */
if (TREE_CODE (expr_type) != REFERENCE_TYPE)
{
int quals = cvquals;
if (DECL_MUTABLE_P (field))
quals &= ~TYPE_QUAL_CONST;
expr_type = cp_build_qualified_type (expr_type, quals);
}
init = build (COMPONENT_REF, expr_type, init, field);
init = build_tree_list (NULL_TREE, init);
//.........这里部分代码省略.........
开发者ID:Fokycnuk,项目名称:gcc,代码行数:101,代码来源:method.c
示例11: build
// On idle things, we don't want to do shit in interrupts
// don't queue gcodes in this
void Panel::on_idle(void *argument)
{
if (this->start_up) {
this->lcd->init();
Version v;
string build(v.get_build());
string date(v.get_build_date());
this->lcd->clear();
this->lcd->setCursor(0, 0); this->lcd->printf("Welcome to Smoothie");
this->lcd->setCursor(0, 1); this->lcd->printf("%s", build.substr(0, 20).c_str());
this->lcd->setCursor(0, 2); this->lcd->printf("%s", date.substr(0, 20).c_str());
this->lcd->setCursor(0, 3); this->lcd->printf("Please wait....");
if (this->lcd->hasGraphics()) {
this->lcd->bltGlyph(24, 40, ohw_logo_antipixel_width, ohw_logo_antipixel_height, ohw_logo_antipixel_bits);
}
this->lcd->on_refresh(true); // tell lcd to display now
// Default top screen
this->top_screen= new MainMenuScreen();
this->custom_screen->set_parent(this->top_screen);
this->start_up = false;
return;
}
MainMenuScreen *mms= static_cast<MainMenuScreen*>(this->top_screen);
// after being idle for a while switch to Watch screen
if (this->current_screen != NULL && this->idle_time > this->current_screen->idle_timeout_secs()*20) {
this->idle_time = 0;
if (mms->watch_screen != this->current_screen) {
this->enter_screen(mms->watch_screen);
// TODO do we need to reset any state?
}
return;
}
if(current_screen == NULL && this->idle_time > 20*4) {
this->enter_screen(mms->watch_screen);
return;
}
if(this->do_encoder) {
this->do_encoder= false;
encoder_check(0);
}
if (this->do_buttons) {
// we don't want to do SPI in interrupt mode
this->do_buttons = false;
// read the actual buttons
int but = lcd->readButtons();
if (but != 0) {
this->idle_time = 0;
if(current_screen == NULL) {
// we were in startup screen so go to watch screen
this->enter_screen(mms->watch_screen);
return;
}
}
// fire events if the buttons are active and debounce is satisfied
this->up_button.check_signal(but & BUTTON_UP);
this->down_button.check_signal(but & BUTTON_DOWN);
this->back_button.check_signal(but & BUTTON_LEFT);
this->click_button.check_signal(but & BUTTON_SELECT);
this->pause_button.check_signal(but & BUTTON_PAUSE);
}
// If we are in menu mode and the position has changed
if ( this->mode == MENU_MODE && this->counter_change() ) {
this->menu_update();
}
// If we are in control mode
if ( this->mode == CONTROL_MODE && this->counter_change() ) {
this->control_value_update();
}
// If we must refresh
if ( this->refresh_flag ) {
this->refresh_flag = false;
if (this->current_screen != NULL) {
this->current_screen->on_refresh();
this->lcd->on_refresh();
}
}
}
开发者ID:catmaker,项目名称:delta-bob-cat,代码行数:93,代码来源:Panel.cpp
示例12: build
void deltas_sector::operator()
(
signal_& vi__io,
signal_& hi__io,
signal_& ci__io,
signal_& si__io,
signal_& ph_match__io,
signal_& th_match__io,
signal_& th_match11__io,
signal_& cpat_match__io,
signal_& ph_q__io,
signal_& th_window__io,
signal_& phi__io,
signal_& theta__io,
signal_& cpattern__io,
signal_& delta_ph__io,
signal_& delta_th__io,
signal_& sign_ph__io,
signal_& sign_th__io,
signal_& rank__io,
signal_& vir__io,
signal_& hir__io,
signal_& cir__io,
signal_& sir__io,
signal_& clk__io
)
{
if (!built)
{
seg_ch = 2;
bw_ph = 8;
bw_th = 7;
bw_fph = 12;
bw_fth = 8;
bw_wg = 7;
bw_ds = 7;
bw_hs = 8;
pat_w_st3 = 3;
pat_w_st1 = pat_w_st3 + 1;
full_pat_w_st3 = (1 << (pat_w_st3+1)) - 1;
full_pat_w_st1 = (1 << (pat_w_st1+1)) - 1;
padding_w_st1 = full_pat_w_st1 / 2;
padding_w_st3 = full_pat_w_st3 / 2;
red_pat_w_st3 = pat_w_st3 * 2 + 1;
red_pat_w_st1 = pat_w_st1 * 2 + 1;
fold = 4;
th_ch11 = seg_ch*seg_ch;
bw_q = 4;
bw_addr = 7;
ph_raw_w = (1 << pat_w_st3) * 15;
th_raw_w = (1 << bw_th);
max_drift = 3;
bw_phi = 12;
bw_eta = 7;
ph_hit_w = 40+4;
ph_hit_w20 = ph_hit_w;
ph_hit_w10 = 20+4;
th_hit_w = 56 + 8;
endcap = 1;
n_strips = (station <= 1 && cscid <= 2) ? 64 :
(station <= 1 && cscid >= 6) ? 64 : 80;
n_wg = (station <= 1 && cscid <= 3) ? 48 :
(station <= 1 && cscid >= 6) ? 32 :
(station == 2 && cscid <= 3) ? 112 :
(station >= 3 && cscid <= 3) ? 96 : 64;
th_coverage = (station <= 1 && cscid <= 2) ? 45 :
(station <= 1 && cscid >= 6) ? 27 :
(station <= 1 && cscid >= 3) ? 39 :
(station == 2 && cscid <= 2) ? 43 :
(station == 2 && cscid >= 3) ? 56 :
(station == 3 && cscid <= 2) ? 34 :
(station == 3 && cscid >= 3) ? 52 :
(station == 4 && cscid <= 2) ? 28 :
(station == 4 && cscid >= 3) ? 50 : 0;
ph_coverage = (station <= 1 && cscid >= 6) ? 15 : //30 :
(station >= 2 && cscid <= 2) ? 40 : 20;
th_ch = (station <= 1 && cscid <= 2) ? (seg_ch*seg_ch) : seg_ch;
ph_reverse = (endcap == 1 && station >= 3) ? 1 :
(endcap == 2 && station < 3) ? 1 : 0;
th_mem_sz = (1 << bw_addr);
th_corr_mem_sz = (1 << bw_addr);
mult_bw = bw_fph + 11;
ph_zone_bnd1 = (station <= 1 && cscid <= 2) ? 41 :
(station == 2 && cscid <= 2) ? 41 :
(station == 2 && cscid > 2) ? 87 :
(station == 3 && cscid > 2) ? 49 :
(station == 4 && cscid > 2) ? 49 : 127;
ph_zone_bnd2 = (station == 3 && cscid > 2) ? 87 : 127;
zone_overlap = 2;
bwr = 6;
bpow = 6;
cnr = (1 << bpow);
cnrex = ph_raw_w;
seg1 = me11 ? th_ch11 : seg_ch;
build();
//[zone][pattern_num][station 0-3]
vi.attach(vi__io);
hi.attach(hi__io);
ci.attach(ci__io);
si.attach(si__io);
//.........这里部分代码省略.........
开发者ID:dcurry09,项目名称:RPC,代码行数:101,代码来源:deltas_sector.cpp
示例13: build
twidget* tbuilder_viewport::build() const
{
return build(treplacements());
}
开发者ID:SkyPrayerStudio,项目名称:War-Of-Kingdom,代码行数:4,代码来源:viewport.cpp
示例14: Line
Line(Point &p, Point &q) : _p(p), _q(q) { build(); }
开发者ID:jaidTw,项目名称:CSU0018,代码行数:1,代码来源:DivideandConquer.cpp
示例15: build
twindow* ttitle_screen::build_window(CVideo& video)
{
return build(video, get_id(TITLE_SCREEN));
}
开发者ID:oys0317,项目名称:opensanguo,代码行数:4,代码来源:title_screen.cpp
示例16: Triangle
Triangle(Point left, Point right, Point top) : _l(left), _r(right), _t(top), _left(Line(left, top)), _right(Line(right, top)) { build(); }
开发者ID:jaidTw,项目名称:CSU0018,代码行数:1,代码来源:DivideandConquer.cpp
示例17: build
void BookmarksToolBar::setRootIndex(const QModelIndex &index)
{
m_root = index;
build();
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:5,代码来源:bookmarks.cpp
示例18: transportProcessMessage
//.........这里部分代码省略.........
if (_transportSM.findingParentNode) { // only process if find parent active
// Reply to a I_FIND_PARENT_REQUEST message. Check if the distance is shorter than we already have.
uint8_t distance = _msg.getByte();
if (isValidDistance(distance)) {
distance++; // Distance to gateway is one more for us w.r.t. parent
// update settings if distance shorter or preferred parent found
if (((isValidDistance(distance) && distance < _transportConfig.distanceGW) || (!_autoFindParent &&
sender == (uint8_t)MY_PARENT_NODE_ID)) && !_transportSM.preferredParentFound) {
// Found a neighbor closer to GW than previously found
if (!_autoFindParent && sender == (uint8_t)MY_PARENT_NODE_ID) {
_transportSM.preferredParentFound = true;
TRANSPORT_DEBUG(PSTR("TSF:MSG:FPAR PREF\n")); // find parent, preferred parent found
}
_transportConfig.distanceGW = distance;
_transportConfig.parentNodeId = sender;
TRANSPORT_DEBUG(PSTR("TSF:MSG:FPAR OK,ID=%d,D=%d\n"), _transportConfig.parentNodeId,
_transportConfig.distanceGW);
}
}
} else {
TRANSPORT_DEBUG(PSTR("!TSF:MSG:FPAR INACTIVE\n")); // find parent response received, but inactive
}
return;
#endif
}
#endif
// general
if (type == I_PING) {
TRANSPORT_DEBUG(PSTR("TSF:MSG:PINGED,ID=%d,HP=%d\n"), sender, _msg.getByte()); // node pinged
#if defined(MY_GATEWAY_FEATURE) && (F_CPU>16000000)
// delay for fast GW and slow nodes
delay(5);
#endif
(void)transportRouteMessage(build(_msgTmp, sender, NODE_SENSOR_ID, C_INTERNAL,
I_PONG).set((uint8_t)1));
return; // no further processing required
}
if (type == I_PONG) {
if (_transportSM.pingActive) {
_transportSM.pingActive = false;
_transportSM.pingResponse = _msg.getByte();
TRANSPORT_DEBUG(PSTR("TSF:MSG:PONG RECV,HP=%d\n"), _transportSM.pingResponse); // pong received
} else {
TRANSPORT_DEBUG(PSTR("!TSF:MSG:PONG RECV,INACTIVE\n")); // pong received, but !pingActive
}
return; // no further processing required
}
if (_processInternalMessages()) {
return; // no further processing required
}
} else if (command == C_STREAM) {
#if defined(MY_OTA_FIRMWARE_FEATURE)
if(firmwareOTAUpdateProcess()) {
return; // OTA FW update processing indicated no further action needed
}
#endif
}
} else {
TRANSPORT_DEBUG(
PSTR("TSF:MSG:ACK\n")); // received message is ACK, no internal processing, handover to msg callback
}
#if defined(MY_GATEWAY_FEATURE)
// Hand over message to controller
(void)gatewayTransportSend(_msg);
#endif
// Call incoming message callback if available
开发者ID:henrikekblad,项目名称:Arduino,代码行数:67,代码来源:MyTransport.cpp
示例19: work
void work()
{
int build(),dinic(int,int);
while (build())
ans+=dinic(0,20000000);
}
开发者ID:liuq901,项目名称:code,代码行数:6,代码来源:s_176.cpp
示例20: build_sync
static void build_sync(hpx::naming::id_type const &gid, std::string NVCC_FLAGS)
{
build(gid, NVCC_FLAGS).get();
}
开发者ID:hapoo,项目名称:hpxcl,代码行数:4,代码来源:program.hpp
注:本文中的build函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论