本文整理汇总了C++中rc::ConstHandle::getThisTypeName方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstHandle::getThisTypeName方法的具体用法?C++ ConstHandle::getThisTypeName怎么用?C++ ConstHandle::getThisTypeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rc::ConstHandle
的用法示例。
在下文中一共展示了ConstHandle::getThisTypeName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsonDecode
//.........这里部分代码省略.........
( *( FabricEDKInitPtr )resolvedFabricEDKInitFunction )( callbacks );
}
for ( size_t i=0; i<m_orderedSOLibHandles.size(); ++i )
{
/*
OnLoadFn onLoadFn = (OnLoadFn)SOLibResolve( m_orderedSOLibHandles[i], "FabricOnLoad" );
if ( onLoadFn )
onLoadFn( SDK::Value::Bind( m_fabricLIBObject ) );
*/
}
/*
for ( size_t i=0; i<m_desc.interface.methods.size(); ++i )
{
std::string const &methodName = m_desc.interface.methods[i];
Method method = 0;
for ( size_t j=0; j<m_orderedSOLibHandles.size(); ++j )
{
SOLibHandle soLibHandle = m_orderedSOLibHandles[j];
method = (Method)SOLibResolve( soLibHandle, methodName );
if ( method )
break;
}
if ( !method )
throw Exception( "method "+_(methodName)+" not found" );
m_methodMap.insert( MethodMap::value_type( methodName, method ) );
}
*/
std::vector<std::string> codeFiles;
m_desc.code.appendMatching( Util::getHostTriple(), codeFiles );
std::string filename;
m_code = "";
for ( std::vector<std::string>::const_iterator it=codeFiles.begin(); it!=codeFiles.end(); ++it )
{
std::string const &codeEntry = *it;
if ( filename.empty() )
filename = codeEntry;
std::string code;
try
{
code = extensionDir->getFileContents( codeEntry );
}
catch ( Exception e )
{
throw _(codeEntry) + ": " + e;
}
m_code += code + "\n";
}
RC::ConstHandle<KL::Source> source = KL::StringSource::Create( filename, m_code );
RC::Handle<KL::Scanner> scanner = KL::Scanner::Create( source );
m_ast = KL::Parse( scanner, m_diagnostics );
if ( !m_diagnostics.containsError() )
m_ast->registerTypes( cgManager, m_diagnostics );
for ( CG::Diagnostics::const_iterator it=m_diagnostics.begin(); it!=m_diagnostics.end(); ++it )
{
CG::Location const &location = it->first;
CG::Diagnostic const &diagnostic = it->second;
FABRIC_LOG( "[%s] %s:%u:%u: %s: %s", extensionName.c_str(), location.getFilename()->c_str(), (unsigned)location.getLine(), (unsigned)location.getColumn(), diagnostic.getLevelDesc(), diagnostic.getDesc().c_str() );
}
if ( m_diagnostics.containsError() )
throw Exception( "KL compile failed" );
std::vector< RC::ConstHandle<AST::FunctionBase> > functionBases;
m_ast->collectFunctionBases( functionBases );
for ( std::vector< RC::ConstHandle<AST::FunctionBase> >::const_iterator it=functionBases.begin(); it!=functionBases.end(); ++it )
{
RC::ConstHandle<AST::FunctionBase> const &functionBase = *it;
if ( !functionBase->getBody() )
{
std::string symbolName = functionBase->getSymbolName( cgManager );
void *resolvedFunction = 0;
for ( size_t i=0; i<m_orderedSOLibHandles.size(); ++i )
{
resolvedFunction = SOLibResolve( m_orderedSOLibHandles[i], symbolName );
if ( resolvedFunction )
break;
}
if ( !resolvedFunction )
throw Exception( "error: symbol " + _(symbolName) + ", prototyped in KL, not found in native code" );
m_externalFunctionMap.insert( ExternalFunctionMap::value_type( symbolName, resolvedFunction ) );
if ( functionBase->isDestructor() )
{
RC::ConstHandle<AST::Destructor> destructor = RC::ConstHandle<AST::Destructor>::StaticCast( functionBase );
std::string thisTypeName = destructor->getThisTypeName();
implNameToDestructorMap[thisTypeName] = (void (*)( void * )) resolvedFunction;
}
}
}
m_jsConstants = m_desc.jsConstants.concatMatching( Util::getHostTriple() );
}