本文整理汇总了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);
}
}
示例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;
}
示例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 );
}
示例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());
}
示例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);
}
}
示例6: addBlock
void addBlock(Block block) {
blocks.push_back(block);
}