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


C++ TypeMap类代码示例

本文整理汇总了C++中TypeMap的典型用法代码示例。如果您正苦于以下问题:C++ TypeMap类的具体用法?C++ TypeMap怎么用?C++ TypeMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: TEST_F

TEST_F(SymbolFilePDBTests, REQUIRES_DIA_SDK(TestTypedefs)) {
    FileSpec fspec(m_types_test_exe.c_str(), false);
    ArchSpec aspec("i686-pc-windows");
    lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);

    SymbolVendor *plugin = module->GetSymbolVendor();
    SymbolFilePDB *symfile =
        static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
    const llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
    SymbolContext sc;
    llvm::DenseSet<SymbolFile *> searched_files;
    TypeMap results;

    const char *TypedefsToCheck[] = {"ClassTypedef", "NSClassTypedef"};
    for (auto Typedef : TypedefsToCheck) {
        TypeMap results;
        EXPECT_EQ(1u, symfile->FindTypes(sc, ConstString(Typedef), nullptr, false,
                                         0, searched_files, results));
        EXPECT_EQ(1u, results.GetSize());
        lldb::TypeSP typedef_type = results.GetTypeAtIndex(0);
        EXPECT_EQ(ConstString(Typedef), typedef_type->GetName());
        CompilerType compiler_type = typedef_type->GetFullCompilerType();
        ClangASTContext *clang_type_system =
            llvm::dyn_cast_or_null<ClangASTContext>(compiler_type.GetTypeSystem());
        EXPECT_TRUE(
            clang_type_system->IsTypedefType(compiler_type.GetOpaqueQualType()));

        std::string sizeof_var = "sizeof_";
        sizeof_var.append(Typedef);
        EXPECT_EQ(GetGlobalConstantInteger(session, sizeof_var.c_str()),
                  typedef_type->GetByteSize());
    }
}
开发者ID:krytarowski,项目名称:lldb,代码行数:33,代码来源:SymbolFilePDBTests.cpp

示例2: main

int main()
{
    TypeMap bin;
    fillBin("Trash.dat", bin); // Sorting happens
    TypeMap::iterator it;
    for (it = bin.begin(); it != bin.end(); it++)
        sumValue((*it).second);
} ///:~
开发者ID:finalx,项目名称:finalx-labs-all,代码行数:8,代码来源:DynaTrash.cpp

示例3: GetType

Type* Protobuf::GetType(const Descriptor* descriptor) {
	TypeMap::iterator it = mTypeMap.find(descriptor);
	if (it != mTypeMap.end())
		return it->second;
	Type* result = mTypeMap[descriptor] = 
		new Type(this,
		factory.GetPrototype(descriptor)->New(),
		TypeTemplate->GetFunction()->NewInstance(),
		handles.size());
	handles.push_back(result);

    Handle<Array> types = handle_->GetInternalField(1).As<Array>();
    types->Set(types->Length(), result->handle_);
	return result;
}
开发者ID:ftcaicai,项目名称:GOD,代码行数:15,代码来源:protobuf.cpp

示例4:

size_t
SymbolFile::FindTypes (const std::vector<CompilerContext> &context, bool append, TypeMap& types)
{
    if (!append)
        types.Clear();
    return 0;
}
开发者ID:2asoft,项目名称:freebsd,代码行数:7,代码来源:SymbolFile.cpp

示例5: getOverlappingTypeInfos

static
std::pair<typename ContainerTraits<TypeMap>::Iterator, typename ContainerTraits<TypeMap>::Iterator>
getOverlappingTypeInfos(TypeMap& tmap, size_t from, size_t len)
{
    typedef typename ContainerTraits<TypeMap>::Iterator Iterator;

    Iterator first = tmap.begin();
    Iterator last = tmap.end();
    Iterator ub = tmap.lower_bound(from + len);

    // the same for the beginning, but there we need the previous map entry
    Iterator lb = tmap.lower_bound(from);

    lb = adjustPosOnOverlap(first, lb, from);

    return std::make_pair(lb, ub);
}
开发者ID:8l,项目名称:rose,代码行数:17,代码来源:MemoryManager.cpp

示例6: FindTypes

uint32_t SymbolFile::FindTypes(
    const SymbolContext &sc, const ConstString &name,
    const CompilerDeclContext *parent_decl_ctx, bool append,
    uint32_t max_matches,
    llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
    TypeMap &types) {
  if (!append)
    types.Clear();
  return 0;
}
开发者ID:krytarowski,项目名称:lldb,代码行数:10,代码来源:SymbolFile.cpp

示例7: FindTypes

size_t SymbolVendor::FindTypes(const std::vector<CompilerContext> &context,
                               bool append, TypeMap &types) {
  ModuleSP module_sp(GetModule());
  if (module_sp) {
    std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
    if (m_sym_file_ap.get())
      return m_sym_file_ap->FindTypes(context, append, types);
  }
  if (!append)
    types.Clear();
  return 0;
}
开发者ID:linux-on-ibm-z,项目名称:swift-lldb,代码行数:12,代码来源:SymbolVendor.cpp

