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


C++ TypeList类代码示例

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


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


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