Ejemplo n.º 1
0
void H5SoftLink::getAccessibleAttribute(const std::string & _name, const int pos, void * pvApiCtx) const
{
    SciErr err;
    std::string lower(_name);
    std::transform(_name.begin(), _name.end(), lower.begin(), tolower);

    if (lower == "type")
    {
	const std::string linkType = getLinkType();
        const char * _type = linkType.c_str();
        err = createMatrixOfString(pvApiCtx, pos, 1, 1, &_type);
        if (err.iErr)
        {
            throw H5Exception(__LINE__, __FILE__, _("Cannot create a string on the stack."));
        }

        return;
    }
    else if (lower == "target")
    {
	const std::string linkValue = getLinkValue();
        const char * _target = linkValue.c_str();
        err = createMatrixOfString(pvApiCtx, pos, 1, 1, &_target);
        if (err.iErr)
        {
            throw H5Exception(__LINE__, __FILE__, _("Cannot create a string on the stack."));
        }

        return;
    }

    H5Object::getAccessibleAttribute(_name, pos, pvApiCtx);
}
Ejemplo n.º 2
0
int compareCn(const FeaturesComplexNetwork &cn1, const FeaturesComplexNetwork &cn2,bool compareTimes) {

    if(cn1.getNumNodes() != cn2.getNumNodes())
        return 1;

    if(cn1.getNumArcs() != cn2.getNumArcs())
        return 1;

    for(FeaturesComplexNetwork::ArcIt it(cn1); it != INVALID; ++it ){
        auto fromFeat = cn1.getNode( cn1.source(it) );
        auto toFeat = cn1.getNode( cn1.target(it) );
        auto type = cn1.getLinkArcValue(it);

        auto from = cn2.getNodeFromFeature(fromFeat);
        auto to = cn2.getNodeFromFeature(toFeat);

        FeaturesComplexNetwork::Arc it2 = cn2.getArc(from,to, type.getLinkType());

        if( cn2.getLinkArcValue(it2).getWeight() != cn1.getLinkArcValue(it).getWeight() ){
            return 1;
        }
        if( compareTimes && cn2.getLinkArcValue(it2).getTime() != cn1.getLinkArcValue(it).getTime() ){
            return 1;
        }
    }
    return 0;
}
Ejemplo n.º 3
0
void GxsFeedItem::copyMessageLink()
{
	if (groupId().isNull() || mMessageId.isNull()) {
		return;
	}

	if (getLinkType() == RetroShareLink::TYPE_UNKNOWN) {
		return;
	}

	RetroShareLink link;
	if (link.createGxsMessageLink(getLinkType(), groupId(), mMessageId, messageName())) {
		QList<RetroShareLink> urls;
		urls.push_back(link);
		RSLinkClipboard::copyLinks(urls);
	}
}
Ejemplo n.º 4
0
std::string H5SoftLink::toString(const unsigned int indentLevel) const
{
    std::ostringstream os;
    std::string indentString = H5Object::getIndentString(indentLevel);

    os << indentString << _("Filename") << ": " << getFile().getFileName() << std::endl
       << indentString << _("Link type") << ": " << getLinkType() << std::endl
       << indentString << _("Link name") << ": " << name << std::endl
       << indentString << _("Link path") << ": " << getCompletePath() << std::endl
       << indentString << _("Link target") << ": " << getLinkValue() << std::endl;

    return os.str();
}