コード例 #1
0
ファイル: coreengine.cpp プロジェクト: gidlbn/dlbn_02
bool CoreEngine::setInterrupt(QString *errorMessage)
{
    const HRESULT hr = interfaces().debugControl->SetInterrupt(DEBUG_INTERRUPT_ACTIVE|DEBUG_INTERRUPT_EXIT);
    if (FAILED(hr)) {
        *errorMessage = QString::fromLatin1("Unable to interrupt debuggee after %1s: %2").
                        arg(getInterruptTimeOutSecs(interfaces().debugControl)).arg(msgComFailed("SetInterrupt", hr));
        return false;
    }
    return true;
}
コード例 #2
0
int main()
{
  interfaces();
  constructorsAndAssignment();
  goodCases();
  badCases();
  return 0;
}
コード例 #3
0
	bool IsSameLocalSubNet(const QHostAddress &addr1, const QHostAddress &addr2)
	{
		QList<QNetworkInterface> interfaces(QNetworkInterface::allInterfaces());
		boost::shared_ptr<QNetworkAddressEntry>  localAddressEntry(
			GetNetworkAddressEntry(interfaces, addr1));
		if(localAddressEntry == 0) localAddressEntry = GetNetworkAddressEntry(interfaces, addr2);
	
		return (localAddressEntry == 0) ? false :
			addr2.isInSubnet(addr1, localAddressEntry->prefixLength());
	}
コード例 #4
0
QSharedDataPointer<QDBusIntrospection::ObjectTree>
QDBusXmlParser::objectTree() const
{
    QSharedDataPointer<QDBusIntrospection::ObjectTree> retval;

    if (m_node.isNull())
        return retval;

    retval = new QDBusIntrospection::ObjectTree;

    retval->service = m_service;
    retval->path = m_path;

    QTextStream ts(&retval->introspection);
    m_node.save(ts,2);

    // interfaces are easy:
    retval->interfaceData = interfaces();
    retval->interfaces = retval->interfaceData.keys();

    // sub-objects are slightly more difficult:
    QDomNodeList objects = m_node.elementsByTagName(QLatin1String("node"));
    for (int i = 0; i < objects.count(); ++i) {
        QDomElement obj = objects.item(i).toElement();
        QString objName = obj.attribute(QLatin1String("name"));
        if (obj.isNull() || objName.isEmpty())
            continue;           // for whatever reason

        // check if we have anything to process
        if (!obj.firstChild().isNull()) {
            // yes, introspect this object
            QString xml;
            QTextStream ts2(&xml);
            obj.save(ts2,0);

            // parse it
            QString objAbsName = m_path;
            if (!objAbsName.endsWith(QLatin1Char('/')))
                objAbsName.append(QLatin1Char('/'));
            objAbsName += objName;

            QDBusXmlParser parser(m_service, objAbsName, obj);
            retval->childObjectData.insert(objName, parser.objectTree());
        }

        retval->childObjects << objName;
    }

    return QSharedDataPointer<QDBusIntrospection::ObjectTree>( retval );
}
コード例 #5
0
ファイル: factory.cpp プロジェクト: z80/IPM
::Ice::DispatchStatus
Factory::DeviceFactory::___interfaces(::IceInternal::Incoming& __inS, const ::Ice::Current& __current)
{
    __checkMode(::Ice::Idempotent, __current.mode);
    ::IceInternal::BasicStream* __os = __inS.os();
    ::Factory::TStringArray __ret = interfaces(__current);
    if(__ret.size() == 0)
    {
        __os->writeSize(0);
    }
    else
    {
        __os->write(&__ret[0], &__ret[0] + __ret.size());
    }
    return ::Ice::DispatchOK;
}
コード例 #6
0
ファイル: Unterface.cpp プロジェクト: CentMeng/redex
void UnterfacePass::run_pass(DexClassesVector& dexen, ConfigFiles& cfg) {
  Scope scope = build_class_scope(dexen);

  InterfaceImplementations interfaces(scope);
  assert(interfaces.print_all());

  auto one_level = exclude(interfaces,
      HAS_SUPER | HAS_CHILDREN | NO_VMETHODS,
      IMPL_MULTIPLE_INTERFACES |
          HAS_SUPER |
          HAS_CHILDREN |
          IS_ABSTRACT |
          NO_MATCH_INTERFACE_METHODS |
          HAS_MULTIPLE_INSTANCE_FIELDS |
          MULTIPLE_ARGS_CTOR |
          HAS_CLINIT |
          NO_VMETHODS |
          HAS_STATIC_FIELDS |
          HAS_DIRECT_METHODS);
  interfaces.analyze_candidates(one_level, "No hierarchy, perfect match");

  // optimize
  std::vector<DexClass*> untfs;
  std::unordered_set<DexClass*> removed;
  //optimize(scope, candidates, untfs, removed);

  // write back
  DexClassesVector outdex;
  DexClasses& orig_classes = dexen[0];
  DexClasses classes(orig_classes.size() + untfs.size() - removed.size());
  int pos = 0;
  for (int i = 0; i < orig_classes.size(); ++i) {
    auto cls = orig_classes.get(i);
    if (removed.find(cls) == removed.end()) {
      classes.insert_at(cls, pos++);
    }
  }
  for (auto untf : untfs) {
    classes.insert_at(untf, pos++);
  }
  outdex.emplace_back(std::move(classes));
  for (size_t i = 1; i < dexen.size(); i++) {
    outdex.emplace_back(std::move(dexen[i]));
  }
  dexen = std::move(outdex);
}
lduInterfacePtrsList tetPolyBoundaryMesh::interfaces() const
{
    lduInterfacePtrsList interfaces(size());

    forAll (interfaces, patchi)
    {
        if (isA<lduInterface>(this->operator[](patchi)))
        {
            interfaces.set
            (
                patchi,
               &refCast<const lduInterface>(this->operator[](patchi))
            );
        }
    }

    return interfaces;
}
コード例 #8
0
void ConnectionManager::Private::ProtocolWrapper::extractMainProperties(const QVariantMap &props)
{
    mHasMainProps =
        props.contains(TP_QT_IFACE_PROTOCOL + QLatin1String(".Interfaces")) &&
        props.contains(TP_QT_IFACE_PROTOCOL + QLatin1String(".Parameters")) &&
        props.contains(TP_QT_IFACE_PROTOCOL + QLatin1String(".ConnectionInterfaces")) &&
        props.contains(TP_QT_IFACE_PROTOCOL + QLatin1String(".RequestableChannelClasses")) &&
        props.contains(TP_QT_IFACE_PROTOCOL + QLatin1String(".VCardField")) &&
        props.contains(TP_QT_IFACE_PROTOCOL + QLatin1String(".EnglishName")) &&
        props.contains(TP_QT_IFACE_PROTOCOL + QLatin1String(".Icon"));

    setInterfaces(qdbus_cast<QStringList>(
                props[TP_QT_IFACE_PROTOCOL + QLatin1String(".Interfaces")]));
    mReadinessHelper->setInterfaces(interfaces());

    ParamSpecList parameters = qdbus_cast<ParamSpecList>(
            props[TP_QT_IFACE_PROTOCOL + QLatin1String(".Parameters")]);
    foreach (const ParamSpec &spec, parameters) {
        mInfo.addParameter(spec);
    }
コード例 #9
0
QVector<ProgrammingInterface> AVRStudioXMLParser::GetInterfaces(QDomNode node)
{
    QVector<ProgrammingInterface> interfaces(0);

    while(!node.isNull())
    {
        QDomNamedNodeMap attributes = node.attributes();
        ProgrammingInterface interface;

        for(int i = 0; i < attributes.size(); i++)
        {
            QDomNode attribute = attributes.item(i);
            if(interface.GetMappingMap()[attribute.nodeName()])
                *interface.GetMappingMap()[attribute.nodeName()] = attribute.nodeValue();
        }

        interfaces.append(interface);
        node = node.nextSibling();
    }

    return interfaces;
}
コード例 #10
0
	bool IsLocalIp(const QString &ip)
	{
		QList<QNetworkInterface> interfaces(QNetworkInterface::allInterfaces());
		return GetNetworkAddressEntry(interfaces, QHostAddress(ip)) != 0;
	}
coupledSolverPerformance coupledFvMatrix<scalar>::solve
(
    const dictionary& solverControls
)
{
    if (debug)
    {
        InfoIn("coupledFvMatrix<Type>::solve(const dictionary)")
            << "solving coupledFvMatrix<Type>" << endl;
    }

    typedef FieldField<Field, scalar> scalarFieldField;

    PtrList<lduMatrix>& matrices = *this;

    // Make a copy of the diagonal and complete the source
    scalarFieldField saveDiag(this->size());
    scalarFieldField psi(this->size());
    FieldField<Field, scalar> source(this->size());
    lduInterfaceFieldPtrsListList interfaces(this->size());

    PtrList<FieldField<Field, scalar> > bouCoeffs(this->size());
    PtrList<FieldField<Field, scalar> > intCoeffs(this->size());

    // Prepare block solution
    forAll (matrices, rowI)
    {
        fvScalarMatrix& curMatrix =
            static_cast<fvScalarMatrix&>(matrices[rowI]);

        saveDiag.set(rowI, new scalarField(curMatrix.diag()));
        // HR 17/Feb/2013
        // Need to be able to compare references to support hacks such as in jumpCyclic
        // psi.set(rowI, new scalarField(curMatrix.psi()));
        psi.set(rowI, &curMatrix.psi());
        source.set(rowI, new scalarField(curMatrix.source()));

        curMatrix.addBoundarySource(source[rowI], 0);

        interfaces[rowI] = curMatrix.psi().boundaryField().interfaces();

        curMatrix.addBoundaryDiag(curMatrix.diag(), 0);

        bouCoeffs.set
        (
            rowI,
            new FieldField<Field, scalar>
            (
                curMatrix.boundaryCoeffs()
            )
        );

        intCoeffs.set
        (
            rowI,
            new FieldField<Field, scalar>
            (
                curMatrix.internalCoeffs().component(0)
            )
        );
    }