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


C++ Entry::clear方法代码示例

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


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

示例1: free

void PoolAllocator::free(ID p_mem) {

	mt_lock();
	Entry *e = get_entry(p_mem);
	if (!e) {
		mt_unlock();
		ERR_PRINT("!e");
		return;
	}
	if (e->lock) {
		mt_unlock();
		ERR_PRINT("e->lock");
		return;
	}

	EntryIndicesPos entry_indices_pos;

	bool index_found = find_entry_index(&entry_indices_pos, e);
	if (!index_found) {

		mt_unlock();
		ERR_FAIL_COND(!index_found);
	}

	for (int i = entry_indices_pos; i < (entry_count - 1); i++) {

		entry_indices[i] = entry_indices[i + 1];
	}

	entry_count--;
	free_mem += aligned(e->len);
	e->clear();
	mt_unlock();
}
开发者ID:allkhor,项目名称:godot,代码行数:34,代码来源:pool_allocator.cpp

示例2: success

oc::result<void> SonyElfFormatWriter::get_entry(File &file, Entry &entry)
{
    OUTCOME_TRYV(m_seg->get_entry(file, entry, m_writer));

    auto swentry = m_seg->entry();

    // Silently handle cmdline entry
    if (swentry->type == SONY_ELF_ENTRY_CMDLINE) {
        entry.clear();

        entry.set_size(m_cmdline.size());

        auto set_as_fatal = finally([&] {
            m_writer.set_fatal();
        });

        OUTCOME_TRYV(write_entry(file, entry));
        OUTCOME_TRYV(write_data(file, m_cmdline.data(), m_cmdline.size()));
        OUTCOME_TRYV(finish_entry(file));
        OUTCOME_TRYV(get_entry(file, entry));

        set_as_fatal.dismiss();
    }

    return oc::success();
}
开发者ID:18712886438,项目名称:DualBootPatcher,代码行数:26,代码来源:sony_elf_writer.cpp

示例3: read

bool ServerConfig::read(const char *filename)
{
    // We depend on the XML parser to validate.
    // The asserts are only the ultimate way out.
    FUX fux;
    FUX::Element *arch, *doc = fux.parse(filename);
    if (!doc)
    {
        LOG_MSG("ServerConfig: Cannot parse '%s'\n", filename);
        return false;
    }
    LOG_ASSERT(doc->getName() == "serverconfig");
    Entry entry;
    stdList<FUX::Element *>::const_iterator archs, e;
    for (archs=doc->getChildren().begin(); archs!=doc->getChildren().end(); ++archs)
    {
        arch = *archs;
        LOG_ASSERT(arch->getName() == "archive");
        e = arch->getChildren().begin();
        LOG_ASSERT((*e)->getName() == "key");
        entry.key = atoi((*e)->getValue().c_str());
        ++e;
        LOG_ASSERT((*e)->getName() == "name");
        entry.name = (*e)->getValue();
        ++e;
        LOG_ASSERT((*e)->getName() == "path");
        entry.path = (*e)->getValue();
        config.push_back(entry);
        entry.clear();
    }
    return true;
}
开发者ID:EPICSTools,项目名称:ChannelArchiver,代码行数:32,代码来源:ServerConfig.cpp

示例4: find

 bool Processes::find ( Entry& entry )
 {
     entry.clear();
     const ::BOOL result = ::Process32FirstW(handle(), &entry.data());
     if ( result == FALSE )
     {
         const ::DWORD error = ::GetLastError();
         UNCHECKED_WIN32C_ERROR(Process32FirstW, error);
     }
     return (true);
 }
开发者ID:AndreLouisCaron,项目名称:w32,代码行数:11,代码来源:Processes.cpp

示例5: next

 bool Processes::next ( Entry& entry )
 {
     entry.clear();
     const ::BOOL result = ::Process32NextW(handle(), &entry.data());
     if ( result == FALSE )
     {
         const ::DWORD error = ::GetLastError();
         if ( error == ERROR_NO_MORE_FILES ) {
             return (false);
         }
         UNCHECKED_WIN32C_ERROR(Process32FirstW, error);
     }
     return (true);
 }
开发者ID:AndreLouisCaron,项目名称:w32,代码行数:14,代码来源:Processes.cpp

示例6: accept

void DefineEntry::accept()
{
#ifdef DEBUG
    qDebug("DefineEntry::accpet()");
#endif
    if (!EntryProperties->count())
    {
        QMessageBox::warning(this, "No properties", "Please, define some entry's\nproperties", 0, 0, 0);
        return;
    }

    if (EntryName->text() == "")
    {
        QMessageBox::warning(this, "No entry name", "Please, define entry name", 0, 0, 0);
        return;
    }

    Entries *entries = IQApp->entries();

    Entry *entry;

    if (editEntry)
    {
        if (EntryName->text() != editEntry->getName() && entries->isIn(EntryName->text()))
        {
            QMessageBox::warning(this, "Entry exists", "Entry with such name\nexists. Please, choose another.", 0, 0, 0);
            return;
        }

        entry = editEntry;
        entry->clear();
        entry->setName(EntryName->text());
    }
    else if ((entry = entries->isIn(EntryName->text())))
    {
        QMessageBox::warning(this, "Entry exists", "Entry with such name\nexists. Please, choose another.", 0, 0, 0);
        return;
    }
    else
        entry = new Entry(EntryName->text());

    for (uint i = 0; true; i++)
    {
        PropertyBoxItem *pbi;

        if ((pbi = static_cast<PropertyBoxItem *>(EntryProperties->item(i))))
        {
            entry->addProperty(new PropertyStruct(pbi));
        }
        else
            break;
    }
    
    entry->setDefaultPic(defaultPic);

    if (!editEntry)
        entries->addEntry(entry);

    entry->checkPropertiesID();

    DefineEntryBase::accept();
}
开发者ID:BackupTheBerlios,项目名称:iqnotes-svn,代码行数:62,代码来源:defineEntry.cpp


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