• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TypeList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: typeChange

bool
FreezeScript::AnalyzeInitVisitor::visitStructStart(const StructPtr& v)
{
    if(v->isLocal())
    {
        return false;
    }

    string scoped = v->scoped();
    TypeList l = _oldUnit->lookupTypeNoBuiltin(scoped, false);
    if(!l.empty())
    {
        StructPtr s = StructPtr::dynamicCast(l.front());
        if(!s)
        {
            typeChange(l.front(), scoped, "struct");
        }
        else
        {
            return false;
        }
    }

    _out.newline();
    _out.newline();
    _out << "<!-- struct " << scoped << " -->";
    _out << se("init") << attr("type", scoped);
    _out << ee;

    return false;
}
开发者ID:Jonavin,项目名称:ice,代码行数:31,代码来源:TransformAnalyzer.cpp


示例2: skip

Node<DeclarationNode>::Link DeclarationParser::declaration(bool throwIfEmpty) {
  if (accept(TT::SEMI)) {
    if (throwIfEmpty) throw InternalError("Empty declaration", {METADATA_PAIRS});
    else return nullptr;
  }
  if (accept(TT::DEFINE)) {
    skip();
    // Dynamic variable declaration
    expect(TT::IDENTIFIER, "Unexpected token after define keyword");
    return declarationFromTypes({});
  } else if (accept(TT::IDENTIFIER)) {
    auto ident = current().data;
    skip();
    // Single-type declaration
    if (accept(TT::IDENTIFIER)) {
      return declarationFromTypes({ident});
    }
    // Multi-type declaration
    if (accept(",")) {
      TypeList types = {ident};
      do {
        skip();
        expect(TT::IDENTIFIER, "Expected identifier in type list");
        types.insert(current().data);
        skip();
      } while (accept(","));
      expect(TT::IDENTIFIER);
      return declarationFromTypes(types);
    }
  }
  throw Error("SyntaxError", "Invalid declaration", current().trace);
}
开发者ID:slak44,项目名称:test-lang,代码行数:32,代码来源:tokenParser.cpp


示例3:

FbTextElement::TypeList::const_iterator FbTextElement::subtype(const TypeList &list, const QString &style)
{
    for (TypeList::const_iterator item = list.begin(); item != list.end(); item++) {
        if (item->name() == style) return item;
    }
    return list.end();
}
开发者ID:energoarbitr,项目名称:fb2edit,代码行数:7,代码来源:fb2html.cpp


示例4: categorizeByType

 /**
  * @brief Return list of types in kernel list
  *
  * This method determines what types of kernels are currently in the internal
  * list and returns them in alphabetical order.  An empty list is returned if
  * there are no kernels.  The list may contain "UNKNOWN" which is the default
  * type assigned when the type of the kernel file cannot be determined.  These
  * kernels are excluded from any loading/unloading.
  *
  * The list of known types are:
  *
  * CK
  * SPK
  * DAF  (synonymous for SPKs as well so load both)
  * PCK
  * EK
  * META
  * IK
  * FK
  * SCLK
  * IAK  (ISIS specific)
  *
  * Kernel types are determined by inspecting the first 8 characters of a
  * kernel file and extracting the contents there.  The actual type is the
  * string value after the last '/' character.  This is typically the value
  * that is also returned by the NAIF kinfo_c utility.
  *
  * @return std::vector<QString> Alphabetical list of kernel types
  */
 QStringList Kernels::getKernelTypes() const {
   TypeList kmap = categorizeByType();
   QStringList types;
   for (int i = 0 ; i < kmap.size() ; i++) {
     types.append(kmap.key(i));
   }
   return (types);
 }
开发者ID:corburn,项目名称:ISIS,代码行数:37,代码来源:Kernels.cpp


示例5: typeList

Address::TypeList Address::typeList()
{
    static TypeList list;

    if(list.isEmpty())
        list << Dom << Intl << Postal << Parcel << Home << Work << Pref;

    return list;
}
开发者ID:serghei,项目名称:kde3-kdelibs,代码行数:9,代码来源:address.cpp


示例6: typeList

Secrecy::TypeList Secrecy::typeList()
{
  static TypeList list;

  if ( list.isEmpty() )
    list << Public << Private << Confidential;

  return list;
}
开发者ID:,项目名称:,代码行数:9,代码来源:


示例7: getTypeList

TypeList FunctionParser::getTypeList() {
  TypeList types = {};
  skip(-1); // Counter the comma skip below for the first iteration
  do {
    skip(1); // Skips the comma
    expect(TT::IDENTIFIER, "Expected identifier in type list");
    types.insert(current().data);
    skip();
  } while (accept(","));
  return types;
}
开发者ID:slak44,项目名称:test-lang,代码行数:11,代码来源:tokenParser.cpp


示例8: m_list

