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


C++ DictionaryEntry类代码示例

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


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

示例1: get_entry

bool Dictionary::is_valid_protection_domain(int index, unsigned int hash,
                                            Symbol* name,
                                            ClassLoaderData* loader_data,
                                            Handle protection_domain) {
  DictionaryEntry* entry = get_entry(index, hash, name, loader_data);
  return entry->is_valid_protection_domain(protection_domain);
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:7,代码来源:dictionary.cpp

示例2: dictionary

void Dictionary::print() {
  ResourceMark rm;
  HandleMark   hm;

  tty->print_cr("Java system dictionary (table_size=%d, classes=%d)",
                 table_size(), number_of_entries());
  tty->print_cr("^ indicates that initiating loader is different from "
                "defining loader");

  for (int index = 0; index < table_size(); index++) {
    for (DictionaryEntry* probe = bucket(index);
                          probe != NULL;
                          probe = probe->next()) {
      if (Verbose) tty->print("%4d: ", index);
      Klass* e = probe->klass();
      ClassLoaderData* loader_data =  probe->loader_data();
      bool is_defining_class =
         (loader_data == InstanceKlass::cast(e)->class_loader_data());
      tty->print("%s%s", is_defining_class ? " " : "^",
                   e->external_name());

        tty->print(", loader ");
      loader_data->print_value();
      tty->cr();
    }
  }
  tty->cr();
  _pd_cache_table->print();
  tty->cr();
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:30,代码来源:dictionary.cpp

示例3: guarantee

void Dictionary::verify() {
  guarantee(number_of_entries() >= 0, "Verify of system dictionary failed");

  int element_count = 0;
  for (int index = 0; index < table_size(); index++) {
    for (DictionaryEntry* probe = bucket(index);
                          probe != NULL;
                          probe = probe->next()) {
      Klass* e = probe->klass();
      ClassLoaderData* loader_data = probe->loader_data();
      guarantee(e->oop_is_instance(),
                              "Verify of system dictionary failed");
      // class loader must be present;  a null class loader is the
      // boostrap loader
      guarantee(loader_data != NULL || DumpSharedSpaces ||
                loader_data->class_loader() == NULL ||
                loader_data->class_loader()->is_instance(),
                "checking type of class_loader");
      e->verify();
      probe->verify_protection_domain_set();
      element_count++;
    }
  }
  guarantee(number_of_entries() == element_count,
            "Verify of system dictionary failed");
  debug_only(verify_lookup_length((double)number_of_entries() / table_size()));

  _pd_cache_table->verify();
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:29,代码来源:dictionary.cpp

示例4: assert

Klass* Dictionary::find_shared_class(int index, unsigned int hash,
                                       Symbol* name) {
  assert (index == index_for(name, NULL), "incorrect index?");

  DictionaryEntry* entry = get_entry(index, hash, name, NULL);
  return (entry != NULL) ? entry->klass() : (Klass*)NULL;
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:7,代码来源:dictionary.cpp

示例5: new_entry

DictionaryEntry* Dictionary::new_entry(unsigned int hash, Klass* klass,
                                       ClassLoaderData* loader_data) {
  DictionaryEntry* entry = (DictionaryEntry*)Hashtable<Klass*, mtClass>::new_entry(hash, klass);
  entry->set_loader_data(loader_data);
  entry->set_pd_set(NULL);
  assert(klass->oop_is_instance(), "Must be");
  return entry;
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:8,代码来源:dictionary.cpp

示例6: assert_locked_or_safepoint

Klass* Dictionary::find_class(int index, unsigned int hash,
                                Symbol* name, ClassLoaderData* loader_data) {
  assert_locked_or_safepoint(SystemDictionary_lock);
  assert (index == index_for(name, loader_data), "incorrect index?");

  DictionaryEntry* entry = get_entry(index, hash, name, loader_data);
  return (entry != NULL) ? entry->klass() : (Klass*)NULL;
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:8,代码来源:dictionary.cpp

示例7: new_entry

DictionaryEntry* Dictionary::new_entry(unsigned int hash, klassOop klass,
                                       oop loader) {
  DictionaryEntry* entry;
entry=(DictionaryEntry*)Hashtable::new_entry(hash,POISON_KLASSREF(klassRef(klass)));
entry->set_loader(ALWAYS_POISON_OBJECTREF(objectRef(loader)));
  entry->set_name(ALWAYS_POISON_OBJECTREF(objectRef(instanceKlass::cast(klass)->name())));
  entry->set_pd_set(NULL);
  return entry;
}
开发者ID:GregBowyer,项目名称:ManagedRuntimeInitiative,代码行数:9,代码来源:dictionary.cpp

示例8: f

//   All classes, and their class loaders
// Don't iterate over placeholders
void Dictionary::classes_do(void f(Klass*, ClassLoaderData*)) {
  for (int index = 0; index < table_size(); index++) {
    for (DictionaryEntry* probe = bucket(index);
                          probe != NULL;
                          probe = probe->next()) {
      Klass* k = probe->klass();
      f(k, probe->loader_data());
    }
  }
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:12,代码来源:dictionary.cpp

示例9: bucket

void Dictionary::reorder_dictionary() {

  // Copy all the dictionary entries into a single master list.

  DictionaryEntry* master_list = NULL;
  for (int i = 0; i < table_size(); ++i) {
    DictionaryEntry* p = bucket(i);
    while (p != NULL) {
      DictionaryEntry* tmp;
      tmp = p->next();
      p->set_next(master_list);
      master_list = p;
      p = tmp;
    }
    set_entry(i, NULL);
  }

  // Add the dictionary entries back to the list in the correct buckets.
  while (master_list != NULL) {
    DictionaryEntry* p = master_list;
    master_list = master_list->next();
    p->set_next(NULL);
    Symbol* class_name = InstanceKlass::cast((Klass*)(p->klass()))->name();
    // Since the null class loader data isn't copied to the CDS archive,
    // compute the hash with NULL for loader data.
    unsigned int hash = compute_hash(class_name, NULL);
    int index = hash_to_index(hash);
    p->set_hash(hash);
    p->set_loader_data(NULL);   // loader_data isn't copied to CDS
    p->set_next(bucket(index));
    set_entry(index, p);
  }
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:33,代码来源:dictionary.cpp

示例10: debug_only

// This routine does not lock the system dictionary.
//
// Since readers don't hold a lock, we must make sure that system
// dictionary entries are only removed at a safepoint (when only one
// thread is running), and are added to in a safe way (all links must
// be updated in an MT-safe manner).
//
// Callers should be aware that an entry could be added just after
// _buckets[index] is read here, so the caller will not see the new entry.
DictionaryEntry* Dictionary::get_entry(int index, unsigned int hash,
                                       Symbol* class_name,
                                       ClassLoaderData* loader_data) {
  debug_only(_lookup_count++);
  for (DictionaryEntry* entry = bucket(index);
                        entry != NULL;
                        entry = entry->next()) {
    if (entry->hash() == hash && entry->equals(class_name, loader_data)) {
      return entry;
    }
    debug_only(_lookup_length++);
  }
  return NULL;
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:23,代码来源:dictionary.cpp

示例11: always_strong_classes_do

void Dictionary::always_strong_classes_do(KlassClosure* closure) {
  // Follow all system classes and temporary placeholders in dictionary
  for (int index = 0; index < table_size(); index++) {
    for (DictionaryEntry* probe = bucket(index);
                          probe != NULL;
                          probe = probe->next()) {
      Klass* e = probe->klass();
      ClassLoaderData* loader_data = probe->loader_data();
      if (is_strongly_reachable(loader_data, e)) {
        closure->do_klass(e);
      }
    }
  }
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:14,代码来源:dictionary.cpp

示例12: DictionaryEntry

void EnchantSpellingAlternativesPrivate::setEnchantSpellingAlternatives(
  Token* token,
  MorphoSyntacticData* tokenData,
  FsaStringsPool& sp)
{
  // try to find simple Uncapitalization
  MORPHOLOGINIT;
  // FIXME Conditions below could be process unit parameters
  const LimaString& tokenStr=token->stringForm();
  if (token->status().getAlphaCapital() == T_CAPITAL
    || token->status().getAlphaCapital() == T_CAPITAL_1ST
    || token->status().getAlphaCapital() == T_CAPITAL_SMALL
    || token->status().isAlphaConcatAbbrev()
    || token->status().isAlphaHyphen()
    || token->status().isAlphaPossessive()
    || tokenStr.toUpper() == tokenStr)
  {
    return;
  }
  std::vector<std::string> suggestions = m_enchantDictionary->suggest(tokenStr.toUtf8().constData());
  for (std::vector<std::string>::const_iterator it = suggestions.begin(); it != suggestions.end();it++)
  {
    LimaString correction = LimaString::fromUtf8((*it).c_str());
    // FIXME Conditions below could be process unit parameters
    if ( correction.size() > 1 && correction != tokenStr )
    {
      DictionaryEntry* entry = new DictionaryEntry(m_dictionary->getEntry(correction));
      MorphoSyntacticDataHandler lingInfosHandler(*tokenData, SPELLING_ALTERNATIVE);
      
      
      if (!entry->isEmpty())
      {
        LINFO << "EnchantSpellingAlternativesPrivate::setEnchantSpellingAlternatives correcting" << tokenStr << "into" << correction;
        // add orthographic alternative to Token;
        StringsPoolIndex idx=sp[correction];
        token->addOrthographicAlternatives(idx);
        
        if (entry->hasLingInfos())
        {
          entry->parseLingInfos(&lingInfosHandler);
        }
      } 
      else 
      {
        delete entry;
      }
    }
  }
}
开发者ID:FaizaGara,项目名称:lima,代码行数:49,代码来源:EnchantSpellingAlternatives.cpp

示例13: always_strong_oops_do

void Dictionary::always_strong_oops_do(OopClosure* blk) {
  // Follow all system classes and temporary placeholders in dictionary; only
  // protection domain oops contain references into the heap. In a first
  // pass over the system dictionary determine which need to be treated as
  // strongly reachable and mark them as such.
  for (int index = 0; index < table_size(); index++) {
    for (DictionaryEntry *probe = bucket(index);
                          probe != NULL;
                          probe = probe->next()) {
      Klass* e = probe->klass();
      ClassLoaderData* loader_data = probe->loader_data();
      if (is_strongly_reachable(loader_data, e)) {
        probe->set_strongly_reachable();
      }
    }
  }
  // Then iterate over the protection domain cache to apply the closure on the
  // previously marked ones.
  _pd_cache_table->always_strong_oops_do(blk);
}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:20,代码来源:dictionary.cpp

示例14: DictionaryEntry

void OrthographicAlternatives::createAlternative(
  Token* srcToken,
  MorphoSyntacticData* tokenData,
  LimaString& str,
  AnalysisDict::AbstractAnalysisDictionary* dictionary,
  StringsPool& sp)
{
  MORPHOLOGINIT;
  LDEBUG << "OrthographicAlternatives::createAlternative" << str;
  DictionaryEntry* dicoEntry = new DictionaryEntry(dictionary->getEntry(str));
  if (!dicoEntry->isEmpty())
  {
    // add orthographic alternative to Token;
    StringsPoolIndex infl=sp[str];
    Token* altToken=new Token(infl,str,srcToken->position(),srcToken->length(),new TStatus(*(srcToken->status())));
    altToken->setDictionaryEntry(dicoEntry);
    srcToken->addOrthographicAlternative(altToken);
  
    tokenData->appendLingInfo(infl,dicoEntry,ORTHOGRAPHIC_ALTERNATIVE,sp);

    // if entry has other accented forms,
    // keep them ("PARIS" -> "paris" -> "Paris")
    if (dicoEntry->hasAccented())
    {
      dicoEntry->reset();
      Lima::LimaString alternativeStr = dicoEntry->nextAccented();
      while (alternativeStr.size() != 0)
      {
        // give it its simple word entry into dictionary
        DictionaryEntry* altDicoEntry = new DictionaryEntry(dictionary->getEntry(alternativeStr));
        StringsPoolIndex infl2=sp[alternativeStr];
        tokenData->appendLingInfo(infl2,altDicoEntry,ORTHOGRAPHIC_ALTERNATIVE,sp);
        
        // add orthographic alternative to Token
        Token* altToken2=new Token(infl2,alternativeStr,srcToken->position(),srcToken->length(),new TStatus(*(srcToken->status())));
        altToken2->setDictionaryEntry(altDicoEntry);
        srcToken->addOrthographicAlternative(altToken2);
        
        alternativeStr = dicoEntry->nextAccented();
      }
    }
  } else {
    delete dicoEntry;
  }
}
开发者ID:aymara,项目名称:lima,代码行数:45,代码来源:OrthographicAlternatives.cpp

示例15: append

const thomsonreuters::ema::access::EmaString&  DataDictionaryImpl::toString() const
{	  
	if (!_pRsslDataDictionary->isInitialized)
	{
		_stringToString.clear().append("DataDictionary is not initialized");
		return _stringToString;
	}

	_stringToString.set(0, 2000000);

	_stringToString.append("Data Dictionary Dump: MinFid=").append(getMinFid()).append(" MaxFid=").append(getMaxFid()).
		append(" NumEntries ").append(_pRsslDataDictionary->numberOfEntries).append("\n\n");

	_stringToString.append("Tags:\n  DictionaryId=\"").append(getInfoDictionaryId()).append("\"\n\n");

	_stringToString.append("  [Field Dictionary Tags]\n").
		append("      Filename=\"").append(getFieldFilename()).append("\"\n").
		append("          Desc=\"").append(getFieldDescription()).append("\"\n").
		append("       Version=\"").append(getFieldVersion()).append("\"\n").
		append("         Build=\"").append(getFieldBuild()).append("\"\n").
		append("          Date=\"").append(getFieldDate()).append("\"\n\n");

	_stringToString.append("  [Enum Type Dictionary Tags]\n").
		append("      Filename=\"").append(getEnumFilename()).append("\"\n").
		append("          Desc=\"").append(getEnumDescription()).append("\"\n").
		append("    RT_Version=\"").append(getEnumRecordTemplateVersion()).append("\"\n").
		append("    DT_Version=\"").append(getEnumDisplayTemplateVersion()).append("\"\n").
		append("          Date=\"").append(getEnumDate()).append("\"\n\n");

	_stringToString.append("Field Dictionary:\n");

	RsslDictionaryEntry* rsslDictionaryEntry = 0;
	DictionaryEntry	dictionaryEntry;

	for (Int32 index = 0; index <= _pRsslDataDictionary->maxFid; index++)
	{
		rsslDictionaryEntry = *(_pRsslDataDictionary->entriesArray + index);

		if (rsslDictionaryEntry)
		{
			dictionaryEntry._pImpl->rsslDictionaryEntry(rsslDictionaryEntry);
			_stringToString.append("  Fid=").append(dictionaryEntry.getFid()).append(" '").append(dictionaryEntry.getAcronym()).
				append("' '").append(dictionaryEntry.getDDEAcronym()).
				append("' Type=").append(dictionaryEntry.getFieldType()).
				append(" RippleTo=").append(dictionaryEntry.getRippleToField()).append(" Len=").append(dictionaryEntry.getLength()).
				append(" EnumLen=").append(dictionaryEntry.getEnumLength()).
				append(" RwfType=").append(dictionaryEntry.getRwfType()).append(" RwfLen=").append(dictionaryEntry.getRwfLength()).append("\n");
		}
	}

	_stringToString.append("\nEnum Type Tables:\n");

	RsslEnumTypeTable* rsslEnumTypeTable = 0;
	EnumTypeTable enumTypeTable;

	for (UInt16 index = 0; index <= _pRsslDataDictionary->enumTableCount; index++)
	{
		rsslEnumTypeTable = *(_pRsslDataDictionary->enumTables + index);

		if ( rsslEnumTypeTable )
		{
			enumTypeTable._pImpl->rsslEnumTypeTable( rsslEnumTypeTable );

			_stringToString.append(enumTypeTable.toString());

			_stringToString.append("\n");
		}
	}

	return _stringToString;
}
开发者ID:thomsonreuters,项目名称:Elektron-SDK,代码行数:71,代码来源:DataDictionaryImpl.cpp


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