Sirikata
|
#include <CBRLocationServiceCache.hpp>
Classes | |
struct | IteratorData |
struct | ObjectData |
Public Types | |
typedef Prox::LocationUpdateListener < ObjectProxSimulationTraits > | LocationUpdateListener |
Public Member Functions | |
CBRLocationServiceCache (Network::IOStrand *strand, LocationService *locservice, bool replicas) | |
Constructs a CBRLocationServiceCache which caches entries from locservice. | |
virtual | ~CBRLocationServiceCache () |
virtual void | addPlaceholderImposter (const ObjectID &id, const Vector3f ¢er_offset, const float32 center_bounds_radius, const float32 max_size, const String &zernike, const String &mesh) |
virtual Iterator | startTracking (const ObjectID &id) |
virtual void | stopTracking (const Iterator &id) |
virtual bool | startRefcountTracking (const ObjectID &id) |
virtual void | stopRefcountTracking (const ObjectID &id) |
virtual bool | tracking (const ObjectID &id) |
virtual TimedMotionVector3f | location (const Iterator &id) |
virtual Vector3f | centerOffset (const Iterator &id) |
virtual float32 | centerBoundsRadius (const Iterator &id) |
virtual float32 | maxSize (const Iterator &id) |
virtual bool | isLocal (const Iterator &id) |
Prox::ZernikeDescriptor & | zernikeDescriptor (const Iterator &id) |
String | mesh (const Iterator &id) |
virtual const ObjectReference & | iteratorID (const Iterator &id) |
virtual void | addUpdateListener (LocationUpdateListener *listener) |
virtual void | removeUpdateListener (LocationUpdateListener *listener) |
TimedMotionVector3f | location (const ObjectID &id) |
TimedMotionQuaternion | orientation (const ObjectID &id) |
AggregateBoundingInfo | bounds (const ObjectID &id) |
Transfer::URI | mesh (const ObjectID &id) |
String | physics (const ObjectID &id) |
virtual bool | aggregate (const ObjectID &id) |
const bool | isAggregate (const ObjectID &id) |
virtual void | localObjectAdded (const UUID &uuid, bool agg, const TimedMotionVector3f &loc, const TimedMotionQuaternion &orient, const AggregateBoundingInfo &bounds, const String &mesh, const String &physics, const String &zernike) |
virtual void | localObjectRemoved (const UUID &uuid, bool agg) |
virtual void | localLocationUpdated (const UUID &uuid, bool agg, const TimedMotionVector3f &newval) |
virtual void | localOrientationUpdated (const UUID &uuid, bool agg, const TimedMotionQuaternion &newval) |
virtual void | localBoundsUpdated (const UUID &uuid, bool agg, const AggregateBoundingInfo &newval) |
virtual void | localMeshUpdated (const UUID &uuid, bool agg, const String &newval) |
virtual void | localPhysicsUpdated (const UUID &uuid, bool agg, const String &newval) |
virtual void | replicaObjectAdded (const UUID &uuid, const TimedMotionVector3f &loc, const TimedMotionQuaternion &orient, const AggregateBoundingInfo &bounds, const String &mesh, const String &physics, const String &zernike) |
virtual void | replicaObjectRemoved (const UUID &uuid) |
virtual void | replicaLocationUpdated (const UUID &uuid, const TimedMotionVector3f &newval) |
virtual void | replicaOrientationUpdated (const UUID &uuid, const TimedMotionQuaternion &newval) |
virtual void | replicaBoundsUpdated (const UUID &uuid, const AggregateBoundingInfo &newval) |
virtual void | replicaMeshUpdated (const UUID &uuid, const String &newval) |
virtual void | replicaPhysicsUpdated (const UUID &uuid, const String &newval) |
Private Types | |
typedef boost::recursive_mutex | Mutex |
typedef boost::lock_guard< Mutex > | Lock |
typedef std::set < LocationUpdateListener * > | ListenerSet |
typedef std::tr1::unordered_map < ObjectReference, ObjectData, ObjectReference::Hasher > | ObjectDataMap |
Private Member Functions | |
void | objectAdded (const UUID &uuid, bool islocal, bool agg, const TimedMotionVector3f &loc, const TimedMotionQuaternion &orient, const AggregateBoundingInfo &bounds, const String &mesh, const String &physics, const String &zernike) |
void | objectRemoved (const UUID &uuid, bool agg) |
void | locationUpdated (const UUID &uuid, bool agg, const TimedMotionVector3f &newval) |
void | orientationUpdated (const UUID &uuid, bool agg, const TimedMotionQuaternion &newval) |
void | boundsUpdated (const UUID &uuid, bool agg, const AggregateBoundingInfo &newval) |
void | meshUpdated (const UUID &uuid, bool agg, const String &newval) |
void | physicsUpdated (const UUID &uuid, bool agg, const String &newval) |
void | processObjectAdded (const ObjectReference &uuid, ObjectData data) |
void | processObjectRemoved (const ObjectReference &uuid, bool agg) |
void | processLocationUpdated (const ObjectReference &uuid, bool agg, const TimedMotionVector3f &newval) |
void | processOrientationUpdated (const ObjectReference &uuid, bool agg, const TimedMotionQuaternion &newval) |
void | processBoundsUpdated (const ObjectReference &uuid, bool agg, const AggregateBoundingInfo &newval) |
void | processMeshUpdated (const ObjectReference &uuid, bool agg, const String &newval) |
void | processPhysicsUpdated (const ObjectReference &uuid, bool agg, const String &newval) |
CBRLocationServiceCache () | |
bool | tryRemoveObject (ObjectDataMap::iterator &obj_it) |
Private Attributes | |
Mutex | mListenerMutex |
Mutex | mDataMutex |
Network::IOStrand * | mStrand |
LocationService * | mLoc |
ListenerSet | mListeners |
ObjectDataMap | mObjects |
bool | mWithReplicas |
typedef std::set<LocationUpdateListener*> Sirikata::CBRLocationServiceCache::ListenerSet [private] |
typedef Prox::LocationUpdateListener<ObjectProxSimulationTraits> Sirikata::CBRLocationServiceCache::LocationUpdateListener |
typedef boost::lock_guard<Mutex> Sirikata::CBRLocationServiceCache::Lock [private] |
typedef boost::recursive_mutex Sirikata::CBRLocationServiceCache::Mutex [private] |
typedef std::tr1::unordered_map<ObjectReference, ObjectData, ObjectReference::Hasher> Sirikata::CBRLocationServiceCache::ObjectDataMap [private] |
Sirikata::CBRLocationServiceCache::CBRLocationServiceCache | ( | Network::IOStrand * | strand, |
LocationService * | locservice, | ||
bool | replicas | ||
) |
Constructs a CBRLocationServiceCache which caches entries from locservice.
If replicas is true, then it caches replica entries from locservice, in addition to the local entries it always caches.
References Sirikata::LocationService::addListener(), and mLoc.
Sirikata::CBRLocationServiceCache::~CBRLocationServiceCache | ( | ) | [virtual] |
References mListeners, mLoc, mObjects, and Sirikata::LocationService::removeListener().
Sirikata::CBRLocationServiceCache::CBRLocationServiceCache | ( | ) | [private] |
void Sirikata::CBRLocationServiceCache::addPlaceholderImposter | ( | const ObjectID & | id, |
const Vector3f & | center_offset, | ||
const float32 | center_bounds_radius, | ||
const float32 | max_size, | ||
const String & | zernike, | ||
const String & | mesh | ||
) | [virtual] |
References bounds(), Sirikata::LocationService::context(), mesh(), mLoc, objectAdded(), and Sirikata::Context::simTime().
void Sirikata::CBRLocationServiceCache::addUpdateListener | ( | LocationUpdateListener * | listener | ) | [virtual] |
References mListenerMutex, and mListeners.
virtual bool Sirikata::CBRLocationServiceCache::aggregate | ( | const ObjectID & | id | ) | [inline, virtual] |
References isAggregate().
AggregateBoundingInfo Sirikata::CBRLocationServiceCache::bounds | ( | const ObjectID & | id | ) |
void Sirikata::CBRLocationServiceCache::boundsUpdated | ( | const UUID & | uuid, |
bool | agg, | ||
const AggregateBoundingInfo & | newval | ||
) | [private] |
References mStrand, Sirikata::Network::IOStrand::post(), and processBoundsUpdated().
Referenced by localBoundsUpdated(), and replicaBoundsUpdated().
float32 Sirikata::CBRLocationServiceCache::centerBoundsRadius | ( | const Iterator & | id | ) | [virtual] |
References Sirikata::CBRLocationServiceCache::IteratorData::it, and mObjects.
Vector3f Sirikata::CBRLocationServiceCache::centerOffset | ( | const Iterator & | id | ) | [virtual] |
References Sirikata::CBRLocationServiceCache::IteratorData::it, and mObjects.
const bool Sirikata::CBRLocationServiceCache::isAggregate | ( | const ObjectID & | id | ) |
References GET_OBJ_ENTRY.
Referenced by aggregate(), and Sirikata::LibproxProximity::generateObjectQueryEvents().
bool Sirikata::CBRLocationServiceCache::isLocal | ( | const Iterator & | id | ) | [virtual] |
References Sirikata::CBRLocationServiceCache::IteratorData::it, and mObjects.
const ObjectReference & Sirikata::CBRLocationServiceCache::iteratorID | ( | const Iterator & | id | ) | [virtual] |
void Sirikata::CBRLocationServiceCache::localBoundsUpdated | ( | const UUID & | uuid, |
bool | agg, | ||
const AggregateBoundingInfo & | newval | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References boundsUpdated().
void Sirikata::CBRLocationServiceCache::localLocationUpdated | ( | const UUID & | uuid, |
bool | agg, | ||
const TimedMotionVector3f & | newval | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References locationUpdated().
void Sirikata::CBRLocationServiceCache::localMeshUpdated | ( | const UUID & | uuid, |
bool | agg, | ||
const String & | newval | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References meshUpdated().
void Sirikata::CBRLocationServiceCache::localObjectAdded | ( | const UUID & | uuid, |
bool | agg, | ||
const TimedMotionVector3f & | loc, | ||
const TimedMotionQuaternion & | orient, | ||
const AggregateBoundingInfo & | bounds, | ||
const String & | mesh, | ||
const String & | physics, | ||
const String & | zernike | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References objectAdded().
void Sirikata::CBRLocationServiceCache::localObjectRemoved | ( | const UUID & | uuid, |
bool | agg | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References objectRemoved().
void Sirikata::CBRLocationServiceCache::localOrientationUpdated | ( | const UUID & | uuid, |
bool | agg, | ||
const TimedMotionQuaternion & | newval | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References orientationUpdated().
void Sirikata::CBRLocationServiceCache::localPhysicsUpdated | ( | const UUID & | uuid, |
bool | agg, | ||
const String & | newval | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References physicsUpdated().
TimedMotionVector3f Sirikata::CBRLocationServiceCache::location | ( | const ObjectID & | id | ) |
References GET_OBJ_ENTRY.
TimedMotionVector3f Sirikata::CBRLocationServiceCache::location | ( | const Iterator & | id | ) | [virtual] |
void Sirikata::CBRLocationServiceCache::locationUpdated | ( | const UUID & | uuid, |
bool | agg, | ||
const TimedMotionVector3f & | newval | ||
) | [private] |
References mStrand, Sirikata::Network::IOStrand::post(), and processLocationUpdated().
Referenced by localLocationUpdated(), and replicaLocationUpdated().
float32 Sirikata::CBRLocationServiceCache::maxSize | ( | const Iterator & | id | ) | [virtual] |
References Sirikata::CBRLocationServiceCache::IteratorData::it, and mObjects.
Transfer::URI Sirikata::CBRLocationServiceCache::mesh | ( | const ObjectID & | id | ) |
References GET_OBJ_ENTRY.
String Sirikata::CBRLocationServiceCache::mesh | ( | const Iterator & | id | ) |
void Sirikata::CBRLocationServiceCache::meshUpdated | ( | const UUID & | uuid, |
bool | agg, | ||
const String & | newval | ||
) | [private] |
References mStrand, Sirikata::Network::IOStrand::post(), and processMeshUpdated().
Referenced by localMeshUpdated(), and replicaMeshUpdated().
void Sirikata::CBRLocationServiceCache::objectAdded | ( | const UUID & | uuid, |
bool | islocal, | ||
bool | agg, | ||
const TimedMotionVector3f & | loc, | ||
const TimedMotionQuaternion & | orient, | ||
const AggregateBoundingInfo & | bounds, | ||
const String & | mesh, | ||
const String & | physics, | ||
const String & | zernike | ||
) | [private] |
References bounds(), Sirikata::CBRLocationServiceCache::ObjectData::bounds, Sirikata::CBRLocationServiceCache::ObjectData::exists, Sirikata::CBRLocationServiceCache::ObjectData::isAggregate, Sirikata::CBRLocationServiceCache::ObjectData::isLocal, Sirikata::CBRLocationServiceCache::ObjectData::location, mDataMutex, mesh(), Sirikata::CBRLocationServiceCache::ObjectData::mesh, mObjects, mStrand, Sirikata::CBRLocationServiceCache::ObjectData::orientation, Sirikata::CBRLocationServiceCache::ObjectData::physics, Sirikata::Network::IOStrand::post(), processObjectAdded(), Sirikata::CBRLocationServiceCache::ObjectData::tracking, and Sirikata::CBRLocationServiceCache::ObjectData::zernike.
Referenced by addPlaceholderImposter(), localObjectAdded(), and replicaObjectAdded().
void Sirikata::CBRLocationServiceCache::objectRemoved | ( | const UUID & | uuid, |
bool | agg | ||
) | [private] |
References mDataMutex, mObjects, mStrand, Sirikata::Network::IOStrand::post(), and processObjectRemoved().
Referenced by localObjectRemoved(), and replicaObjectRemoved().
TimedMotionQuaternion Sirikata::CBRLocationServiceCache::orientation | ( | const ObjectID & | id | ) |
References GET_OBJ_ENTRY.
Referenced by Sirikata::LibproxProximity::generateObjectQueryEvents(), and Sirikata::LibproxProximity::generateServerQueryEvents().
void Sirikata::CBRLocationServiceCache::orientationUpdated | ( | const UUID & | uuid, |
bool | agg, | ||
const TimedMotionQuaternion & | newval | ||
) | [private] |
References mStrand, Sirikata::Network::IOStrand::post(), and processOrientationUpdated().
Referenced by localOrientationUpdated(), and replicaOrientationUpdated().
String Sirikata::CBRLocationServiceCache::physics | ( | const ObjectID & | id | ) |
References GET_OBJ_ENTRY.
Referenced by Sirikata::LibproxProximity::generateObjectQueryEvents(), and Sirikata::LibproxProximity::generateServerQueryEvents().
void Sirikata::CBRLocationServiceCache::physicsUpdated | ( | const UUID & | uuid, |
bool | agg, | ||
const String & | newval | ||
) | [private] |
References mStrand, Sirikata::Network::IOStrand::post(), and processPhysicsUpdated().
Referenced by localPhysicsUpdated(), and replicaPhysicsUpdated().
void Sirikata::CBRLocationServiceCache::processBoundsUpdated | ( | const ObjectReference & | uuid, |
bool | agg, | ||
const AggregateBoundingInfo & | newval | ||
) | [private] |
References Sirikata::AggregateBoundingInfo::centerBounds(), Sirikata::AggregateBoundingInfo::maxObjectRadius, mDataMutex, mListenerMutex, mListeners, and mObjects.
Referenced by boundsUpdated().
void Sirikata::CBRLocationServiceCache::processLocationUpdated | ( | const ObjectReference & | uuid, |
bool | agg, | ||
const TimedMotionVector3f & | newval | ||
) | [private] |
References mDataMutex, mListenerMutex, mListeners, and mObjects.
Referenced by locationUpdated().
void Sirikata::CBRLocationServiceCache::processMeshUpdated | ( | const ObjectReference & | uuid, |
bool | agg, | ||
const String & | newval | ||
) | [private] |
References mDataMutex, and mObjects.
Referenced by meshUpdated().
void Sirikata::CBRLocationServiceCache::processObjectAdded | ( | const ObjectReference & | uuid, |
ObjectData | data | ||
) | [private] |
References Sirikata::CBRLocationServiceCache::ObjectData::bounds, Sirikata::AggregateBoundingInfo::centerBounds(), Sirikata::CBRLocationServiceCache::ObjectData::isAggregate, Sirikata::CBRLocationServiceCache::ObjectData::isLocal, Sirikata::CBRLocationServiceCache::ObjectData::location, Sirikata::AggregateBoundingInfo::maxObjectRadius, mDataMutex, mListenerMutex, mListeners, mObjects, and tryRemoveObject().
Referenced by objectAdded().
void Sirikata::CBRLocationServiceCache::processObjectRemoved | ( | const ObjectReference & | uuid, |
bool | agg | ||
) | [private] |
References mDataMutex, mListenerMutex, mListeners, mObjects, and tryRemoveObject().
Referenced by objectRemoved().
void Sirikata::CBRLocationServiceCache::processOrientationUpdated | ( | const ObjectReference & | uuid, |
bool | agg, | ||
const TimedMotionQuaternion & | newval | ||
) | [private] |
References mDataMutex, and mObjects.
Referenced by orientationUpdated().
void Sirikata::CBRLocationServiceCache::processPhysicsUpdated | ( | const ObjectReference & | uuid, |
bool | agg, | ||
const String & | newval | ||
) | [private] |
References mDataMutex, and mObjects.
Referenced by physicsUpdated().
void Sirikata::CBRLocationServiceCache::removeUpdateListener | ( | LocationUpdateListener * | listener | ) | [virtual] |
References mListenerMutex, and mListeners.
void Sirikata::CBRLocationServiceCache::replicaBoundsUpdated | ( | const UUID & | uuid, |
const AggregateBoundingInfo & | newval | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References boundsUpdated(), and mWithReplicas.
void Sirikata::CBRLocationServiceCache::replicaLocationUpdated | ( | const UUID & | uuid, |
const TimedMotionVector3f & | newval | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References locationUpdated(), and mWithReplicas.
void Sirikata::CBRLocationServiceCache::replicaMeshUpdated | ( | const UUID & | uuid, |
const String & | newval | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References meshUpdated(), and mWithReplicas.
void Sirikata::CBRLocationServiceCache::replicaObjectAdded | ( | const UUID & | uuid, |
const TimedMotionVector3f & | loc, | ||
const TimedMotionQuaternion & | orient, | ||
const AggregateBoundingInfo & | bounds, | ||
const String & | mesh, | ||
const String & | physics, | ||
const String & | zernike | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References mWithReplicas, and objectAdded().
void Sirikata::CBRLocationServiceCache::replicaObjectRemoved | ( | const UUID & | uuid | ) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References mWithReplicas, and objectRemoved().
void Sirikata::CBRLocationServiceCache::replicaOrientationUpdated | ( | const UUID & | uuid, |
const TimedMotionQuaternion & | newval | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References mWithReplicas, and orientationUpdated().
void Sirikata::CBRLocationServiceCache::replicaPhysicsUpdated | ( | const UUID & | uuid, |
const String & | newval | ||
) | [virtual] |
Reimplemented from Sirikata::LocationServiceListener.
References mWithReplicas, and physicsUpdated().
bool Sirikata::CBRLocationServiceCache::startRefcountTracking | ( | const ObjectID & | id | ) | [virtual] |
References mDataMutex, and mObjects.
virtual Iterator Sirikata::CBRLocationServiceCache::startTracking | ( | const ObjectID & | id | ) | [virtual] |
void Sirikata::CBRLocationServiceCache::stopRefcountTracking | ( | const ObjectID & | id | ) | [virtual] |
References mDataMutex, mObjects, and tryRemoveObject().
Referenced by stopTracking().
void Sirikata::CBRLocationServiceCache::stopTracking | ( | const Iterator & | id | ) | [virtual] |
virtual bool Sirikata::CBRLocationServiceCache::tracking | ( | const ObjectID & | id | ) | [virtual] |
bool Sirikata::CBRLocationServiceCache::tryRemoveObject | ( | ObjectDataMap::iterator & | obj_it | ) | [private] |
References mObjects.
Referenced by processObjectAdded(), processObjectRemoved(), and stopRefcountTracking().
Prox::ZernikeDescriptor & Sirikata::CBRLocationServiceCache::zernikeDescriptor | ( | const Iterator & | id | ) |
References Sirikata::CBRLocationServiceCache::IteratorData::it, and mObjects.
Referenced by objectAdded(), objectRemoved(), processBoundsUpdated(), processLocationUpdated(), processMeshUpdated(), processObjectAdded(), processObjectRemoved(), processOrientationUpdated(), processPhysicsUpdated(), startRefcountTracking(), Sirikata::PintoManagerLocationServiceCache::startTracking(), stopRefcountTracking(), stopTracking(), and Sirikata::PintoManagerLocationServiceCache::tracking().
Referenced by addPlaceholderImposter(), CBRLocationServiceCache(), and ~CBRLocationServiceCache().
Referenced by centerBoundsRadius(), centerOffset(), isLocal(), location(), maxSize(), mesh(), objectAdded(), objectRemoved(), processBoundsUpdated(), processLocationUpdated(), processMeshUpdated(), processObjectAdded(), processObjectRemoved(), processOrientationUpdated(), processPhysicsUpdated(), startRefcountTracking(), Sirikata::PintoManagerLocationServiceCache::startTracking(), stopRefcountTracking(), Sirikata::PintoManagerLocationServiceCache::tracking(), tryRemoveObject(), zernikeDescriptor(), and ~CBRLocationServiceCache().
Referenced by boundsUpdated(), locationUpdated(), meshUpdated(), objectAdded(), objectRemoved(), orientationUpdated(), and physicsUpdated().
bool Sirikata::CBRLocationServiceCache::mWithReplicas [private] |