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


C++ Id类代码示例

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


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

示例1: foreach

Id InterpreterEditorManager::element(Id const &id, qrRepo::RepoApi const * const repo, Id const &diagram) const
{
	foreach (Id const &element, repo->children(diagram)) {
		if (id.element() == repo->name(element) && repo->isLogicalElement(element)) {
			return element;
		}
	}

	return Id();
}
开发者ID:wekoxo,项目名称:qreal,代码行数:10,代码来源:interpreterEditorManager.cpp

示例2: addTable

/**
 * @brief Add a table to streamer.
 *
 * @param table Id of table.
 */
void Streamer::addTable( Id table )
{
    // If this table is not already in the vector, add it.
    for( size_t i = 0; i < tableIds_.size(); i++)
        if( table.path() == tableIds_[i].path() )
            return;                             /* Already added. */

    Table* t = reinterpret_cast<Table*>(table.eref().data());
    tableIds_.push_back( table );
    tables_.push_back( t );
    tableTick_.push_back( table.element()->getTick() );

    // NOTE: If user can make sure that names are unique in table, using name is
    // better than using the full path.
    if( t->getColumnName().size() > 0 )
        columns_.push_back( t->getColumnName( ) );
    else
        columns_.push_back( moose::moosePathToUserPath( table.path() ) );
}
开发者ID:pgleeson,项目名称:moose-core,代码行数:24,代码来源:Streamer.cpp

示例3:

vector< Id > HSolve::children( Id obj )
{
	//~ return Field< vector< Id > >::get( obj, "children" );
	//~ return Field< vector< Id > >::fastGet( obj.eref(), "children" );
	//~ return localGet< Neutral, vector< Id > >( obj.eref(), "children" );
	
	vector< Id > c;
	Neutral::children( obj.eref(), c );
	return c;
}
开发者ID:Vivek-sagar,项目名称:moose-1,代码行数:10,代码来源:HSolve.cpp

示例4:

RelayForwarder::RelayForwarder(const Id &local_id, const ConnectionTable &ct,
                               const QSharedPointer<RpcHandler> &rpc) :
    _local_id(local_id),
    _base_been(local_id.ToString()),
    _ct(ct),
    _rpc(rpc),
    _cache(4096)
{
    _rpc->Register("RF::Data", this, "IncomingData");
}
开发者ID:benjaminp,项目名称:Dissent,代码行数:10,代码来源:RelayForwarder.cpp

示例5: setSeed

void HSolve::setSeed( Id seed )
{
	if ( !seed()->cinfo()->isA( "Compartment" ) ) {
		cerr << "Error: HSolve::setSeed(): Seed object '" << seed.path()
		     << "' is not derived from type 'Compartment'." << endl;
		return;
	}
	
	seed_ = seed;
}
开发者ID:Vivek-sagar,项目名称:moose-1,代码行数:10,代码来源:HSolve.cpp

示例6: callMethod

	virtual QStringList callMethod(
			EditorManagerInterface *editorManagerInterface
			, const Id &editorId
			, const Id &diagramId
			, const Id &elementId
			, const QString &propertyName
			) const
	{
		Q_UNUSED(elementId);
		Q_UNUSED(propertyName);
		const QString &editorName = editorId.editor();
		const QString &diagramName = diagramId.diagram();

		mResult = callFunction([editorManagerInterface, editorName, diagramName]()
				{ return editorManagerInterface->diagramNodeName(editorName, diagramName); });

		return ConvertingMethods::convertStringIntoStringList(
				editorManagerInterface->diagramNodeName(editorName, diagramName));
	}
开发者ID:Antropovi,项目名称:qreal,代码行数:19,代码来源:methodsTesterForQrxcAndInterpreter.cpp

示例7: qDebug

void RelayForwarder::Send(const QSharedPointer<Connection> &con,
                          const Id &to, const QByteArray &data, const QStringList &been,
                          const QStringList &reverse)
{
    QVariantHash msg;
    msg["to"] = to.ToString();
    msg["data"] = data;
    msg["been"] = been + _base_been;

    if(!reverse.isEmpty()) {
        msg["reverse"] = reverse;
    }

    qDebug() << con->GetLocalId().ToString() << "Forwarding message from" <<
             msg["been"].toStringList().value(0) << "to" << to.ToString() << "via" <<
             con->GetRemoteId().ToString() << "Reverse path" << !reverse.isEmpty();

    _rpc->SendNotification(con, "RF::Data", msg);
}
开发者ID:benjaminp,项目名称:Dissent,代码行数:19,代码来源:RelayForwarder.cpp

示例8: activeTabChanged

