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

C++ Child函数代码示例

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

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



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

示例1: ReadId

void ColladaParser::ReadGeometry(XmlElement* e)
{
	Geometry g;
	g.id = e->Attribute("id");
	g.name = e->Attribute("name");

	{
		auto v = e->Child("mesh")->Childs("source");
		for (int ia = 0; ia < v.size(); ia++)
			g.ReadSource(v[ia]);
	}

	{
		auto v = e->Child("mesh")->Childs("vertices");
		for (int ia = 0; ia < v.size(); ia++)
		{
			Geometry::Vertices vert;
			vert.id = v[ia]->Attribute("id");
			vert.positionSourceId = ReadId(v[ia]->Child("input", "semantic", "POSITION")->Attribute("source"));
			vert.normalSourceId = ReadId(v[ia]->Child("input", "semantic", "NORMAL")->Attribute("source"));
			vert.texcoordSourceId = ReadId(v[ia]->Child("input", "semantic", "TEXCOORD")->Attribute("source"));
			g.vertices.emplace(vert.id, vert);
		}
	}

	auto t = e->Child("mesh")->Child("triangles");
	auto count = ReadInt(t->Attribute("count"));
	g.triangleVerticesId = ReadId(t->Child("input")->Attribute("source"));
	g.triangleIndices = ReadInts(t->Child("p")->content, count * 3);
	geometries.emplace(g.id, g);
}
开发者ID:ColacX,项目名称:Omega,代码行数:31,代码来源:ColladaParser.cpp


示例2: Child

Archive::Child Archive::Child::getNext(bool& error) const {
  uint32_t nextOffset = len + (len & 1); // Members are aligned to even byte boundaries.
  if ((size_t)(data - (const uint8_t*)parent->data.data() + nextOffset) >= parent->data.size()) {  // End of the archive.
    return Child();
  }
  return Child(parent, data + nextOffset, &error);
}
开发者ID:Unity-Technologies,项目名称:binaryen,代码行数:7,代码来源:archive.cpp


示例3: setExists

Void testlist::Parent::reset() const  {
    setExists(true);
    setFirstChild(Child());
    setLastChild(Child());
    setNextParentFreeParent(Parent());
    setNumChilds(0);
}
开发者ID:ivandzen,项目名称:HSDB,代码行数:7,代码来源:testlist.cpp


示例4: makeThread

void makeThread(nodeptr start, nodeptr stop)
{
	int ndesc, i;
	nodeptr desc[NCHILD + 1];
	/* Set link to the next node */
	Next(start) = stop;
	/* If could descendent to thread */
	if (Type(start) == CELL) {
		/* Start counting */
		ndesc = 0;
		/* Loop over all child cells  */
		for (i = 0; i < NCHILD; i++)
			/* If this one is occupied */
			if (Child(start)[i] != NULL)
				/* Store it in the table */
				desc[ndesc++] = Child(start)[i];
		/* Set link to the first one */
		More(start) = desc[0];
		/* Thread last one to next */
		desc[ndesc] = stop;
		/* Loop over descendents */
		for (i = 0; i < ndesc; i++)
			/* Thread them together */
			makeThread(desc[i], desc[i + 1]);
	}
}
开发者ID:petrabarus,项目名称:nbodyc,代码行数:26,代码来源:treecode.c


示例5: EnvWriteRetrieve

BOOLEAN EnvWriteRetrieve(OBJECT env, FILE_NUM fnum, int *offset, int *lnum)
{ unsigned int pos;  OBJECT link, y, z;
  debug2(DET, DD, "EnvWriteRetrieve(env %d, %s)", (int) env, FileName(fnum));
  debug1(DET, DDD, "  %s", EchoObject(env));
  stat_writes++;
  hash1(pos, env, fnum);
  if( tab[pos] != nilobj )
  {
    for( link = Down(tab[pos]);  link != tab[pos];  link = NextDown(link) )
    { Child(y, link);
      Child(z, Down(y));
      if( env_fnum(y) == fnum && z == env && !env_read(y) )
      { MoveLink(LastUp(y), env_cache, PARENT);
	*offset = env_offset(y);
	*lnum   = env_lnum(y);
	stat_write_hits++;
	debug2(DET, DD, "EnvWriteRetrieve returning TRUE (offset %d, lnum %d)",
	  *offset, *lnum);
	return TRUE;
      }
    }
  }
  debug0(DET, DD, "EnvWriteRetrieve returning FALSE");
  return FALSE;
} /* end EnvWriteRetrieve */
开发者ID:thektulu,项目名称:lout,代码行数:25,代码来源:z47.c


