本文整理汇总了C++中rc::ConstHandle::getUsage方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstHandle::getUsage方法的具体用法?C++ ConstHandle::getUsage怎么用?C++ ConstHandle::getUsage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rc::ConstHandle
的用法示例。
在下文中一共展示了ConstHandle::getUsage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPrototypeException
ArrayOutputOperator::ArrayOutputOperator(
RC::ConstHandle<Executable> const &executable,
RC::ConstHandle<AST::Operator> const &astOperator,
void (*functionPtr)(...)
)
: m_executable( executable )
{
if ( astOperator )
{
RC::Handle<CG::Manager> cgManager = executable->getCGManager();
RC::ConstHandle<AST::ParamVector> params = astOperator->getParams( cgManager );
size_t numParams = params->size();
if ( numParams < 1 || numParams > 4 )
throw GetPrototypeException();
RC::ConstHandle<AST::Param> valueParam = params->get(0);
if ( valueParam->getUsage() != CG::USAGE_LVALUE )
throw GetPrototypeException();
RC::ConstHandle<RT::Desc> valueDesc = valueParam->getAdapter( cgManager )->getDesc();
RC::ConstHandle<RT::Desc> sharedDesc;
if ( numParams >= 2 )
{
RC::ConstHandle<AST::Param> indexParam = params->get(1);
if ( indexParam->getUsage() != CG::USAGE_RVALUE
|| !indexParam->getAdapter( cgManager )->isEquivalentTo( cgManager->getSizeAdapter() )
)
throw GetPrototypeException();
if ( numParams >= 3 )
{
RC::ConstHandle<AST::Param> countParam = params->get(2);
if ( countParam->getUsage() != CG::USAGE_RVALUE
|| !countParam->getAdapter( cgManager )->isEquivalentTo( cgManager->getSizeAdapter() )
)
throw GetPrototypeException();
if ( numParams >= 4 )
{
RC::ConstHandle<AST::Param> sharedParam = params->get(3);
if ( sharedParam->getUsage() != CG::USAGE_RVALUE )
throw GetPrototypeException();
sharedDesc = sharedParam->getAdapter( cgManager )->getDesc();
}
}
}
init( functionPtr, numParams, valueDesc, sharedDesc );
}
}