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


C++ SpaceObjectReference类代码示例

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


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

示例1: getProxyObject

ProxyObjectPtr ProxyManager::getProxyObject(const SpaceObjectReference &id) const {
    PROXYMAN_SERIALIZED();

    assert(id.space() == mID.space());

    ProxyMap::const_iterator iter = mProxyMap.find(id.object());
    if (iter != mProxyMap.end())
        return (*iter).second.ptr;

    return ProxyObjectPtr();
}
开发者ID:namwkim,项目名称:sirikata,代码行数:11,代码来源:ProxyManager.cpp

示例2: wrappedStreamCreatedCallback

void ObjectHost::wrappedStreamCreatedCallback(HostedObjectWPtr ho_weak, const SpaceObjectReference& sporef, SessionManager::ConnectionEvent after, StreamCreatedCallback cb) {
    if (mQueryProcessor != NULL) {
        HostedObjectPtr ho(ho_weak);
        if (ho) {
            SSTStreamPtr strm = getSpaceStream(sporef.space(), sporef.object());
            // This had better be OK here since we're just getting the callback
            assert(strm);
            mQueryProcessor->presenceConnectedStream(ho, sporef, strm);
        }
    }
    cb(sporef, after);
}
开发者ID:SinSiXX,项目名称:sirikata,代码行数:12,代码来源:ObjectHost.cpp

示例3: getResourceEntity

SharedResourcePtr GraphicsResourceManager::getResourceEntity(const SpaceObjectReference &id, GraphicsEntity *graphicsEntity)
{
  WeakResourcePtr curWeakPtr = getResource(id.toString());
  SharedResourcePtr curSharedPtr = curWeakPtr.lock();
  if (curSharedPtr)
    return curSharedPtr;
  else {
    curSharedPtr = GraphicsResource::construct<GraphicsResourceEntity>(id, graphicsEntity);
    mIDResourceMap[id.toString()] = curSharedPtr;
    mEntities.insert(curSharedPtr.get());

    return curSharedPtr;
  }
}
开发者ID:danx0r,项目名称:sirikata,代码行数:14,代码来源:GraphicsResourceManager.cpp

示例4: addOrphanUpdate

void OrphanLocUpdateManager::addOrphanUpdate(const SpaceObjectReference& observed, const Sirikata::Protocol::Loc::LocationUpdate& update) {
    assert( ObjectReference(update.object()) == observed.object() );
    UpdateInfoList& info_list = mUpdates[observed];
    info_list.push_back(
        UpdateInfoPtr(new UpdateInfo(observed, new Sirikata::Protocol::Loc::LocationUpdate(update), mContext->simTime() + mTimeout))
    );
}
开发者ID:SinSiXX,项目名称:sirikata,代码行数:7,代码来源:OrphanLocUpdateManager.cpp

示例5: invokeOrphanUpdates

    void invokeOrphanUpdates(ObjectHost* oh, const QuerierIDType& observer, const SpaceObjectReference& proximateID, ListenerType* listener) {
        ObjectUpdateMap::iterator it = mUpdates.find(proximateID);
        if (it == mUpdates.end()) return;

        const UpdateInfoList& info_list = it->second;
        for(UpdateInfoList::const_iterator info_it = info_list.begin(); info_it != info_list.end(); info_it++) {
            if ((*info_it)->value != NULL) {
                LocProtocolLocUpdate llu( *((*info_it)->value), oh, proximateID.space() );
                listener->onOrphanLocUpdate( observer, llu );
            }
            else if ((*info_it)->opd != NULL) {
                PresencePropertiesLocUpdate plu( (*info_it)->object.object(), *((*info_it)->opd) );
                listener->onOrphanLocUpdate( observer, plu );
            }
        }

        // Once we've notified of these we can get rid of them -- if they
        // need the info again they should re-register it with
        // addUpdateFromExisting before cleaning up the object.
        mUpdates.erase(it);
    }