void VisualDebuggerPlugin::activeTabChanged(Id const &rootElementId)
{
	bool const enabled = rootElementId.diagram() == blockDiagram;
	foreach (ActionInfo const &actionInfo, mActionInfos) {
		if (actionInfo.isAction()) {
			actionInfo.action()->setEnabled(enabled);
		} else {
			actionInfo.menu()->setEnabled(enabled);
		}
	}
}
开发者ID:Esenin,项目名称:qreal,代码行数:11,代码来源:visualDebuggerPlugin.cpp

示例9:

void HHChannel2D::innerDestroyGate( const string& gateName, 
	HHGate2D** gatePtr, Id chanId )
{
	if ( *gatePtr == 0 ) {
		cout << "Warning: HHChannel2D::destroyGate: '" << gateName <<
			"' on Element '" << chanId.path() << "' not present\n";
		return;
	}
	delete (*gatePtr);
	*gatePtr = 0;
}
开发者ID:Vivek-sagar,项目名称:moose-1,代码行数:11,代码来源:HHChannel2D.cpp

示例10: HandleShuffle

void ShuffleRound::HandleShuffle(QDataStream &stream, const Id &id)
{
    qDebug() << _group.GetIndex(_local_id) << _local_id.ToString() <<
             ": received shuffle data from " << _group.GetIndex(id) << id.ToString();

    if(_state != WaitingForShuffle) {
        qWarning() << "Received a shuffle message while in state " <<
                   StateToString(_state) << " from " << id.ToString();
        return;
    }

    if(_group.Previous(_local_id) != id) {
        qWarning() << "Received shuffle out of order from " << id.ToString();
        return;
    }

    stream >> _shuffle_data;

    Shuffle();
}
开发者ID:brainburn,项目名称:Dissent,代码行数:20,代码来源:ShuffleRound.cpp

示例11: name_

Element::Element( Id id, const Cinfo* c, const string& name )
	:	name_( name ),
		id_( id ),
		cinfo_( c ), 
		msgBinding_( c->numBindIndex() ),
		msgDigest_( c->numBindIndex() ),
		isRewired_( false ),
		isDoomed_( false )
{
	id.bindIdToElement( this );
}
开发者ID:csiki,项目名称:MOOSE,代码行数:11,代码来源:Element.cpp

示例12: foreach

Id Subprograms::graphicalId(Id const &logicalId) const
{
	IdList const graphicalIds = mRepo.graphicalElements(logicalId.type());
	foreach (Id const &id, graphicalIds) {
		if (mRepo.logicalId(id) == logicalId) {
			return id;
		}
	}

	return Id();
}
开发者ID:timbog,项目名称:qreal,代码行数:11,代码来源:subprograms.cpp

示例13: saveSettings

void ActionManagerPrivate::saveSettings(QSettings *settings)
{
    settings->beginWriteArray(QLatin1String(settingsGroup));
    int count = 0;

    const IdCmdMap::const_iterator cmdcend = m_idCmdMap.constEnd();
    for (IdCmdMap::const_iterator j = m_idCmdMap.constBegin(); j != cmdcend; ++j) {
        const Id id = j.key();
        CommandPrivate *cmd = j.value();
        QKeySequence key = cmd->keySequence();
        if (key != cmd->defaultKeySequence()) {
            settings->setArrayIndex(count);
            settings->setValue(QLatin1String(idKey), id.toString());
            settings->setValue(QLatin1String(sequenceKey), key.toString());
            count++;
        }
    }

    settings->endArray();
}
开发者ID:edwardZhang,项目名称:qt-creator,代码行数:20,代码来源:actionmanager.cpp

示例14: Id

void Ksolve::setDsolve( Id dsolve )
{
    if ( dsolve == Id () )
    {
        dsolvePtr_ = 0;
        dsolve_ = Id();
    }
    else if ( dsolve.element()->cinfo()->isA( "Dsolve" ) )
    {
        dsolve_ = dsolve;
        dsolvePtr_ = reinterpret_cast< ZombiePoolInterface* >(
                         dsolve.eref().data() );
    }
    else
    {
        cout << "Warning: Ksolve::setDsolve: Object '" << dsolve.path() <<
             "' should be class Dsolve, is: " <<
             dsolve.element()->cinfo()->name() << endl;
    }
}
开发者ID:2pysarthak,项目名称:moose-core-personal,代码行数:20,代码来源:Ksolve.cpp

示例15: GetAttributeId

		HRESULT XMLHelper::GetAttributeId(MSXML2::IXMLDOMNode *node, const TCHAR *attr, Id &id)
		{
			BSTR bstr = 0;
			HRESULT hr = GetAttribute(node, attr, &bstr);
			if(hr == S_OK && bstr)
			{
				id.AssignHex(bstr);
				SysFreeString(bstr);
			}
			return hr;
		}
开发者ID:jaylauffer,项目名称:loadngo,代码行数:11,代码来源:XMLHelper.cpp


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