示例6: setExists

Void testhash::Child::reset() const  {
    setExists(true);
    setNextChildFreeChild(Child());
    setNextParentTableListChild(Child());
    setParent(Parent());
    setParentKey(0);
    setPrevParentTableListChild(Child());
}
开发者ID:ivandzen,项目名称:HSDB,代码行数:8,代码来源:testhash.cpp


示例7: TEST_F

TEST_F(ConfigNodeTest, Value)
{
	const auto node = config.LoadFromStringAndGetFirstChild(ConfigNodeData_1);
	EXPECT_EQ(10, node.Child("a").Value<int>());
	EXPECT_TRUE(ExpectNear(Math::Float(1.5), node.Child("b").Value<Math::Float>()));
	EXPECT_EQ("world", node.Child("c").Value());
	EXPECT_EQ("world", node.Child("c").Value<std::string>());
}
开发者ID:Vertexwahn,项目名称:lightmetrica,代码行数:8,代码来源:test.confignode.cpp


示例8: OnCreate

bool GGenericQuestionWindow::OnCreate()
{
	__super::OnCreate();

   m_pObjOkBtn = (GUI::GButton*)Child(L"btnOk");
   m_pObjCancelBtn = (GUI::GButton*)Child(L"btnCancel");
   m_pObjTextLbl = (GUI::GLabel*)Child(L"lblMessage");

	return true;
}
开发者ID:zhudavi2,项目名称:SP2-HDM,代码行数:10,代码来源:sp2_generic_question_window.cpp


示例9: BringToFront

bool GSaveConfirmationWindow::OnCreate()
{
	__super::OnCreate();
   BringToFront();

   m_pObjApplyBtn       = (GUI::GButton*)Child(L"btnApply");
   m_pObjDontApplyBtn   = (GUI::GButton*)Child(L"btnDont");
   m_pObjRememberTog    = (GUI::GToggle*)Child(L"togRemember");

	return true;
}
开发者ID:zhudavi2,项目名称:SP2-HDM,代码行数:11,代码来源:sp2_save_confirmation_window.cpp


示例10: Child

XMLEntity*
XMLEntity::Child(const char *name)
{
	if (name)
	{
		for (int i=0; i<CountChildren(); ++i)
			if (!strcasecmp(Child(i)->Name(), name))
				return Child(i);
	}
	return NULL;
}
开发者ID:devaspot,项目名称:chat,代码行数:11,代码来源:XMLEntity.cpp


示例11: FlushInners