FbTextElement::Sublist::Sublist(const TypeList &list, const QString &name)
    : m_list(list)
    , m_pos(list.begin())
{
    TypeList::const_iterator empty = list.end();
    while (m_pos != list.end()) {
        if (m_pos->name() == name) break;
        if (m_pos->name().isEmpty()) empty = m_pos;
        m_pos++;
    }
    if (m_pos == list.end()) m_pos = empty;
}
开发者ID:energoarbitr,项目名称:fb2edit,代码行数:12,代码来源:fb2html.cpp


示例9: type_basename_const_str

uint32_t
Module::FindTypes (const SymbolContext& sc,
                   const ConstString &name,
                   bool exact_match,
                   uint32_t max_matches,
                   TypeList& types)
{
    uint32_t num_matches = 0;
    const char *type_name_cstr = name.GetCString();
    std::string type_scope;
    std::string type_basename;
    const bool append = true;
    TypeClass type_class = eTypeClassAny;
    if (Type::GetTypeScopeAndBasename (type_name_cstr, type_scope, type_basename, type_class))
    {
        // Check if "name" starts with "::" which means the qualified type starts
        // from the root namespace and implies and exact match. The typenames we
        // get back from clang do not start with "::" so we need to strip this off
        // in order to get the qualfied names to match

        if (type_scope.size() >= 2 && type_scope[0] == ':' && type_scope[1] == ':')
        {
            type_scope.erase(0,2);
            exact_match = true;
        }
        ConstString type_basename_const_str (type_basename.c_str());
        if (FindTypes_Impl(sc, type_basename_const_str, NULL, append, max_matches, types))
        {
            types.RemoveMismatchedTypes (type_scope, type_basename, type_class, exact_match);
            num_matches = types.GetSize();
        }
    }
    else
    {
        // The type is not in a namespace/class scope, just search for it by basename
        if (type_class != eTypeClassAny)
        {
            // The "type_name_cstr" will have been modified if we have a valid type class
            // prefix (like "struct", "class", "union", "typedef" etc).
            num_matches = FindTypes_Impl(sc, ConstString(type_name_cstr), NULL, append, max_matches, types);
            types.RemoveMismatchedTypes (type_class);
            num_matches = types.GetSize();
        }
        else
        {
            num_matches = FindTypes_Impl(sc, name, NULL, append, max_matches, types);
        }
    }
    
    return num_matches;
    
}
开发者ID:,项目名称:,代码行数:52,代码来源:


示例10: FindTypeList

TypeItem*
TResourceSet::FindItemID(type_code type, int32 id)
{
	TypeList* list = FindTypeList(type);
	TypeItem* item = NULL;
	
	if (list) item = list->FindItemByID(id);
	
	if (!item)
		item = LoadResource(type, id, 0, &list);
	
	return item;
}
开发者ID:mariuz,项目名称:haiku,代码行数:13,代码来源:ResourceSet.cpp


示例11: typeChange

bool
FreezeScript::AnalyzeTransformVisitor::visitClassDefStart(const ClassDefPtr& v)
{
    if(v->isInterface() || v->isLocal())
    {
        return false;
    }

    string scoped = v->scoped();
    if(ignoreType(scoped))
    {
        return false;
    }

    TypeList l = _newUnit->lookupTypeNoBuiltin(scoped, false);
    if(l.empty())
    {
        _missingTypes.push_back(scoped);
        return false;
    }

    ClassDeclPtr decl = ClassDeclPtr::dynamicCast(l.front());
    if(!decl || decl->isInterface())
    {
        if(!_ignoreTypeChanges)
        {
            typeChange(scoped, v->declaration(), l.front());
        }
        return false;
    }

    ClassDefPtr newClass = decl->definition();
    if(!newClass)
    {
        _missingTypes.push_back(scoped);
        return false;
    }

    _out.newline();
    _out.newline();
    _out << "<!-- class " << scoped << " -->";
    _out << se("transform") << attr("type", scoped);

    DataMemberList oldMembers = v->dataMembers();
    DataMemberList newMembers = newClass->dataMembers();
    compareMembers(oldMembers, newMembers);

    _out << ee;

    return false;
}
开发者ID:bholl,项目名称:zeroc-ice,代码行数:51,代码来源:TransformAnalyzer.cpp


示例12: FindTypeList

