本文整理汇总了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();
}
示例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() ) );
}
示例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;
}
示例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");
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}
}
}
示例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;
}
示例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();
}
示例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 );
}
示例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();
}
示例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();
}
示例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;
}
}
示例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;
}