void FlushInners(OBJECT inners, OBJECT hd)
{ OBJECT y, z, tmp, dest_index;

  ifdebug(DGF, D,
    OBJECT link;
    fprintf(stderr, "dgf: [ FlushInners(");
    for( link = Down(inners);  link != inners;  link = NextDown(link) )
    {
      Child(y, link);
      fprintf(stderr, " %s", Image(type(y)));
      switch( type(y) )
      {

        case DEAD:
      
	  break;


        case RECEIVING:
        case UNATTACHED:
      
	  if( Down(y) != y )	/* bug fix (was assert before) */
	  { assert( Down(y) != y, "FlushInners: UNATTACHED!");
	    Child(z, Down(y));
	    fprintf(stderr, " %s", SymName(actual(z)));
	  }
	  break;


        case PRECEDES:
      
	  break;


        case GALL_PREC:

	  break;


        default:
      
	  break;
      }
    }
    fprintf(stderr, ")");
    debug0(DGF, D, "");
  )

  /* check for root galley case */
  if( hd != nilobj )
开发者ID:thektulu,项目名称:lout,代码行数:50,代码来源:z22.c


示例12: treeFree

void treeFree(cellptr * cell)
{
	int i;

	nodeptr q;
	for (i = 0; i < NCHILD; i++) {
		if (Child(*cell)[i] != NULL)
			if (Type(Child(*cell)[i]) == CELL) {
				cellptr a = (cellptr) Child(*cell)[i];
				treeFree(&a);
			}
	}
	free(*cell);
}
开发者ID:petrabarus,项目名称:nbodyc,代码行数:14,代码来源:treecode.c


示例13: SearchSym

OBJECT SearchSym(FULL_CHAR *str, int len)
{ register int rlen, sum;
  register FULL_CHAR *x, *y;
  OBJECT p, q, link, plink, entry;
  int s;

  debug2(DST, DDD, "SearchSym( %c..., %d )", str[0], len);

  hash(str, len, sum);
  rlen = len;
  entry = (OBJECT) &symtab[sum];
  for( plink = Down(entry);  plink != entry;  plink = NextDown(plink) )
  { Child(p, plink);
    if( rlen == length(p) )
    { x = str;  y = string(p);
      do; while( *x++ == *y++ && --rlen );
      if( rlen == 0 )
      {
	debug1(DST, DDD, "  found %s", string(p));
	s = scope_top;
	do
	{ s--;
	  for( link = Down(p);  link != p;  link = NextDown(link) )
	  { Child(q, link);
	    { debugcond4(DST, DDD, enclosing(q) == scope[s],
	       "  !npars_only[s] = %s, !vis_only[s] = %s, body_ok[s] = %s, !ss = %s",
	       bool(!npars_only[s]), bool(!vis_only[s]), bool(body_ok[s]),
	       bool(!suppress_scope));
	    }
	    if( enclosing(q) == scope[s]
	      && (!npars_only[s] || type(q) == NPAR)
	      && (!vis_only[s] || visible(q) || suppress_visible )
	      && (body_ok[s] || type(q)!=RPAR || !has_body(enclosing(q))
		  || suppress_visible )
	      && (!suppress_scope || StringEqual(string(p), KW_INCLUDE) ||
				     StringEqual(string(p), KW_SYSINCLUDE))
	    )
	    {	debug3(DST, DD, "SearchSym returning %s %s%%%s",
		  Image(type(q)), SymName(q), SymName(enclosing(q)));
		return q;
	    }
	  }
	} while( scope[s] != StartSym );
      }
    }
    rlen = len;
  }
  debug0(DST, DDD, "SearchSym returning <nilobj>");
  return nilobj;
} /* end SearchSym */
开发者ID:thektulu,项目名称:lout,代码行数:50,代码来源:z29.c


示例14: getChildHash

Bool testhash::Parent::removeChild(const Child & child) const  {
    if(!child.isExists() || child.getParent() != *this )
        return false;
    StdUInt hash_value = getChildHash(child.getParentKey());
    Child next = child.getNextParentTableListChild();
    Child prev = child.getPrevParentTableListChild();
    if (prev.isValid()) //! Previous exists
    {
        if (getChildHash(prev.getParentKey()) != hash_value) //! Previous has different hash
        {
            if (next.isValid()) //! And next exists
            {
                if (getChildHash(next.getParentKey()) != hash_value) //! But next has different hash
                    setiChildTable(hash_value, Child());
                else  //! Next has the same hash
                    setiChildTable(hash_value, next);
            }
            else  //! Next is absent
            {
                setiChildTable(hash_value, Child());
                setChildTableMax(getChildHash(prev.getParentKey()));
            }
        }
    }
    else  //! Previous absent
    {
        if (next.isValid()) //! Next exists
        {
            if (getChildHash(next.getParentKey()) != hash_value) //! Next has different hash
            {
                setiChildTable(hash_value, Child());
                setChildTableMin(getChildHash(next.getParentKey()));
            }
            else //! Next has the same hash
                setiChildTable(hash_value, next);
        }
        else //! Next is absent
        {
            setiChildTable(hash_value, Child());
            setChildTableMax(0);
            setChildTableMin(0);
        }
    }
    removeTableListChild(child);
    child.setParent(Parent());
    child.removeParentHandler();
    setNumChilds(getNumChilds() - 1);
    return true;
}
开发者ID:ivandzen,项目名称:HSDB,代码行数:49,代码来源:testhash.cpp


示例15: Child

testlist::Child testlist::Child::create()  {
    if(instanceCount() == 0)
        return Child();
    Child result = popFreeChild();
    if(!result.isValid())
    {
        if(getUsed() >= instanceCount())
            reallocInstances(instanceCount() << 1);
        result = Child(getUsed());
        setUsed(getUsed() + 1);
    }
    result.reset();
    result.onCreate();
    return result;
}
开发者ID:ivandzen,项目名称:HSDB,代码行数:15,代码来源:testlist.cpp


示例16: setChildTableIndex

Void testhash::Parent::reset() const  {
    setChildTableIndex(Null);
    setChildTableLen(0);
    setChildTableMax(0);
    setChildTableMin(0);
    setChildTableSize(DEFAULT_HASH_TABLE_SIZE);
    setExists(true);
    setFirstTableListChild(Child());
    setLastTableListChild(Child());
    setNextParentFreeParent(Parent());
    setNextParent__ChildTableBlock__Parent(Parent());
    setNumChilds(0);
    setNumTableListChilds(0);
    setPrevParent__ChildTableBlock__Parent(Parent());
}
开发者ID:ivandzen,项目名称:HSDB,代码行数:15,代码来源:testhash.cpp


示例17: SearchGalley

OBJECT SearchGalley(OBJECT start, OBJECT sym, BOOLEAN forwards,
BOOLEAN subgalleys, BOOLEAN closures, BOOLEAN input)
{ OBJECT y, res, z, zlink, link;
  debug5(DGA, DD, "[ SearchGalley(start, %s, %s, %s, %s, %s)", SymName(sym),
	forwards ? "fwd" : "back", subgalleys ? "subgalleys" : "nosubgalleys",
	closures ? "closures" : "noclosures", input ? "input" : "noinput");
  assert( type(start) == LINK || type(start) == HEAD, "SearchGalley: start!" );

  link = forwards ? NextDown(start) : PrevDown(start);
  res = nilobj;
  while( res == nilobj && type(link) != HEAD )
  { Child(y, link);
    switch( type(y) )
    {
      case UNATTACHED:
      case RECEIVING:
	
        debug1(DGA, DD, "  examining %s", EchoIndex(y));
	if( subgalleys )
	for( zlink = Down(y); zlink!=y && res==nilobj; zlink=NextDown(zlink) )
	{ Child(z, zlink);
	  res = SearchGalley(z, sym, TRUE, TRUE, TRUE, input);
	}
	if( res == nilobj && input && type(y) == RECEIVING &&
	    actual(actual(y)) == InputSym )
	  res = y;
	break;


      case RECEPTIVE:
	
        debug1(DGA, DD, "  examining %s", EchoIndex(y));
	if( closures && type(actual(y)) == CLOSURE
		     && SearchUses(actual(actual(y)), sym) )  res = y;
	else if( input && actual(actual(y)) == InputSym )  res = y;
	break;


      default:
	
	break;

    }
    link = forwards ? NextDown(link) : PrevDown(link);
  }
  debug1(DGA, DD, "] SearchGalley returning %s", EchoIndex(res));
  return res;
} /* end SearchGalley */
开发者ID:thektulu,项目名称:lout,代码行数:48,代码来源:z19.c


示例18: OnCreate

bool GServerInfoWindow::OnCreate()
{
	__super::OnCreate();

   m_pObjInnerFrm = (GUI::GFrame*)Child(L"frmInner");

   m_pObjServerNameTxt  = (GUI::GLabel*)m_pObjInnerFrm->Child(L"frmInfo")->Child(L"txtName");
   m_pObjIpAddressTxt   = (GUI::GLabel*)m_pObjInnerFrm->Child(L"frmInfo")->Child(L"txtIpAddress");
   m_pObjPlayersTxt     = (GUI::GLabel*)m_pObjInnerFrm->Child(L"frmInfo")->Child(L"txtPlayers");

   m_pObjJoinGameBtn    = (GUI::GButton*)m_pObjInnerFrm->Child(L"btnJoinGame");

   m_pObjModsTxt        = (GUI::GLabel*)m_pObjInnerFrm->Child(L"frmInfo")->Child(L"txtMods");
   m_pObjScenarioTxt    = (GUI::GLabel*)m_pObjInnerFrm->Child(L"frmInfo")->Child(L"txtScenario");

   m_pObjPasswordCbo    = (GUI::GToggle*)m_pObjInnerFrm->Child(L"frmInfo")->Child(L"togPassword");

   m_pObjPasswordCbo->Enabled(false);

   CGFX_Renderer_Init_Mode mode;
   g_Joshua.Renderer()->Get_Current_Mode(&mode);

   Position(((INT16)mode.m_Resolution.x / 2) - (Width() / 2),((INT16)mode.m_Resolution.y / 2) - (Height() / 2));

	return true;
}
开发者ID:zhudavi2,项目名称:SP2-HDM,代码行数:26,代码来源:sp2_server_info_window.cpp


示例19: OnCreate

bool GCovertActionsNewMissionWindow::OnCreate()
{
	__super::OnCreate();

   m_pObjInnerFrm       = (GUI::GFrame*)Child(L"frmInner");

   m_pObjTypeCbo        = (GUI::GComboBox*)m_pObjInnerFrm->Child(L"frmMission")->Child(L"cboMissionType");
   m_pObjSectorCbo      = (GUI::GComboBox*)m_pObjInnerFrm->Child(L"frmMission")->Child(L"cboSector");
   m_pObjComplexityCbo  = (GUI::GComboBox*)m_pObjInnerFrm->Child(L"frmMission")->Child(L"cboComplexity");
   m_pObjResourceCbo    = (GUI::GComboBox*)m_pObjInnerFrm->Child(L"frmMission")->Child(L"cboResourceUnit");
   m_pObjTargetLbl      = (GUI::GLabel*)   m_pObjInnerFrm->Child(L"frmMission")->Child(L"txtCountry");
   m_pObjFramedCbo      = (GUI::GComboBox*)m_pObjInnerFrm->Child(L"frmMission")->Child(L"cboCountry");

   m_pObjResourceLbl    = (GUI::GLabel*)m_pObjInnerFrm->Child(L"frmMission")->Child(L"lblResourceUnit");
   m_pObjSectorLbl      = (GUI::GLabel*)m_pObjInnerFrm->Child(L"frmMission")->Child(L"lblTargetSector");


   m_pObjConfirm        = (GUI::GButton*)m_pObjInnerFrm->Child(L"btnConfirm");
   m_pObjCancel         = (GUI::GButton*)m_pObjInnerFrm->Child(L"btnCancel");

   m_pObjTypeCbo->Add_Item( g_ClientDAL.GetString(EStrId::MissionTypeEspionage) );
   m_pObjTypeCbo->Add_Item( g_ClientDAL.GetString(EStrId::MissionTypeSabotage) );
   m_pObjTypeCbo->Add_Item( g_ClientDAL.GetString(EStrId::MissionTypeAssassination) );
   m_pObjTypeCbo->Add_Item( g_ClientDAL.GetString(EStrId::MissionTypeTerrorism) );
   m_pRowCoupDetat = m_pObjTypeCbo->Add_Item( g_ClientDAL.GetString(EStrId::MissionTypeCoupEtat) );

   m_pObjSectorCbo->Add_Item( g_ClientDAL.GetString(EStrId::MissionTargetCivilian) );
   m_pObjSectorCbo->Add_Item( g_ClientDAL.GetString(EStrId::MissionTargetMilitary) );

   if(m_pObjApplyBtn)
      m_pObjApplyBtn->Hide();

	return true;
}
开发者ID:zhudavi2,项目名称:SP2-HDM,代码行数:34,代码来源:sp2_covert_actions_new_mission.cpp


示例20: printf

void Archive::dump() const {
  printf("Archive data %p len %zu, firstRegularData %p\n", data.data(),
         data.size(), firstRegularData);
  printf("Symbol table %p, len %u\n", symbolTable.data, symbolTable.len);
  printf("string table %p, len %u\n", stringTable.data, stringTable.len);
  const uint8_t* buf = symbolTable.data;
  if (!buf) {
    for (auto c = child_begin(), e = child_end(); c != e; ++c) {
      printf("Child %p, len %u, name %s, size %u\n", c->data, c->len,
             c->getName().c_str(), c->getSize());
    }
    return;
  }
  uint32_t symbolCount = read32be(buf);
  printf("Symbol count %u\n", symbolCount);
  buf += sizeof(uint32_t) + (symbolCount * sizeof(uint32_t));
  uint32_t string_start_offset = buf - symbolTable.data;
  Symbol sym = {0, string_start_offset};
  while (sym.symbolIndex != symbolCount) {
    printf("Symbol %u, offset %u\n", sym.symbolIndex, sym.stringIndex);
    // get the member
    uint32_t offset = read32be(symbolTable.data + sym.symbolIndex * 4);
    auto* loc = (const uint8_t*)&data[offset];
    child_iterator it;
    it.child = Child(this, loc, &it.error);
    printf("Child %p, len %u\n", it.child.data, it.child.len);
  }
}
开发者ID:Unity-Technologies,项目名称:binaryen,代码行数:28,代码来源:archive.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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