コード例 #1
0
bool Foam::dlLibraryTable::open
(
    const dictionary& dict,
    const word& libsEntry,
    const TablePtr& tablePtr
)
{
    if (dict.found(libsEntry))
    {
        fileNameList libNames(dict.lookup(libsEntry));

        bool allOpened = (libNames.size() > 0);

        forAll(libNames, i)
        {
            const fileName& libName = libNames[i];

            label nEntries = 0;

            if (tablePtr)
            {
                nEntries = tablePtr->size();
            }

            bool opened = dlLibraryTable::open(libName);
            allOpened = opened && allOpened;

            if (!opened)
            {
                WarningInFunction
                    << "Could not open library " << libName
                    << endl << endl;
            }
            else if (debug && (!tablePtr || tablePtr->size() <= nEntries))
            {
                WarningInFunction
                    << "library " << libName
                    << " did not introduce any new entries"
                    << endl << endl;
            }
        }

        return allOpened;
    }
コード例 #2
0
ファイル: GUI.cpp プロジェクト: iceman50/dc-dev-plugin
void GUI::clear() {
	std::vector<Item*> toDelete;

	for(size_t i = 0, n = table->size(); i < n; ++i) {
		auto data = table->getData(i);
		if(data) {
			toDelete.push_back(reinterpret_cast<Item*>(data));
		}
	}

	table->clear();
	counter = 0;

	for(auto item: toDelete) {
		delete item;
	}

	filterW->clear();
	filter.clear();
	filterSel.clear();
	initFilter();
}