本文整理汇总了C++中ProxyObjectPtr::getObjectReference方法的典型用法代码示例。如果您正苦于以下问题:C++ ProxyObjectPtr::getObjectReference方法的具体用法?C++ ProxyObjectPtr::getObjectReference怎么用?C++ ProxyObjectPtr::getObjectReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProxyObjectPtr
的用法示例。
在下文中一共展示了ProxyObjectPtr::getObjectReference方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateFrom
void JSAggregateVisibleData::updateFrom(ProxyObjectPtr proxy) {
Mutex::scoped_lock locker (childMutex);
if (mChildren.find(proxy->getObjectReference()) == mChildren.end()) {
// Note that we currently pass in NULL so we don't get
// notifications. We'd only get them upon clearing our children list in
// the destructor anyway.
mChildren[proxy->getObjectReference()] = JSVisibleDataPtr(new JSProxyVisibleData(NULL, proxy));
}
mBest = proxy->getObjectReference();
}
示例2: iValidated
void ProxyEntity::iValidated(ProxyObjectPtr ptr,Liveness::Token lt)
{
if (!lt)
return;
assert(ptr == mProxy);
SILOG(ogre, detailed, "Validating ProxyEntity " << ptr->getObjectReference().toString());
mCanDestroy = false;
mDestroyTimer->cancel();
// Because this could be a new ProxyEntity, created after a bunch
// of updates have been received by the ProxyObject, we need to
// refresh its important data
iUpdateLocation( mProxy, mProxy->location(), mProxy->orientation(), mProxy->bounds(), SpaceObjectReference::null(),lt );
if (!mActive)
{
getScene()->downloadPlanner()->addNewObject(mProxy, this);
mActive = true;
}
}
示例3: setParent
void ProxyObject::setParent(const ProxyObjectPtr &parent,
TemporalValue<Location>::Time timeStamp,
const Location &absLocation,
const Location &relLocation) {
if (!parent) {
unsetParent(timeStamp, absLocation);
return;
}
ProxyObjectPtr oldParent (getParentProxy());
if (oldParent) {
oldParent->ProxyObjectProvider::removeListener(this);
}
parent->ProxyObjectProvider::addListener(this);
// Using now() should best allow a linear extrapolation to work.
Location lastPosition(globalLocation(timeStamp));
mParentId = parent->getObjectReference();
Location newparentLastGlobal(parent->globalLocation(timeStamp));
/*
std::cout<<" Last parent global "<<std::endl<<newparentLastGlobal<<std::endl<<
"global loc = "<<std::endl<<lastPosition<<
std::endl<<"local loc = "<<std::endl<<lastPosition.toLocal(newparentLastGlobal)<<std::endl;
*/
mLocation.resetValue(timeStamp, lastPosition.toLocal(newparentLastGlobal));
mLocation.updateValue(timeStamp, relLocation);
PositionProvider::notify(&PositionListener::setParent,
parent,
timeStamp,
absLocation,
relLocation);
}
示例4: createViewedObject
void ObjectHostProxyManager::createViewedObject(const ProxyObjectPtr &newObj, QueryTracker*viewer) {
std::pair<ProxyMap::iterator, bool> result = mProxyMap.insert(
ProxyMap::value_type(newObj->getObjectReference().object(), newObj));
if (result.second==true) {
notify(&ProxyCreationListener::onCreateProxy,newObj);
}
result.first->second.viewers.insert(viewer);
}
示例5: Entity
ProxyEntity::ProxyEntity(OgreRenderer *scene, const ProxyObjectPtr &ppo)
: Entity(scene, ppo->getObjectReference().toString()),
mProxy()
{
mDestroyTimer = Network::IOTimer::create(
mScene->context()->ioService,
std::tr1::bind(&ProxyEntity::handleDestroyTimeout, this)
);
}
示例6: setParent
void Entity::setParent(const ProxyObjectPtr &parent, Time ti, const Location &absLocation, const Location &relLocation)
{
Entity *parentEntity = mScene->getEntity(parent);
if (!parentEntity) {
SILOG(ogre,fatal,"No Entity has been created for proxy " << parent->getObjectReference() <<
" which is to become parent of "<<getProxy().getObjectReference());
return;
}
addToScene(parentEntity->mSceneNode);
}
示例7: destroyObject
void ProxyManager::destroyObject(const ProxyObjectPtr &delObj) {
PROXYMAN_SERIALIZED();
ProxyMap::iterator iter = mProxyMap.find(delObj->getObjectReference().object());
if (iter != mProxyMap.end()) {
iter->second.ptr->destroy();
notify(&ProxyCreationListener::onDestroyProxy,iter->second.ptr);
// Here we only erase the strong reference, keeping the weak one so we
// can recover it if its still in use and we get a re-addition. Be
// careful not to use the iterator after this since this may trigger
// destruction of the object which will call proxyDeleted and invalidate
// it!
iter->second.ptr.reset();
}
}
示例8: initializeToProxy
void ProxyEntity::initializeToProxy(const ProxyObjectPtr &ppo) {
assert( ppo );
assert( !mProxy || (mProxy->getObjectReference() == ppo->getObjectReference()) );
if (mProxy) {
mProxy->ProxyObjectProvider::removeListener(this);
mProxy->PositionProvider::removeListener(this);
mProxy->MeshProvider::removeListener(this);
}
mProxy = ppo;
mProxy->ProxyObjectProvider::addListener(this);
mProxy->PositionProvider::addListener(this);
mProxy->MeshProvider::addListener(this);
checkDynamic();
}
示例9: initializeToProxy
void ProxyEntity::initializeToProxy(const ProxyObjectPtr &ppo) {
assert( ppo );
assert( !mProxy || (mProxy->getObjectReference() == ppo->getObjectReference()) );
setIsAggregate(ppo->isAggregate());
/**
FIXME: ADDING AND REMOVING LISTENERS COULD INVALIDATE ITERATORS
*/
if (mProxy) {
mProxy->ProxyObjectProvider::removeListener(this);
mProxy->PositionProvider::removeListener(this);
mProxy->MeshProvider::removeListener(this);
}
mProxy = ppo;
mProxy->ProxyObjectProvider::addListener(this);
mProxy->PositionProvider::addListener(this);
mProxy->MeshProvider::addListener(this);
checkDynamic();
}
示例10: iInvalidated
void ProxyEntity::iInvalidated(ProxyObjectPtr ptr, bool permanent,Liveness::Token lt)
{
if (!lt)
return;
assert(ptr == mProxy);
SILOG(ogre, detailed, "Invalidating ProxyEntity " << ptr->getObjectReference().toString());
if (!mActive) return;
// If the the object really disconnected, it'll be marked as a permanent
// removal. If it just left the result set then it should still be in the
// world and shouldn't hurt to leave it around for awhile, and we'll get
// less flickering if we try to mask an removal/addition pair due to quick
// changes/data structure rearrangement by the space server.
if (permanent)
iHandleDestroyTimeout(lt);
else
mDestroyTimer->wait(Duration::seconds(15));
}
示例11: 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;
}
示例12: initializeAs
void PerPresenceData::initializeAs(ProxyObjectPtr proxyobj) {
object = proxyobj->getObjectReference().object();
mProxyObject = proxyobj;
}
示例13: id
const SpaceObjectReference& id() const {
return mProxy->getObjectReference();
}
示例14: destroyObject
void ObjectHostProxyManager::destroyObject(const ProxyObjectPtr &newObj) {
destroyViewedObject(newObj->getObjectReference(), 0);
}
示例15: addUpdateFromExisting
void OrphanLocUpdateManager::addUpdateFromExisting(ProxyObjectPtr proxyPtr) {
addUpdateFromExisting(
proxyPtr->getObjectReference(),
*(dynamic_cast<SequencedPresenceProperties*>(proxyPtr.get()))
);
}