示例8: mapWithCommonTypes

TypeMap mapWithCommonTypes() {
	TypeMap m;

	m.emplace(typeid(short), MPI_SHORT);
	m.emplace(typeid(unsigned short), MPI_UNSIGNED_SHORT);
	m.emplace(typeid(int), MPI_INT);
	m.emplace(typeid(unsigned int), MPI_UNSIGNED);
	m.emplace(typeid(long long), MPI_LONG_LONG_INT);
	m.emplace(typeid(unsigned long long), MPI_UNSIGNED_LONG_LONG);

	return m;
}
开发者ID:BlueEyedHush,项目名称:mpi-graph-framework,代码行数:12,代码来源:MpiTypemap.cpp

示例9: module_sp

size_t
SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, size_t max_matches, TypeMap& types)
{
    ModuleSP module_sp(GetModule());
    if (module_sp)
    {
        lldb_private::Mutex::Locker locker(module_sp->GetMutex());
        if (m_sym_file_ap.get())
            return m_sym_file_ap->FindTypes(sc, name, parent_decl_ctx, append, max_matches, types);
    }
    if (!append)
        types.Clear();
    return 0;
}
开发者ID:wiltonlazary,项目名称:swift-lldb,代码行数:14,代码来源:SymbolVendor.cpp

示例10: typeMap

DataTypeFactory::TypeMap DataTypeFactory::typeMap()
{
    static TypeMap typeMap;
    if (typeMap.isEmpty()) {
        typeMap.insert(Type::Integer, "Integer");
        typeMap.insert(Type::Gauge32, "Gauge32");
        typeMap.insert(Type::Counter32, "Counter32");
        typeMap.insert(Type::OctetString, "String");
        typeMap.insert(Type::IpAddress, "IpAddress");
        typeMap.insert(Type::NullObject, "Unknown type");
    }
    return typeMap;
}
开发者ID:cherkalov,项目名称:QtSnmp,代码行数:13,代码来源:DataTypeFactory.cpp

示例11: has_task_or_graph_type

static bool has_task_or_graph_type(TypeMap<bool>& cache, const Type* type) {
    if (cache.emplace(type, false).second) {
        if (is_task_type(type) || is_graph_type(type))
            return cache[type] = true;
        bool contains = false;
        for (auto op : type->ops()) {
            if (has_task_or_graph_type(cache, op)) {
                contains = true;
                break;
            }
        }
        return cache[type] = contains;
    }

    return cache[type];
}
开发者ID:AnyDSL,项目名称:thorin,代码行数:16,代码来源:rewrite_flow_graphs.cpp

示例12: while

void
SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list ) const
{
    Block * curr_block = block;
    bool isInlinedblock = false;
    if (curr_block != nullptr && curr_block->GetContainingInlinedBlock() != nullptr)
        isInlinedblock = true;

    while (curr_block != nullptr && !isInlinedblock)
    {
        TypeMoveMatchingBlock callbackBlock (curr_block, type_map, type_list);
        type_map.ForEach(callbackBlock);
        curr_block = curr_block->GetParent();
    }
    if(function != nullptr && type_map.GetSize() > 0)
    {
        TypeMoveMatchingFunction callbackFunction (function, type_map, type_list);
        type_map.ForEach(callbackFunction);
    }
    if(comp_unit != nullptr && type_map.GetSize() > 0)
    {
        TypeMoveMatchingCompileUnit callbackCompileUnit (comp_unit, type_map, type_list);
        type_map.ForEach(callbackCompileUnit);
    }
    if(module_sp && type_map.GetSize() > 0)
    {
        TypeMoveMatchingModule callbackModule (module_sp, type_map, type_list);
        type_map.ForEach(callbackModule);
    }
    if(type_map.GetSize() > 0)
    {
        TypeMaptoList callbackM2L (type_map, type_list);
        type_map.ForEach(callbackM2L);

    }
	return ;
}
开发者ID:RichardsonAlex,项目名称:lldb,代码行数:37,代码来源:SymbolContext.cpp

示例13: begin

	// forech-able necessary methods.
	typename TypeMap::iterator begin() { 
	
		return bindings.begin(); 
	}
开发者ID:Darelbi,项目名称:Infectorpp2,代码行数:5,代码来源:GenericBinding.hpp

示例14: get

	typename TypeMap::iterator get( TypeInfoP interface){
		return bindings.find( std::type_index(*interface));
	}
开发者ID:Darelbi,项目名称:Infectorpp2,代码行数:3,代码来源:GenericBinding.hpp

示例15: found

	bool found(typename TypeMap::iterator it){
		return it != bindings.end();
	}
开发者ID:Darelbi,项目名称:Infectorpp2,代码行数:3,代码来源:GenericBinding.hpp


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