void NodeCore::kill(NodeCore &ref) { StLock<Mutex> _(*this); assert(hasReference(ref)); ref.kill(); removeReference(ref); }
PaintInfo * TreeFuncNode::getPaintInfo( void ) //-------------------------------------------- { OptionManager * mgr = WBRWinBase::optManager(); return new PaintInfo( mgr->getFunctionOpts().repeated( hasReference() ) ); }
bool GTUtilsAssemblyBrowser::hasReference(HI::GUITestOpStatus& os, const QString &viewTitle) { Q_UNUSED(os); AssemblyBrowserUi* view = getView(os, viewTitle); GT_CHECK_RESULT(NULL != view, "Assembly browser wasn't found", false); return hasReference(os, view); }
std::shared_ptr<IDataArray> BaseTagHDF5::getReference(const std::string &name_or_id) const { std::shared_ptr<IDataArray> da; boost::optional<H5Group> g = refs_group(false); std::string id = block()->resolveEntityId({name_or_id, ObjectType::DataArray}); if (g && hasReference(id)) { H5Group group = g->openGroup(id); da = std::make_shared<DataArrayHDF5>(file(), block(), group); } return da; }
bool GTUtilsAssemblyBrowser::hasReference(HI::GUITestOpStatus& os, QWidget* view) { Q_UNUSED(os); if (NULL == view) { view = GTUtilsMdi::activeWindow(os); } GT_CHECK_RESULT(NULL != view, "View is NULL", false); AssemblyBrowserUi* assemblyBrowser = view->findChild<AssemblyBrowserUi*>("assembly_browser_" + view->objectName()); GT_CHECK_RESULT(NULL != assemblyBrowser, "Assembly browser wasn't found", false); return hasReference(os, assemblyBrowser); }
bool BaseTagHDF5::removeReference(const std::string &name_or_id) { boost::optional<Group> g = refs_group(); bool removed = false; if (g && hasReference(name_or_id)) { shared_ptr<IDataArray> reference = getReference(name_or_id); g->removeGroup(reference->id()); removed = true; } return removed; }
shared_ptr<IDataArray> BaseTagHDF5::getReference(const std::string &name_or_id) const { shared_ptr<IDataArray> da; boost::optional<Group> g = refs_group(); std::string id = name_or_id; if (!util::looksLikeUUID(name_or_id) && block()->hasDataArray(name_or_id)) { id = block()->getDataArray(name_or_id)->id(); } if (g && hasReference(id)) { Group group = g->openGroup(id); da = make_shared<DataArrayHDF5>(file(), block(), group); } return da; }
qint64 AssemblyModel::getModelLength(U2OpStatus & os) { if(NO_VAL == cachedModelLength) { // try to set length from attributes U2AttributeDbi * attributeDbi = dbiHandle.dbi->getAttributeDbi(); if(attributeDbi != NULL) { U2IntegerAttribute attr = U2AttributeUtils::findIntegerAttribute(attributeDbi, assembly.id, U2BaseAttributeName::reference_length, os); LOG_OP(os); if(attr.hasValidId()) { cachedModelLength = attr.value; } // ignore incorrect attribute value and remove corrupted attribute (auto-fix incorrectly converted ugenedb) if(cachedModelLength == 0) { coreLog.details(QString("ignored incorrect value of attribute %1: should be > 0, got %2. Bad attribute removed!").arg(QString(U2BaseAttributeName::reference_length)).arg(cachedModelLength)); cachedModelLength = NO_VAL; U2AttributeUtils::removeAttribute(attributeDbi, attr.id, os); } } // if cannot from attributes -> set from reference or max end pos if(cachedModelLength == NO_VAL) { qint64 refLen = hasReference() ? refObj->getSequenceLength() : 0; qint64 assLen = assemblyDbi->getMaxEndPos(assembly.id, os); LOG_OP(os); cachedModelLength = qMax(refLen, assLen); // and save in attribute U2IntegerAttribute attr; U2AttributeUtils::init(attr, assembly, U2BaseAttributeName::reference_length); attr.value = cachedModelLength; attributeDbi->createIntegerAttribute(attr, os); } if(cachedModelLength == NO_VAL){ os.setError("Can't get model length, database is corrupted"); LOG_OP(os); } } return cachedModelLength; }
void TreeNode::debugInfo( TreeRoot * root ) //----------------------------------------- { WString boundLine; WString descendLine; char * enabled; char * placed; WString statLine; WString refLine; WString rootLine; TreeCoord ox, oy; TreeRect rootRect; ox = _parent->getXOff(); oy = _parent->getYOff(); root->getBound( rootRect ); rootLine.printf( "_rootNode = %s, bounding(%ld,%ld,%ld,%ld) ", root->node()->name(), rootRect.x(), rootRect.y(), rootRect.w(), rootRect.h() ); boundLine.printf( "_bounding [%s] = (%ld,%ld,%ld,%ld), offset = (%ld,%ld) ", (_flags.boundSet) ? "set" : "unset", _bounding.x(), _bounding.y(), _bounding.w(), _bounding.h(), ox, oy ); descendLine.printf( "_sibWidth = %ld, _descend = (%ld,%ld,%ld,%ld) ", _sibWidth, _descend.x(), _descend.y(), _descend.w(), _descend.h() ); switch( _flags.enabled ) { case Hidden: enabled = "Hidden"; break; default: enabled = "Visible"; break; } switch( _flags.placed ) { case NotPlaced: placed = "NotPlaced"; break; case PartiallyPlaced: placed = "PartiallyPlaced"; break; case Arranging: placed = "Arranging"; break; default: placed = "Placed"; } statLine.printf( " enabled = %s, placed = %s, selected = %s, _level = %d\n", enabled, placed, (_flags.selected) ? "true" : "false", getLevel() ); refLine.printf( "hasReference() = %s, isReference() = %s", hasReference() ? "true" : "false", isReference() ? "true" : "false" ); WMessageDialog::messagef( _parent, MsgPlain, MsgOk, name(), "%s%s%s%s%s", (const char *)rootLine, (const char *)boundLine, (const char *)descendLine, (const char *)statLine, (const char *)refLine ); }
void NodeCore::removeReference(NodeCore &p) { StLock<Mutex> _(*this); assert(hasReference(p)); mReferences.erase(&p); }