开发者ID:namwkim,项目名称:sirikata,代码行数:21,代码来源:OrphanLocUpdateManager.hpp

示例6: registerOrUpdateObjectQuery

void ManualObjectQueryProcessor::registerOrUpdateObjectQuery(const SpaceObjectReference& sporef) {
    // Get query info
    ObjectStateMap::iterator it = mObjectState.find(sporef);
    assert(it != mObjectState.end());
    ObjectState& state = it->second;
    HostedObjectPtr ho = state.who.lock();
    assert( ho && !state.query.empty() && state.node != OHDP::NodeID::null() );

    // Get the appropriate handler
    QueryHandlerMap::iterator handler_it = mObjectQueryHandlers.find(OHDP::SpaceNodeID(sporef.space(), state.node));
    assert(handler_it != mObjectQueryHandlers.end());
    ObjectQueryHandlerPtr handler = handler_it->second;

    // And register
    handler->updateQuery(ho, sporef, state.query);
    state.registered = true;
}
开发者ID:applsdev,项目名称:sirikata,代码行数:17,代码来源:ManualObjectQueryProcessor.cpp

示例7: createObject

ProxyObjectPtr ProxyManager::createObject(
    const SpaceObjectReference& id,
    const TimedMotionVector3f& tmv, const TimedMotionQuaternion& tmq, const AggregateBoundingInfo& bs,
    const Transfer::URI& meshuri, const String& phy, bool isAggregate, uint64 seqNo
)
{
    PROXYMAN_SERIALIZED();

    ProxyObjectPtr newObj;
    // Try to reuse an existing object, even if we only have a valid
    // weak pointer to it.
    assert(id.space() == mID.space());
    ProxyMap::iterator iter = mProxyMap.find(id.object());
    if (iter != mProxyMap.end()) {
        // From strong ref
        newObj = iter->second.ptr;
        if (!newObj) {
            // From weak ref
            newObj = iter->second.wptr.lock();

            // And either update the strong ref or clear out the entry
            // if its not even valid anymore.
            if (newObj)
                iter->second.ptr = newObj;
            else
                mProxyMap.erase(iter);
        }
    }

    // If we couldn't get a valid existing copy, create and insert a
    // new one.
    if (!newObj) {
        newObj = ProxyObject::construct(getSharedPtr(), id);
        std::pair<ProxyMap::iterator, bool> result = mProxyMap.insert(
            ProxyMap::value_type(
                newObj->getObjectReference().object(),
                ProxyData(newObj)
            )
        );
        iter = result.first;
    }

    assert(newObj);
    assert(newObj->getObjectReference() == id);
    assert(newObj->getOwner().get() == this);

    // This makes things simpler elsewhere: For new objects, we ensure
    // all the values are set properly so that when the notification
    // happens below, the proxy passed to listeners (for
    // onCreateProxy) will be completely setup, making it valid for
    // use. We don't need this for old ProxyObjects since they were
    // already initialized. The seqNo of 0 only updates something if it wasn't
    // set yet.
    newObj->setLocation(tmv, 0);
    newObj->setOrientation(tmq, 0);
    newObj->setBounds(bs, 0);
    if(meshuri)
        newObj->setMesh(meshuri, 0);
    if(phy.size() > 0)
        newObj->setPhysics(phy, 0);
    newObj->setIsAggregate(isAggregate, 0);

    // Notification of the proxy will have already occured, but
    // updates via, e.g., PositionListener or MeshListener, will go
    // out here, so the potentially invalid initial data automatically
    // filled when the object was created by createObject() shouldn't
    // matter.
    newObj->setLocation(tmv, seqNo);
    newObj->setOrientation(tmq, seqNo);
    newObj->setBounds(bs, seqNo);
    if(meshuri)
        newObj->setMesh(meshuri, seqNo);
    if(phy.size() > 0)
        newObj->setPhysics(phy, seqNo);
    newObj->setIsAggregate(isAggregate, seqNo);

    // Notification has to happen either way
    notify(&ProxyCreationListener::onCreateProxy, newObj);

    return newObj;
}
开发者ID:namwkim,项目名称:sirikata,代码行数:81,代码来源:ProxyManager.cpp