TypeItem*
TResourceSet::FindItemName(type_code type, const char* name)
{
	TypeList* list = FindTypeList(type);
	TypeItem* item = NULL;

	if (list)
		item = list->FindItemByName(name);

	if (!item)
		item = LoadResource(type, -1, name, &list);

	return item;
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:14,代码来源:ResourceSet.cpp


示例13: lock

TypeList*
TResourceSet::FindTypeList(type_code type)
{
	BAutolock lock(&fLock);

	int32 count = fTypes.CountItems();
	for (int32 i = 0; i < count; i++ ) {
		TypeList* list = (TypeList*)fTypes.ItemAt(i);
		if (list && list->Type() == type)
			return list;
	}

	return NULL;
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:14,代码来源:ResourceSet.cpp


示例14: locker

uint32_t
SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types)
{
    Mutex::Locker locker(m_mutex);
    if (m_sym_file_ap.get())
        return m_sym_file_ap->FindTypes(sc, name, namespace_decl, append, max_matches, types);
    if (!append)
        types.Clear();
    return 0;
}
开发者ID:fbsd,项目名称:old_lldb,代码行数:10,代码来源:SymbolVendor.cpp


示例15: while

void 
Queue<T,M,C>::popAll(TypeList& dlist) 
{
    mMutex.lock();
    while(mQueue.empty()) {
        mCond.wait();
    } 
    dlist.swap(mQueue);
    mMutex.unlock();
}
开发者ID:vazk,项目名称:Norse,代码行数:10,代码来源:yggQueue.hpp


示例16: FieldDecl

    /**
     * Create a new field declaration with exactly one variable in it.
     * If the field is uninitialized, the initializer may be
     * <code>null</code>.
     *
     * @param  context  Context indicating what line and file this
     *                  field is created at
     * @param  type     Type of the field
     * @param  name     Name of the field
     * @param  init     Expression initializing the field, or
     *                  <code>null</code> if the field is uninitialized
     */
    FieldDecl(FEContext *context, Type *type, string name,
	      Expression *init) : FENode(context)
    {
	types = new TypeList;
	names = new NameList;
	inits = new ExpressionList;

	types->push_back(type);
	names->push_back(name);
	inits->push_back(init);
    }
开发者ID:fifield,项目名称:skir,代码行数:23,代码来源:FieldDecl.hpp


示例17:

bool
FreezeScript::AnalyzeTransformVisitor::checkClasses(const ClassDeclPtr& from, const ClassDeclPtr& to)
{
    string fromScoped = from->scoped();
    string toScoped = to->scoped();

    if(fromScoped == toScoped)
    {
        return true;
    }

    //
    // The types don't match, so check them for compatibility. Specifically,
    // look up the old type id in the new Slice and see if it has the target
    // type as a base class.
    //
    TypeList l = to->unit()->lookupTypeNoBuiltin(from->scoped(), false);
    if(!l.empty())
    {
        ClassDeclPtr decl = ClassDeclPtr::dynamicCast(l.front());
        if(decl)
        {
            ClassDefPtr def = decl->definition();
            if(def)
            {
                ClassList bases = def->allBases();
                for(ClassList::iterator p = bases.begin(); p != bases.end(); ++p)
                {
                    if((*p)->scoped() == toScoped)
                    {
                        return true;
                    }
                }
            }
        }
    }

    return false;
}
开发者ID:Jonavin,项目名称:ice,代码行数:39,代码来源:TransformAnalyzer.cpp


示例18: module_sp

size_t
SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, size_t max_matches, TypeList& 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, namespace_decl, append, max_matches, types);
    }
    if (!append)
        types.Clear();
    return 0;
}
开发者ID:gnuhub,项目名称:lldb,代码行数:14,代码来源:SymbolVendor.cpp


示例19: writeSchema

void ObjectWrapper::writeSchema( StringList& properties, TypeList& types )
{
    SerializerList::iterator sitr = _serializers.begin();
    TypeList::iterator titr = _typeList.begin();
    while(sitr!=_serializers.end() && titr!=_typeList.end())
    {
        if ((*sitr)->supportsReadWrite())
        {
            properties.push_back( (*sitr)->getName() );
            types.push_back( (*titr) );
        }
        ++sitr;
        ++titr;
    }
}
开发者ID:yueying,项目名称:osg,代码行数:15,代码来源:ObjectWrapper.cpp


示例20: Find_Impl

 bool Find_Impl(ExecutionContextScope *exe_scope, const char *key,
                ResultSet &results) override {
   bool result = false;
   
   Target *target = exe_scope->CalculateTarget().get();
   if (target) {
     const auto &images(target->GetImages());
     SymbolContext null_sc;
     ConstString cs_key(key);
     llvm::DenseSet<SymbolFile*> searched_sym_files;
     TypeList matches;
     images.FindTypes(null_sc,
                      cs_key,
                      false,
                      UINT32_MAX,
                      searched_sym_files,
                      matches);
     for (const auto& match : matches.Types()) {
       if (match.get()) {
         CompilerType compiler_type(match->GetFullCompilerType());
         LanguageType lang_type(compiler_type.GetMinimumLanguage());
         // other plugins will find types for other languages - here we only do C and C++
         if (!Language::LanguageIsC(lang_type) && !Language::LanguageIsCPlusPlus(lang_type))
           continue;
         if (compiler_type.IsTypedefType())
           compiler_type = compiler_type.GetTypedefedType();
         std::unique_ptr<Language::TypeScavenger::Result> scavengeresult(
                                                                 new CPlusPlusTypeScavengerResult(compiler_type));
         results.insert(std::move(scavengeresult));
         result = true;
       }
     }
   }
   
   return result;
 }
开发者ID:CodaFi,项目名称:swift-lldb,代码行数:36,代码来源:CPlusPlusLanguage.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TypeLoc类代码示例发布时间:2022-05-31
下一篇:
C++ TypeInfoSet类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap