Пример #1
0
void DUpdateVisitor::visitMObject(const MObject *object)
{
    auto dobject = dynamic_cast<DObject *>(m_target);
    QMT_CHECK(dobject);
    if (isUpdating(object->stereotypes() != dobject->stereotypes()))
        dobject->setStereotypes(object->stereotypes());
    const MObject *objectOwner = object->owner();
    const MObject *diagramOwner = m_diagram->owner();
    if (objectOwner && diagramOwner && objectOwner->uid() != diagramOwner->uid()) {
        if (isUpdating(objectOwner->name() != dobject->context()))
            dobject->setContext(objectOwner->name());
    } else {
        if (isUpdating(!dobject->context().isEmpty()))
            dobject->setContext(QString());
    }
    if (isUpdating(object->name() != dobject->name()))
        dobject->setName(object->name());
    // TODO unlikely that this is called for all objects if hierarchy is modified
    // PERFORM remove loop
    int depth = 1;
    const MObject *owner = object->owner();
    while (owner) {
        owner = owner->owner();
        depth += 1;
    }
    if (isUpdating(depth != dobject->depth()))
        dobject->setDepth(depth);
    visitMElement(object);
}
Пример #2
0
void cacheable_function::useLegacyCache(XQueryDiagnostics* aDiag)
{
  if (isUpdating() || isVariadic())
  {
    if (aDiag)
    {
      aDiag->add_warning(
        NEW_XQUERY_WARNING(zwarn::ZWST0005_CACHING_NOT_POSSIBLE,
        WARN_PARAMS(getName()->getStringValue(), isUpdating() ? ZED(ZWST0005_UPDATING) : ZED(ZWST0005_VARIADIC)),
        WARN_LOC(theLoc)));
    }
    theHasCache = false;
    return;
  }

  if (isSequential() || !isDeterministic())
  {
    if (aDiag)
    {
      aDiag->add_warning(
        NEW_XQUERY_WARNING(zwarn::ZWST0006_CACHING_MIGHT_NOT_BE_INTENDED,
        WARN_PARAMS(getName()->getStringValue(), (isSequential() ? "sequential" : "non-deterministic")),
        WARN_LOC(theLoc)));
    }
  }

  parseCachingAnnotations(aDiag);
  theHasCache = true;
  theIsCacheAutomatic = false;
  theCacheAcrossSnapshots = true;
}
Пример #3
0
void DUpdateVisitor::visitMRelation(const MRelation *relation)
{
    auto drelation = dynamic_cast<DRelation *>(m_target);
    QMT_CHECK(drelation);
    if (isUpdating(relation->stereotypes() != drelation->stereotypes()))
        drelation->setStereotypes(relation->stereotypes());
    if (isUpdating(relation->name() != drelation->name()))
        drelation->setName(relation->name());
    visitMElement(relation);
}
Пример #4
0
void DUpdateVisitor::visitMItem(const MItem *item)
{
    auto ditem = dynamic_cast<DItem *>(m_target);
    QMT_CHECK(ditem);
    if (isUpdating(item->isShapeEditable() != ditem->isShapeEditable()))
        ditem->setShapeEditable(item->isShapeEditable());
    if (isUpdating(item->variety() != ditem->variety()))
        ditem->setVariety(item->variety());
    visitMObject(item);
}
Пример #5
0
void DUpdateVisitor::visitMClass(const MClass *klass)
{
    auto dclass = dynamic_cast<DClass *>(m_target);
    QMT_CHECK(dclass);
    if (isUpdating(klass->umlNamespace() != dclass->umlNamespace()))
        dclass->setUmlNamespace(klass->umlNamespace());
    if (isUpdating(klass->templateParameters() != dclass->templateParameters()))
        dclass->setTemplateParameters(klass->templateParameters());
    if (isUpdating(klass->members() != dclass->members()))
        dclass->setMembers(klass->members());
    visitMObject(klass);
}
Пример #6
0
int CrFbDisplayWindow::reparent(uint64_t parentId)
{
    if (!isUpdating())
    {
        WARN(("not updating!"));
        return VERR_INVALID_STATE;
    }

    crDebug("CrFbDisplayWindow: change parent from %p to %p.", mParentId, parentId);

    mParentId = parentId;
    int rc = VINF_SUCCESS;

    /* Force notify Render SPU about parent window ID change in order to prevent
     * crashes when it tries to access already deallocated parent window.
     * Previously, we also used isActive() here, however it might become FALSE for the case
     * when VM Window goes fullscreen mode and back. */
    if ( /* isActive() && */ mpWindow)
    {
        rc = mpWindow->Reparent(parentId);
        if (!RT_SUCCESS(rc))
            WARN(("window reparent failed"));

        mFlags.fNeForce = 1;
    }

    return rc;
}
void WebGeolocationManagerProxy::removeRequester(const CoreIPC::Connection::Client* client)
{
    bool wasUpdating = isUpdating();
    bool highAccuracyWasEnabled = isHighAccuracyEnabled();

    m_highAccuracyRequesters.remove(client);
    m_updateRequesters.remove(client);

    if (wasUpdating && !isUpdating())
        m_provider.stopUpdating(this);
    else {
        bool highAccuracyShouldBeEnabled = isHighAccuracyEnabled();
        if (highAccuracyShouldBeEnabled != highAccuracyWasEnabled)
            m_provider.setEnableHighAccuracy(this, highAccuracyShouldBeEnabled);
    }
}
Пример #8
0
int CrFbDisplayWindow::setViewportRect(const RTRECT *pViewportRect)
{
    if (!isUpdating())
    {
        WARN(("not updating!"));
        return VERR_INVALID_STATE;
    }

    // always call SetPosition to ensure window is adjustep properly
    //        if (pViewportRect->xLeft != mViewportRect.xLeft || pViewportRect->yTop != mViewportRect.yTop)
    if (mpWindow)
    {
        const RTRECT* pRect = getRect();
        int rc = mpWindow->SetPosition(pRect->xLeft - pViewportRect->xLeft, pRect->yTop - pViewportRect->yTop);
        if (!RT_SUCCESS(rc))
        {
            WARN(("SetPosition failed"));
            return rc;
        }
    }

    mViewportRect = *pViewportRect;

    return VINF_SUCCESS;
}
Пример #9
0
void DUpdateVisitor::visitMDependency(const MDependency *dependency)
{
    auto ddependency = dynamic_cast<DDependency *>(m_target);
    QMT_CHECK(ddependency);
    if (isUpdating(dependency->direction() != ddependency->direction()))
        ddependency->setDirection(dependency->direction());
    visitMRelation(dependency);
}
Пример #10
0
bool PoolImp::remove(uint64 guid, bool remove_from_db, bool remove_entity_msg)
{
	POOL_LOG_DEBUG("remove entity to pool, guid is <%llu>, remove from db <%d>", guid, remove_from_db);

	// ²éѯowner guid
	uint64 owner_guid = 0;
	{
		Guid2OwnerGuidMap_t::iterator it = m_guid2ownerguid_map.find(guid);
		if (it != m_guid2ownerguid_map.end())
		{
			owner_guid = it->second;
			m_guid2ownerguid_map.erase(it);
		}
		else
		{
			POOL_LOG_ERROR("failed to get owner_guid of guid while remove <%llu>", guid);
			return false;
		}
	}

	EntityMap_t::iterator it = m_entity_map.find(guid);
	if (it != m_entity_map.end())
	{
		bool is_updating = false;

		if (remove_from_db)
		{
			updateToDb(owner_guid, guid, EOT_REMOVE);
		}
		else
		{
			is_updating = isUpdating(owner_guid, guid);
		}

		if (!remove_entity_msg)
		{
			it->second->message = NULL;
		}

		if (!is_updating)
		{
			delete it->second;
			m_entity_map.erase(it);
		}
		else
		{
			it->second->is_remove_from_memory = true;
		}

		return true;
	}
	else
	{
		POOL_LOG_ERROR("failed to remove guid from pool, not found <%llu>", guid);
		return false;
	}
}
void WebGeolocationManager::registerWebPage(WebPage* page)
{
    bool wasUpdating = isUpdating();

    m_pageSet.add(page);

    if (!wasUpdating)
        m_process->parentProcessConnection()->send(Messages::WebGeolocationManagerProxy::StartUpdating(), 0);
}
void WebGeolocationManagerProxy::startUpdating(CoreIPC::Connection* connection)
{
    bool wasUpdating = isUpdating();
    m_updateRequesters.add(connection->client());
    if (!wasUpdating) {
        m_provider.setEnableHighAccuracy(this, isHighAccuracyEnabled());
        m_provider.startUpdating(this);
    }
}
Пример #13
0
void DUpdateVisitor::visitMAssociation(const MAssociation *association)
{
    auto dassociation = dynamic_cast<DAssociation *>(m_target);
    QMT_CHECK(dassociation);
    DAssociationEnd endA;
    endA.setName(association->endA().name());
    endA.setCardinatlity(association->endA().cardinality());
    endA.setNavigable(association->endA().isNavigable());
    endA.setKind(association->endA().kind());
    if (isUpdating(endA != dassociation->endA()))
        dassociation->setEndA(endA);
    DAssociationEnd endB;
    endB.setName(association->endB().name());
    endB.setCardinatlity(association->endB().cardinality());
    endB.setNavigable(association->endB().isNavigable());
    endB.setKind(association->endB().kind());
    if (isUpdating(endB != dassociation->endB()))
        dassociation->setEndB(endB);
    visitMRelation(association);
}
void WebGeolocationManagerProxy::setEnableHighAccuracy(CoreIPC::Connection* connection, bool enabled)
{
    bool highAccuracyWasEnabled = isHighAccuracyEnabled();

    if (enabled)
        m_highAccuracyRequesters.add(connection->client());
    else
        m_highAccuracyRequesters.remove(connection->client());

    bool highAccuracyShouldBeEnabled = isHighAccuracyEnabled();
    if (isUpdating() && highAccuracyWasEnabled != highAccuracyShouldBeEnabled)
        m_provider.setEnableHighAccuracy(this, highAccuracyShouldBeEnabled);
}
Пример #15
0
void cacheable_function::useStrictlyDeterministicCache(XQueryDiagnostics* aDiag)
{
  if (isUpdating() || isSequential() || isVariadic())
  {
    if (aDiag)
    {
      aDiag->add_warning(
        NEW_XQUERY_WARNING(zwarn::ZWST0005_CACHING_NOT_POSSIBLE,
        WARN_PARAMS(getName()->getStringValue(),
          isUpdating() ? ZED(ZWST0005_UPDATING) :
            (isSequential() ? ZED(ZWST0005_SEQUENTIAL) : ZED(ZWST0005_VARIADIC))),
        WARN_LOC(theLoc)));
    }
    theHasCache = false;
  }
  else
  {
    parseCachingAnnotations(aDiag);
    theHasCache = true;
    theIsCacheAutomatic = false;
    theCacheAcrossSnapshots = false;
  }
}
void WebGeolocationManager::unregisterWebPage(WebPage* page)
{
    bool highAccuracyWasEnabled = isHighAccuracyEnabled();

    m_pageSet.remove(page);
    m_highAccuracyPageSet.remove(page);

    if (!isUpdating())
        m_process->parentProcessConnection()->send(Messages::WebGeolocationManagerProxy::StopUpdating(), 0);
    else {
        bool highAccuracyShouldBeEnabled = isHighAccuracyEnabled();
        if (highAccuracyWasEnabled != highAccuracyShouldBeEnabled)
            m_process->parentProcessConnection()->send(Messages::WebGeolocationManagerProxy::SetEnableHighAccuracy(highAccuracyShouldBeEnabled), 0);
    }
}
Пример #17
0
int CrFbDisplayWindow::screenChanged()
{
    if (!isUpdating())
    {
        WARN(("not updating!"));
            return VERR_INVALID_STATE;
    }

    int rc = windowDimensionsSync();
    if (!RT_SUCCESS(rc))
    {
        WARN(("windowDimensionsSync failed rc %d", rc));
        return rc;
    }

    return VINF_SUCCESS;
}
Пример #18
0
CrFbWindow * CrFbDisplayWindow::windowDetach(bool fCleanup)
{
    if (isUpdating())
    {
        WARN(("updating!"));
        return NULL;
    }

    CrFbWindow * pWindow = mpWindow;
    if (mpWindow)
    {
        if (fCleanup)
            windowCleanup();
        mpWindow = NULL;
    }
    return pWindow;
}
Пример #19
0
PlanIter_t external_function::codegen(
    CompilerCB* /*cb*/,
    static_context* sctx,
    const QueryLoc& loc,
    std::vector<PlanIter_t>& argv,
    expr& ann) const
{
  return new ExtFunctionCallIterator(sctx,
                                     loc,
                                     argv,
                                     this,
                                     theImpl,
                                     isUpdating(),
                                     isSequential(),
                                     theNamespace,
                                     theModuleSctx);
}
Пример #20
0
void Property::setDependantsDirty()
  {
  if(!isDynamic())
    {
    const PropertyInstanceInformation *childBase = baseInstanceInformation();
    const EmbeddedPropertyInstanceInformation *child = childBase->embeddedInfo();
    const xsize *affectsLocations = child->affects();
    if(affectsLocations)
      {
      xuint8* parentLocation = (xuint8*)this;
      parentLocation -= child->location();

      for(;*affectsLocations; ++affectsLocations)
        {
        xuint8* affectedLocation = parentLocation + *affectsLocations;
        Property *affectsProp = (Property *)affectedLocation;

        xAssert(affectsProp);
        affectsProp->setDirty();
        }
      }
    }

  for(Property *o=output(); o; o = o->nextOutput())
    {
    xAssert(o != o->nextOutput());

    o->setDirty();
    }

  // if there is an input, a parent input or this is computed,
  // then when we are dirtied we need to dirty our children
  if(!isUpdating() && (input() || _flags.hasFlag(Property::ParentHasInput) || isComputed()))
    {
    Container *c = castTo<Container>();
    if(c)
      {
      xForeach(auto child, LightWalker(c))
        {
        if(Property *childProp = child->castTo<Property>())
          {
          childProp->setDirty();
          }
        }
      }
    }
Пример #21
0
bool Bullet::getBodyTransform(BodyObject bodyObject, SimpleTransform& transform)
{
    if (!bodyObject || !isUpdating())
        return false;

    auto body = reinterpret_cast<Body*>(bodyObject);

    auto bulletTransform = btTransform();
    body->bulletBody->getMotionState()->getWorldTransform(bulletTransform);

    // Return the body transform
    transform = toCarbon(bulletTransform);

    // TODO: track sleeping/waking objects to know what's alive/dead and what has changed since the last call

    return true;
}
Пример #22
0
CrFbWindow * CrFbDisplayWindow::windowAttach(CrFbWindow * pNewWindow)
{
    if (isUpdating())
    {
        WARN(("updating!"));
        return NULL;
    }

    CrFbWindow * pOld = mpWindow;
    if (mpWindow)
        windowDetach();

    mpWindow = pNewWindow;
    if (pNewWindow)
        windowSync();

    return mpWindow;
}
Пример #23
0
void cacheable_function::useDefaultCachingSettings()
{
  if (isVariadic() || isUpdating() || isSequential() || !isDeterministic())
  {
    theHasCache = false;
  }
  else
  {
    if (!haveAtomicArgumentsAndReturnType())
    {
      theHasCache = false;
    }
    else
    {
      theHasCache = true;
      theIsCacheAutomatic = true;
      theCacheAcrossSnapshots = false;
    }
  }
}
int CrFbDisplayWindow::reparent(uint64_t parentId)
{
    if (!isUpdating())
    {
        WARN(("not updating!"));
        return VERR_INVALID_STATE;
    }

    crDebug("CrFbDisplayWindow: change parent from %p to %p.", mParentId, parentId);

    mParentId = parentId;
    int rc = VINF_SUCCESS;

    if (isActive() && mpWindow)
    {
        rc = mpWindow->Reparent(parentId);
        if (!RT_SUCCESS(rc))
            WARN(("window reparent failed"));

        mFlags.fNeForce = 1;
    }

    return rc;
}
Пример #25
0
void Bullet::update(TimeValue time)
{
    if (isUpdating())
        dynamicsWorld_->stepSimulation(time.toSeconds(), 8, getSubstepSize().toSeconds());
}