示例8: handleObjectConnected

void ObjectHost::handleObjectConnected(const SpaceObjectReference& sporef_objid, ServerID server) {
    ObjectNodeSessionProvider::notify(&ObjectNodeSessionListener::onObjectNodeSession, sporef_objid.space(), sporef_objid.object(), OHDP::NodeID(server));
}
开发者ID:SinSiXX,项目名称:sirikata,代码行数:3,代码来源:ObjectHost.cpp

示例9: handleObjectMigrated

void ObjectHost::handleObjectMigrated(const SpaceObjectReference& sporef_objid, ServerID from, ServerID to) {
    ObjectNodeSessionProvider::notify(&ObjectNodeSessionListener::onObjectNodeSession, sporef_objid.space(), sporef_objid.object(), OHDP::NodeID(to));
}
开发者ID:SinSiXX,项目名称:sirikata,代码行数:3,代码来源:ObjectHost.cpp

示例10: populateSpaceObjRef

 void PerPresenceData::populateSpaceObjRef(const SpaceObjectReference& sporef)
 {
     validSpaceObjRef = true;
     space   = sporef.space();
     object  = sporef.object();
 }
开发者ID:krazylegz,项目名称:sirikata,代码行数:6,代码来源:PerPresenceData.cpp

示例11: ogreCameraName

std::string CameraEntity::ogreCameraName(const SpaceObjectReference&ref) {
    return "Camera:"+ref.toString();
}
开发者ID:ericruth,项目名称:sirikata,代码行数:3,代码来源:CameraEntity.cpp

示例12: operator

 size_t operator() (const SpaceObjectReference&uuid) const {
     return uuid.hash();
 }
开发者ID:princeofcode,项目名称:sirikata,代码行数:3,代码来源:SpaceObjectReference.hpp

示例13: handleObjectDisconnected

void ObjectHost::handleObjectDisconnected(const SpaceObjectReference& sporef_objid, Disconnect::Code) {
    ObjectNodeSessionProvider::notify(&ObjectNodeSessionListener::onObjectNodeSession, sporef_objid.space(), sporef_objid.object(), OHDP::NodeID::null());
}
开发者ID:SinSiXX,项目名称:sirikata,代码行数:3,代码来源:ObjectHost.cpp

示例14: registerHostedObject

void ObjectHost::registerHostedObject(const SpaceObjectReference &sporef_uuid, const HostedObjectPtr& obj)
{
    HostedObjectMap::iterator iter = mHostedObjects.find(sporef_uuid);
    if (iter != mHostedObjects.end()) {
        SILOG(oh,error,"Two objects having the same internal name in the mHostedObjects map on connect"<<sporef_uuid.toString());
    }
    mHostedObjects[sporef_uuid]=obj;
}
开发者ID:SinSiXX,项目名称:sirikata,代码行数:8,代码来源:ObjectHost.cpp

示例15: unregisterHostedObject

void ObjectHost::unregisterHostedObject(const SpaceObjectReference& sporef_uuid, HostedObject* key_obj)
{
    HostedObjectMap::iterator iter = mHostedObjects.find(sporef_uuid);
    if (iter != mHostedObjects.end()) {
        HostedObjectPtr obj (iter->second);
        // The NULL case covers the possibility that the connection finishes
        // after the HostedObject requests destruction and stops paying
        // attention to connection events
        if (key_obj == NULL || obj.get()==key_obj)
            mHostedObjects.erase(iter);
        else
            SILOG(oh,error,"Two objects having the same internal name in the mHostedObjects map on disconnect "<<sporef_uuid.toString());
    }
}
开发者ID:SinSiXX,项目名称:sirikata,代码行数:14,代码来源:ObjectHost.cpp


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