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


C++ Blocks::push_back方法代码示例

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


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

示例1: puzzle_g

void puzzle_g()
{
    Blocks bs;
    Board board(6, 5);

    bs.push_back(&(*(new Block()))("***|*"));
    bs.push_back(&(*(new Block()))("****"));
    bs.push_back(&(*(new Block()))(" *|**|*"));
    bs.push_back(&(*(new Block()))("*|**"));
    bs.push_back(&(*(new Block()))("***"));
    bs.push_back(&(*(new Block()))("**|**"));
    bs.push_back(&(*(new Block()))("*|*"));
    bs.push_back(&(*(new Block()))("  *|* *|***"));

    cout << "---------- Puzzle G ----------" << endl;

    if (!board.Unblock(bs))
    {
        cout << "No solution!" << endl;
    }

    for (auto i = bs.cbegin(); i != bs.cend(); i++)
    {
        delete (*i);
    }
}
开发者ID:limingjie,项目名称:algorithm,代码行数:26,代码来源:BlockPuzzle.cpp

示例2: addBranchBlock

static bool addBranchBlock(Blocks &blocks, Block &block,
                           const Instruction &branchDestination,
                           Block *&branchBlock, BlockEdgeType type) {

	/* Prepare to follow one branch of the path.
	   Returns true if this is a completely new path we haven't handled yet.
	   branchBlock will be filled with the block for the branch. */

	bool needAdd = false;

	// See if we have already handled this branch. If not, create a new block for it.
	branchBlock = const_cast<Block *>(branchDestination.block);
	if (!branchBlock) {
		blocks.push_back(Block(branchDestination.address));

		branchBlock = &blocks.back();
		needAdd     = true;
	}

	// Link the branch with its parent

	branchBlock->parents.push_back(&block);
	block.children.push_back(branchBlock);

	block.childrenTypes.push_back(type);

	return needAdd;
}
开发者ID:asr1,项目名称:xoreos-tools,代码行数:28,代码来源:block.cpp

示例3: MarkBlockUsed

	void MarkBlockUsed( const SBlock& p_Block, unsigned int p_unWidth, unsigned int p_unHeight )
	{
		m_unFirstX += p_unWidth;
		if( m_unFirstX + p_unWidth >= m_unWidth )
		{
			m_unFirstX = 0;
			m_unFirstY += p_unHeight;
		}
		m_vecBlocks.push_back( p_Block );
	}
开发者ID:adan830,项目名称:FKEngine,代码行数:10,代码来源:BlockAllocator.cpp

示例4: constructBlocks

void constructBlocks(Blocks &blocks, Instructions &instructions) {
	/* Create the first block containing the very first instruction in this script.
	 * Then follow the complete code flow from this instruction onwards. */

	assert(blocks.empty());
	if (instructions.empty())
		return;

	blocks.push_back(Block(instructions.front().address));
	constructBlocks(blocks, blocks.back(), instructions.front());
}
开发者ID:asr1,项目名称:xoreos-tools,代码行数:11,代码来源:block.cpp

示例5: getBlocks

void PatchMgr::getBlocks(Scope &scope, Blocks &blocks) {
   if (scope.wholeProgram) {
      const AddrSpace::ObjMap &objs = as()->objMap();
      for (AddrSpace::ObjMap::const_iterator iter = objs.begin(); iter != objs.end(); ++iter) {
         iter->second->blocks(std::back_inserter(blocks));
      }
   }
   else if (scope.obj) {
      scope.obj->blocks(std::back_inserter(blocks));
   }
   else if (scope.block) {
      blocks.push_back(scope.block);
   }
}
开发者ID:Zirkon,项目名称:dyninst,代码行数:14,代码来源:PatchMgr.C

示例6: addBlock

 void addBlock(Block block) {
     blocks.push_back(block);
 }
开发者ID:nokia-wroclaw,项目名称:nokia-book,代码行数:3,代码来源:asm.hpp


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