本文整理汇总了C++中parser::name_stack_t::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ name_stack_t::push_back方法的具体用法?C++ name_stack_t::push_back怎么用?C++ name_stack_t::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parser::name_stack_t
的用法示例。
在下文中一共展示了name_stack_t::push_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inspectBlock
bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack) const
{
// named param is one like LLView::Params::follows
// unnamed param is like LLView::Params::rect - implicit
const BlockDescriptor& block_data = mostDerivedBlockDescriptor();
for (BlockDescriptor::param_list_t::const_iterator it = block_data.mUnnamedParams.begin();
it != block_data.mUnnamedParams.end();
++it)
{
param_handle_t param_handle = (*it)->mParamHandle;
const Param* param = getParamFromHandle(param_handle);
ParamDescriptor::inspect_func_t inspect_func = (*it)->mInspectFunc;
if (inspect_func)
{
(*it)->mGeneration = parser.newParseGeneration();
name_stack.push_back(std::make_pair("", (*it)->mGeneration));
inspect_func(*param, parser, name_stack, (*it)->mMinCount, (*it)->mMaxCount);
name_stack.pop_back();
}
}
for(BlockDescriptor::param_map_t::const_iterator it = block_data.mNamedParams.begin();
it != block_data.mNamedParams.end();
++it)
{
param_handle_t param_handle = it->second->mParamHandle;
const Param* param = getParamFromHandle(param_handle);
ParamDescriptor::inspect_func_t inspect_func = it->second->mInspectFunc;
if (inspect_func)
{
// Ensure this param has not already been inspected
bool duplicate = false;
for (BlockDescriptor::param_list_t::const_iterator it2 = block_data.mUnnamedParams.begin();
it2 != block_data.mUnnamedParams.end();
++it2)
{
if (param_handle == (*it2)->mParamHandle)
{
duplicate = true;
break;
}
}
if (!duplicate)
{
it->second->mGeneration = parser.newParseGeneration();
}
name_stack.push_back(std::make_pair(it->first, it->second->mGeneration));
inspect_func(*param, parser, name_stack, it->second->mMinCount, it->second->mMaxCount);
name_stack.pop_back();
}
}
return true;
}
示例2: serializeBlock
bool BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t name_stack, const LLInitParam::BaseBlock* diff_block) const
{
// named param is one like LLView::Params::follows
// unnamed param is like LLView::Params::rect - implicit
const BlockDescriptor& block_data = mostDerivedBlockDescriptor();
for (BlockDescriptor::param_list_t::const_iterator it = block_data.mUnnamedParams.begin();
it != block_data.mUnnamedParams.end();
++it)
{
param_handle_t param_handle = (*it)->mParamHandle;
const Param* param = getParamFromHandle(param_handle);
ParamDescriptor::serialize_func_t serialize_func = (*it)->mSerializeFunc;
if (serialize_func)
{
const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL;
// each param descriptor remembers its serial number
// so we can inspect the same param under different names
// and see that it has the same number
(*it)->mGeneration = parser.newParseGeneration();
name_stack.push_back(std::make_pair("", (*it)->mGeneration));
serialize_func(*param, parser, name_stack, diff_param);
name_stack.pop_back();
}
}
for(BlockDescriptor::param_map_t::const_iterator it = block_data.mNamedParams.begin();
it != block_data.mNamedParams.end();
++it)
{
param_handle_t param_handle = it->second->mParamHandle;
const Param* param = getParamFromHandle(param_handle);
ParamDescriptor::serialize_func_t serialize_func = it->second->mSerializeFunc;
if (serialize_func && param->anyProvided())
{
// Ensure this param has not already been serialized
// Prevents <rect> from being serialized as its own tag.
bool duplicate = false;
for (BlockDescriptor::param_list_t::const_iterator it2 = block_data.mUnnamedParams.begin();
it2 != block_data.mUnnamedParams.end();
++it2)
{
if (param_handle == (*it2)->mParamHandle)
{
duplicate = true;
break;
}
}
//FIXME: for now, don't attempt to serialize values under synonyms, as current parsers
// don't know how to detect them
if (duplicate)
{
continue;
}
if (!duplicate)
{
it->second->mGeneration = parser.newParseGeneration();
}
name_stack.push_back(std::make_pair(it->first, it->second->mGeneration));
const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL;
serialize_func(*param, parser, name_stack, diff_param);
name_stack.pop_back();
}
}
return true;
}