Sirikata
|
#include <HostedObject.hpp>
Classes | |
struct | OHConnectInfo |
Public Types | |
typedef SST::EndPoint < SpaceObjectReference > | EndPointType |
typedef SST::BaseDatagramLayer < SpaceObjectReference > | BaseDatagramLayerType |
typedef BaseDatagramLayerType::Ptr | BaseDatagramLayerPtr |
typedef SST::Connection < SpaceObjectReference > | SSTConnection |
typedef SSTConnection::Ptr | SSTConnectionPtr |
typedef SST::Stream < SpaceObjectReference > | SSTStream |
typedef SSTStream::Ptr | SSTStreamPtr |
typedef std::vector < SpaceObjectReference > | SpaceObjRefVec |
Get a set of spaces the object is currently connected to. | |
typedef int64 | PresenceToken |
Public Member Functions | |
virtual | ~HostedObject () |
Destructor: will only be called from shared_ptr::~shared_ptr. | |
const UUID & | id () const |
Get a unique identifier for this object on this object host. | |
virtual void | start () |
virtual void | stop () |
bool | stopped () const |
void | getSpaceObjRefs (SpaceObjRefVec &ss) const |
ObjectHostContext * | context () |
const ObjectHostContext * | context () const |
Time | spaceTime (const SpaceID &space, const Time &t) |
Time | currentSpaceTime (const SpaceID &space) |
Time | localTime (const SpaceID &space, const Time &t) |
Time | currentLocalTime () |
void | initializeScript (const String &script_type, const String &args, const String &script) |
makes a new objects with objectName startingLocation mesh and connect to some interesting space | |
void | destroy (bool need_self=true) |
Removes this HostedObject from the ObjectHost, and destroys the internal shared pointer Safe to reuse for another connection, as long as you hold a shared_ptr to this object. | |
ObjectHost * | getObjectHost () const |
Gets the ObjectHost (usually one per host). | |
ProxyObjectPtr | getProxy (const SpaceID &space, const ObjectReference &oref) |
Gets the proxy object representing this HostedObject inside space. | |
Simulation * | runSimulation (const SpaceObjectReference &sporef, const String &simName, Network::IOStrandPtr simStrand) |
void | killSimulation (const SpaceObjectReference &sporef, const String &simName) |
virtual ProxyManagerPtr | getProxyManager (const SpaceID &space, const ObjectReference &oref) |
bool | connect (const SpaceID &spaceID, const Location &startingLocation, const BoundingSphere3f &meshBounds, const String &mesh, const String &physics, const String &query, const ObjectReference &orefID=ObjectReference::null(), PresenceToken token=DEFAULT_PRESENCE_TOKEN) |
Initiate connection process to a space, but do not send any messages yet. | |
void | objectHostConnectIndirect (OHConnectInfoPtr oci) |
bool | objectHostConnect (const SpaceID spaceID, const Location startingLocation, const BoundingSphere3f meshBounds, const String mesh, const String physics, const String query, const String zernike, const ObjectReference orefID, PresenceToken token=DEFAULT_PRESENCE_TOKEN) |
bool | downloadZernikeDescriptor (OHConnectInfoPtr ocip, uint8 n_retry=0) |
void | metadataDownloaded (OHConnectInfoPtr ocip, uint8 retryCount, std::tr1::shared_ptr< Transfer::MetadataRequest > request, std::tr1::shared_ptr< Transfer::RemoteFileMetadata > response) |
void | disconnectFromSpace (const SpaceID &spaceID, const ObjectReference &oref) |
Disconnects from the given space by terminating the corresponding substream. | |
void | receiveMessage (const SpaceID &space, const Protocol::Object::ObjectMessage *msg) |
Receive an ObjectMessage from the space via the ObjectHost. | |
HostedObjectPtr | getSharedPtr () |
HostedObjectWPtr | getWeakPtr () |
virtual ProxyManagerPtr | presence (const SpaceObjectReference &sor) |
Get the ProxyManager for the given presence. | |
virtual SequencedPresencePropertiesPtr | presenceRequestedLocation (const SpaceObjectReference &sor) |
Get requested location information for a presence. | |
virtual uint64 | presenceLatestEpoch (const SpaceObjectReference &sor) |
Get the last seen epoch for the given presence (reported from space, there may be higher epochs for outstanding requests). | |
virtual ProxyObjectPtr | self (const SpaceObjectReference &sor) |
virtual ODP::Port * | bindODPPort (const SpaceID &space, const ObjectReference &objref, ODP::PortID port) |
Bind an ODP port for use. | |
virtual ODP::Port * | bindODPPort (const SpaceObjectReference &sor, ODP::PortID port) |
virtual ODP::Port * | bindODPPort (const SpaceID &space, const ObjectReference &objref) |
Bind a random, unused ODP port for use. | |
virtual ODP::Port * | bindODPPort (const SpaceObjectReference &sor) |
virtual ODP::PortID | unusedODPPort (const SpaceID &space, const ObjectReference &objref) |
Get a random, unused ODP port. | |
virtual ODP::PortID | unusedODPPort (const SpaceObjectReference &sor) |
virtual void | registerDefaultODPHandler (const ODP::Service::MessageHandler &cb) |
ODPSST::Stream::Ptr | getSpaceStream (const SpaceObjectReference &sor) |
virtual void | requestLocationUpdate (const SpaceID &space, const ObjectReference &oref, const TimedMotionVector3f &loc) |
virtual void | requestOrientationUpdate (const SpaceID &space, const ObjectReference &oref, const TimedMotionQuaternion &orient) |
virtual void | requestBoundsUpdate (const SpaceID &space, const ObjectReference &oref, const BoundingSphere3f &bounds) |
virtual void | requestMeshUpdate (const SpaceID &space, const ObjectReference &oref, const String &mesh) |
virtual void | requestPhysicsUpdate (const SpaceID &space, const ObjectReference &oref, const String &phy) |
virtual void | requestQueryUpdate (const SpaceID &space, const ObjectReference &oref, const String &new_query) |
virtual void | requestQueryRemoval (const SpaceID &space, const ObjectReference &oref) |
virtual String | requestQuery (const SpaceID &space, const ObjectReference &oref) |
void | handleProximityUpdate (const SpaceObjectReference &spaceobj, const Sirikata::Protocol::Prox::ProximityUpdate &update) |
void | handleLocationUpdate (const SpaceObjectReference &spaceobj, const LocUpdate &lu) |
void | commandPresences (const Command::Command &cmd, Command::Commander *cmdr, Command::CommandID cmdid) |
Static Public Attributes | |
static const PresenceToken | DEFAULT_PRESENCE_TOKEN = -1 |
Protected Types | |
typedef std::map < SpaceObjectReference, PerPresenceData * > | PresenceDataMap |
typedef boost::mutex | Mutex |
Protected Attributes | |
ObjectHostContext * | mContext |
const UUID | mID |
ObjectHost * | mObjectHost |
ObjectScript * | mObjectScript |
PresenceDataMap | mPresenceData |
bool | destroyed |
ODP::DelegateService * | mDelegateODPService |
Mutex | presenceDataMutex |
Mutex | notifyMutex |
AtomicValue< int > | mNumOutstandingConnections |
bool | mDestroyWhenConnected |
Private Types | |
typedef struct Sirikata::HostedObject::OHConnectInfo | OHConnectInfo |
typedef std::tr1::shared_ptr < OHConnectInfo > | OHConnectInfoPtr |
Private Member Functions | |
HostedObject (ObjectHostContext *ctx, ObjectHost *parent, const UUID &_id) | |
Private: Use "SelfWeakPtr<HostedObject>::construct(ObjectHost*)". | |
void | iHandleDisconnected (const HostedObjectWPtr &weakSelf, const SpaceObjectReference &spaceobj, Disconnect::Code cc) |
ODP::DelegatePort * | createDelegateODPPort (ODP::DelegateService *parentService, const SpaceObjectReference &spaceobj, ODP::PortID port) |
bool | delegateODPPortSend (const ODP::Endpoint &source_ep, const ODP::Endpoint &dest_ep, MemoryReference payload) |
void | processLocationUpdate (const SpaceObjectReference &sporef, ProxyObjectPtr proxy_obj, const LocUpdate &update) |
void | processLocationUpdate (const SpaceID &space, ProxyObjectPtr proxy_obj, bool predictive, TimedMotionVector3f *loc, uint64 loc_seqno, TimedMotionQuaternion *orient, uint64 orient_seqno, AggregateBoundingInfo *bounds, uint64 bounds_seqno, String *mesh, uint64 mesh_seqno, String *phy, uint64 phy_seqno) |
ProxyObjectPtr | createProxy (const SpaceObjectReference &objref, const SpaceObjectReference &owner_objref, const Transfer::URI &meshuri, TimedMotionVector3f &tmv, TimedMotionQuaternion &tmvq, const AggregateBoundingInfo &bounds, const String &physics, const String &query, bool isAggregate, uint64 seqNo) |
void | updateLocUpdateRequest (const SpaceID &space, const ObjectReference &oref, const TimedMotionVector3f *const loc, const TimedMotionQuaternion *const orient, const BoundingSphere3f *const bounds, const String *const mesh, const String *const phy) |
void | sendLocUpdateRequest (const SpaceID &space, const ObjectReference &oref) |
Static Private Member Functions | |
static void | handleConnected (const HostedObjectWPtr &weakSelf, ObjectHost *parentOH, const SpaceID &space, const ObjectReference &obj, ObjectHost::ConnectionInfo info) |
static void | handleConnectedIndirect (const HostedObjectWPtr &weakSelf, ObjectHost *parentOH, const SpaceID &space, const ObjectReference &obj, ObjectHost::ConnectionInfo info, const BaseDatagramLayerPtr &) |
static void | handleMigrated (const HostedObjectWPtr &weakSelf, const SpaceID &space, const ObjectReference &obj, ServerID server) |
static void | handleStreamCreated (const HostedObjectWPtr &weakSelf, const SpaceObjectReference &spaceobj, SessionManager::ConnectionEvent after, PresenceToken token) |
static void | handleDisconnected (const HostedObjectWPtr &weakSelf, const SpaceObjectReference &spaceobj, Disconnect::Code cc) |
static void | disconnectDeadPresence (ObjectHost *parentOH, const SpaceID &space, const ObjectReference &obj) |
Friends | |
class | ::Sirikata::SelfWeakPtr< VWObject > |
class | PerPresenceData |
typedef boost::mutex Sirikata::HostedObject::Mutex [protected] |
typedef struct Sirikata::HostedObject::OHConnectInfo Sirikata::HostedObject::OHConnectInfo [private] |
typedef std::tr1::shared_ptr<OHConnectInfo> Sirikata::HostedObject::OHConnectInfoPtr [private] |
typedef std::map<SpaceObjectReference, PerPresenceData*> Sirikata::HostedObject::PresenceDataMap [protected] |
typedef int64 Sirikata::HostedObject::PresenceToken |
typedef std::vector<SpaceObjectReference> Sirikata::HostedObject::SpaceObjRefVec |
Get a set of spaces the object is currently connected to.
NOTE: Be very careful with this. It reports everything connected, including presences where we haven't established the SST stream with the space, which lots of listeners (including SessionEventListeners) rely on.
Sirikata::HostedObject::~HostedObject | ( | ) | [virtual] |
Destructor: will only be called from shared_ptr::~shared_ptr.
References destroy(), getObjectHost(), Sirikata::ObjectHost::hostedObjectDestroyed(), mDelegateODPService, mPresenceData, presenceDataMutex, and stop().
Sirikata::HostedObject::HostedObject | ( | ObjectHostContext * | ctx, |
ObjectHost * | parent, | ||
const UUID & | _id | ||
) | [private] |
Private: Use "SelfWeakPtr<HostedObject>::construct(ObjectHost*)".
Create a new HostedObject.
_id | A unique identifier for this object within this object host. You can specify it at construction so that objects can be restored from permanent storage. You should always specify a non-null value, even if you need to manually allocate a new random identifier. |
References createDelegateODPPort(), mDelegateODPService, mDestroyWhenConnected, and mNumOutstandingConnections.
ODP::Port * Sirikata::HostedObject::bindODPPort | ( | const SpaceID & | space, |
const ObjectReference & | objref, | ||
ODP::PortID | port | ||
) | [virtual] |
Bind an ODP port for use.
space | the Space to communicate via |
objref | the Object to communicate via |
port | the PortID to attempt to bind |
PortAllocationError | if the Service cannot allocate the port for some reason other than it already being allocated. |
Implements Sirikata::ODP::Service.
References Sirikata::ODP::DelegateService::bindODPPort(), mDelegateODPService, and stopped().
ODP::Port * Sirikata::HostedObject::bindODPPort | ( | const SpaceObjectReference & | sor, |
ODP::PortID | port | ||
) | [virtual] |
Implements Sirikata::ODP::Service.
References Sirikata::ODP::DelegateService::bindODPPort(), mDelegateODPService, and stopped().
ODP::Port * Sirikata::HostedObject::bindODPPort | ( | const SpaceID & | space, |
const ObjectReference & | objref | ||
) | [virtual] |
Bind a random, unused ODP port for use.
space | the Space to communicate via |
PortAllocationError | if the Service cannot allocate the port for some reason other than it already being allocated. |
Implements Sirikata::ODP::Service.
References Sirikata::ODP::DelegateService::bindODPPort(), mDelegateODPService, and stopped().
ODP::Port * Sirikata::HostedObject::bindODPPort | ( | const SpaceObjectReference & | sor | ) | [virtual] |
Implements Sirikata::ODP::Service.
References Sirikata::ODP::DelegateService::bindODPPort(), mDelegateODPService, and stopped().
void Sirikata::HostedObject::commandPresences | ( | const Command::Command & | cmd, |
Command::Commander * | cmdr, | ||
Command::CommandID | cmdid | ||
) |
bool Sirikata::HostedObject::connect | ( | const SpaceID & | spaceID, |
const Location & | startingLocation, | ||
const BoundingSphere3f & | meshBounds, | ||
const String & | mesh, | ||
const String & | physics, | ||
const String & | query, | ||
const ObjectReference & | orefID = ObjectReference::null() , |
||
PresenceToken | token = DEFAULT_PRESENCE_TOKEN |
||
) |
Initiate connection process to a space, but do not send any messages yet.
After calling connectToSpace, it is immediately possible to send() a NewObj message, however any other message must wait until you receive the RetObj for that space.
spaceID | The UUID of the space you connect to. |
startingLocation | The initial location of this object. Must be known at connection time? |
meshBounds | The size of this mesh. If set incorrectly, mesh will be scaled to these bounds. |
mesh | the URL of the mesh for this object |
physics | Physical parameters, serialized to a string. The exact format depends on the physics implementation the server is using. |
query | if non-empty, query parameters |
token | When connection completes, notifies all session listeners. Provides token to these listeners so they can distinguish which presence may have connected, etc. |
References downloadZernikeDescriptor(), Sirikata::GetOptionValue< bool >(), HO_LOG, Sirikata::JS::JSPresence::meshBounds(), Sirikata::SpaceID::null(), objectHostConnect(), stopped(), and Sirikata::Logging::warn.
ObjectHostContext* Sirikata::HostedObject::context | ( | ) | [inline] |
const ObjectHostContext* Sirikata::HostedObject::context | ( | ) | const [inline] |
ODP::DelegatePort * Sirikata::HostedObject::createDelegateODPPort | ( | ODP::DelegateService * | parentService, |
const SpaceObjectReference & | spaceobj, | ||
ODP::PortID | port | ||
) | [private] |
References Sirikata::SpaceID::any(), delegateODPPortSend(), mDelegateODPService, Sirikata::SpaceID::null(), and Sirikata::SpaceObjectReference::space().
Referenced by HostedObject().
ProxyObjectPtr Sirikata::HostedObject::createProxy | ( | const SpaceObjectReference & | objref, |
const SpaceObjectReference & | owner_objref, | ||
const Transfer::URI & | meshuri, | ||
TimedMotionVector3f & | tmv, | ||
TimedMotionQuaternion & | tmvq, | ||
const AggregateBoundingInfo & | bounds, | ||
const String & | physics, | ||
const String & | query, | ||
bool | isAggregate, | ||
uint64 | seqNo | ||
) | [private] |
Time Sirikata::HostedObject::currentLocalTime | ( | ) |
References Sirikata::ObjectHost::currentLocalTime(), and mObjectHost.
References Sirikata::ObjectHost::currentSpaceTime(), and mObjectHost.
bool Sirikata::HostedObject::delegateODPPortSend | ( | const ODP::Endpoint & | source_ep, |
const ODP::Endpoint & | dest_ep, | ||
MemoryReference | payload | ||
) | [private] |
void Sirikata::HostedObject::destroy | ( | bool | need_self = true | ) |
Removes this HostedObject from the ObjectHost, and destroys the internal shared pointer Safe to reuse for another connection, as long as you hold a shared_ptr to this object.
References destroyed, Sirikata::ObjectHost::disconnectObject(), getSharedPtr(), Sirikata::ObjectHost::getStorage(), mDestroyWhenConnected, mNumOutstandingConnections, mObjectHost, mObjectScript, mPresenceData, presenceDataMutex, Sirikata::OH::Storage::releaseBucket(), and Sirikata::ObjectHost::unregisterHostedObject().
Referenced by ~HostedObject().
void Sirikata::HostedObject::disconnectDeadPresence | ( | ObjectHost * | parentOH, |
const SpaceID & | space, | ||
const ObjectReference & | obj | ||
) | [static, private] |
References Sirikata::ObjectHost::disconnectObject(), and Sirikata::ObjectHost::unregisterHostedObject().
Referenced by handleConnected(), and handleConnectedIndirect().
void Sirikata::HostedObject::disconnectFromSpace | ( | const SpaceID & | spaceID, |
const ObjectReference & | oref | ||
) |
Disconnects from the given space by terminating the corresponding substream.
References Sirikata::Logging::detailed, Sirikata::ObjectHost::disconnectObject(), Sirikata::Logging::error, HO_LOG, mObjectHost, mPresenceData, presenceDataMutex, SILOG, stopped(), and Sirikata::ObjectHost::unregisterHostedObject().
bool Sirikata::HostedObject::downloadZernikeDescriptor | ( | OHConnectInfoPtr | ocip, |
uint8 | n_retry = 0 |
||
) |
References Sirikata::ObjectHost::getTransferPool(), metadataDownloaded(), and mObjectHost.
Referenced by connect(), and metadataDownloaded().
ObjectHost* Sirikata::HostedObject::getObjectHost | ( | ) | const [inline] |
Gets the ObjectHost (usually one per host).
See getProxy(space)->getProxyManger() for the per-space object.
Referenced by runSimulation(), and ~HostedObject().
ProxyObjectPtr Sirikata::HostedObject::getProxy | ( | const SpaceID & | space, |
const ObjectReference & | oref | ||
) |
Gets the proxy object representing this HostedObject inside space.
References getProxyManager(), Sirikata::Logging::info, and SILOG.
Referenced by sendLocUpdateRequest().
ProxyManagerPtr Sirikata::HostedObject::getProxyManager | ( | const SpaceID & | space, |
const ObjectReference & | oref | ||
) | [virtual] |
References mPresenceData, and presenceDataMutex.
Referenced by createProxy(), getProxy(), handleLocationUpdate(), and presence().
HostedObjectPtr Sirikata::HostedObject::getSharedPtr | ( | ) | [inline] |
References Sirikata::SelfWeakPtr< VWObject >::getSharedPtr().
Referenced by createProxy(), destroy(), initializeScript(), objectHostConnect(), requestQueryUpdate(), and runSimulation().
void Sirikata::HostedObject::getSpaceObjRefs | ( | SpaceObjRefVec & | ss | ) | const |
References mPresenceData, and presenceDataMutex.
ODPSST::Stream::Ptr Sirikata::HostedObject::getSpaceStream | ( | const SpaceObjectReference & | sor | ) |
HostedObjectWPtr Sirikata::HostedObject::getWeakPtr | ( | ) | [inline] |
References Sirikata::SelfWeakPtr< VWObject >::getSharedPtr().
Referenced by objectHostConnect().
void Sirikata::HostedObject::handleConnected | ( | const HostedObjectWPtr & | weakSelf, |
ObjectHost * | parentOH, | ||
const SpaceID & | space, | ||
const ObjectReference & | obj, | ||
ObjectHost::ConnectionInfo | info | ||
) | [static, private] |
References Sirikata::ObjectHost::context(), Sirikata::Logging::detailed, disconnectDeadPresence(), handleConnectedIndirect(), HO_LOG, Sirikata::Context::mainStrand, Sirikata::Network::IOStrand::post(), self(), Sirikata::ObjectHost::ConnectionInfo::server, and Sirikata::Logging::warning.
Referenced by objectHostConnect().
void Sirikata::HostedObject::handleConnectedIndirect | ( | const HostedObjectWPtr & | weakSelf, |
ObjectHost * | parentOH, | ||
const SpaceID & | space, | ||
const ObjectReference & | obj, | ||
ObjectHost::ConnectionInfo | info, | ||
const BaseDatagramLayerPtr & | baseDatagramLayer | ||
) | [static, private] |
References Sirikata::ObjectHost::ConnectionInfo::bnds, Sirikata::ObjectHost::context(), Sirikata::Logging::detailed, disconnectDeadPresence(), HO_LOG, Sirikata::PerPresenceData::initializeAs(), Sirikata::ObjectHost::ConnectionInfo::loc, Sirikata::Context::mainStrand, Sirikata::ObjectHost::ConnectionInfo::mesh, Sirikata::ObjectHost::ConnectionInfo::orient, PerPresenceData, Sirikata::ObjectHost::ConnectionInfo::physics, Sirikata::Network::IOStrand::post(), Sirikata::ObjectHost::ConnectionInfo::query, self(), Sirikata::ObjectHost::ConnectionInfo::server, Sirikata::TimedMotionQuaternion::updateTime(), Sirikata::TimedMotionVector< MotionVectorType >::updateTime(), Sirikata::TemporalValueBase< Value, TimeType >::value(), and Sirikata::Logging::warning.
Referenced by handleConnected().
void Sirikata::HostedObject::handleDisconnected | ( | const HostedObjectWPtr & | weakSelf, |
const SpaceObjectReference & | spaceobj, | ||
Disconnect::Code | cc | ||
) | [static, private] |
References Sirikata::Logging::detailed, HO_LOG, and iHandleDisconnected().
Referenced by objectHostConnect().
void Sirikata::HostedObject::handleLocationUpdate | ( | const SpaceObjectReference & | spaceobj, |
const LocUpdate & | lu | ||
) |
void Sirikata::HostedObject::handleMigrated | ( | const HostedObjectWPtr & | weakSelf, |
const SpaceID & | space, | ||
const ObjectReference & | obj, | ||
ServerID | server | ||
) | [static, private] |
References Sirikata::Logging::error, and HO_LOG.
Referenced by objectHostConnect().
void Sirikata::HostedObject::handleProximityUpdate | ( | const SpaceObjectReference & | spaceobj, |
const Sirikata::Protocol::Prox::ProximityUpdate & | update | ||
) |
References CONTEXT_OHTRACE, Sirikata::Logging::detailed, Sirikata::ObjectReference::getAsUUID(), HO_LOG, Sirikata::Logging::insane, mContext, Sirikata::Time::null(), Sirikata::SpaceObjectReference::object(), self(), SILOG, Sirikata::Context::simTime(), Sirikata::SpaceObjectReference::space(), and Sirikata::Logging::warn.
void Sirikata::HostedObject::handleStreamCreated | ( | const HostedObjectWPtr & | weakSelf, |
const SpaceObjectReference & | spaceobj, | ||
SessionManager::ConnectionEvent | after, | ||
PresenceToken | token | ||
) | [static, private] |
References Sirikata::SessionManager::Connected, Sirikata::Logging::detailed, HO_LOG, Sirikata::SessionManager::Migrated, Sirikata::SpaceObjectReference::object(), Sirikata::SessionEventListener::onConnected(), Sirikata::SessionEventListener::onMigrated(), self(), and Sirikata::SpaceObjectReference::space().
Referenced by objectHostConnect().
const UUID & Sirikata::HostedObject::id | ( | ) | const |
Get a unique identifier for this object on this object host.
This is for internal use only -- it has nothing to do with any space or presences in the space. It is *not* a public value.
References mID.
void Sirikata::HostedObject::iHandleDisconnected | ( | const HostedObjectWPtr & | weakSelf, |
const SpaceObjectReference & | spaceobj, | ||
Disconnect::Code | cc | ||
) | [private] |
void Sirikata::HostedObject::initializeScript | ( | const String & | script_type, |
const String & | args, | ||
const String & | script | ||
) |
makes a new objects with objectName startingLocation mesh and connect to some interesting space
References Sirikata::ObjectScriptManager::createObjectScript(), Sirikata::Logging::debug, Sirikata::Logging::detailed, Sirikata::ObjectHost::getScriptManager(), getSharedPtr(), Sirikata::ObjectScriptManagerFactory::getSingleton(), Sirikata::ObjectHost::getStorage(), HO_LOG, Sirikata::Logging::insane, Sirikata::OH::Storage::leaseBucket(), mObjectHost, mObjectScript, Sirikata::ObjectScript::scriptOptionsIs(), Sirikata::ObjectScript::scriptTypeIs(), Sirikata::ObjectScript::start(), stopped(), and Sirikata::Logging::warn.
void Sirikata::HostedObject::killSimulation | ( | const SpaceObjectReference & | sporef, |
const String & | simName | ||
) |
References Sirikata::ObjectHost::localTime(), and mObjectHost.
void Sirikata::HostedObject::metadataDownloaded | ( | OHConnectInfoPtr | ocip, |
uint8 | retryCount, | ||
std::tr1::shared_ptr< Transfer::MetadataRequest > | request, | ||
std::tr1::shared_ptr< Transfer::RemoteFileMetadata > | response | ||
) |
References downloadZernikeDescriptor(), Sirikata::Context::mainStrand, mContext, objectHostConnectIndirect(), and Sirikata::Network::IOStrand::post().
Referenced by downloadZernikeDescriptor().
bool Sirikata::HostedObject::objectHostConnect | ( | const SpaceID | spaceID, |
const Location | startingLocation, | ||
const BoundingSphere3f | meshBounds, | ||
const String | mesh, | ||
const String | physics, | ||
const String | query, | ||
const String | zernike, | ||
const ObjectReference | orefID, | ||
PresenceToken | token = DEFAULT_PRESENCE_TOKEN |
||
) |
References Sirikata::ObjectHost::connect(), Sirikata::Location::getAngularSpeed(), Sirikata::Location::getAxisOfRotation(), Sirikata::Transform::getOrientation(), Sirikata::Transform::getPosition(), getSharedPtr(), Sirikata::Location::getVelocity(), getWeakPtr(), handleConnected(), handleDisconnected(), handleMigrated(), handleStreamCreated(), mObjectHost, Sirikata::Quaternion::normal(), Sirikata::Time::null(), Sirikata::ObjectReference::null(), Sirikata::UUID::random(), and Sirikata::ObjectHost::registerHostedObject().
Referenced by connect().
void Sirikata::HostedObject::objectHostConnectIndirect | ( | OHConnectInfoPtr | oci | ) | [inline] |
Referenced by metadataDownloaded().
ProxyManagerPtr Sirikata::HostedObject::presence | ( | const SpaceObjectReference & | sor | ) | [virtual] |
Get the ProxyManager for the given presence.
Reimplemented from Sirikata::VWObject.
References getProxyManager(), Sirikata::SpaceObjectReference::object(), and Sirikata::SpaceObjectReference::space().
Referenced by self().
uint64 Sirikata::HostedObject::presenceLatestEpoch | ( | const SpaceObjectReference & | sor | ) | [virtual] |
Get the last seen epoch for the given presence (reported from space, there may be higher epochs for outstanding requests).
Reimplemented from Sirikata::VWObject.
References mPresenceData, and presenceDataMutex.
SequencedPresencePropertiesPtr Sirikata::HostedObject::presenceRequestedLocation | ( | const SpaceObjectReference & | sor | ) | [virtual] |
Get requested location information for a presence.
This should be used carefully -- generally you should use a proxy object to resolve possibly rejected requests rather than using this directly.
Reimplemented from Sirikata::VWObject.
References mPresenceData, and presenceDataMutex.
void Sirikata::HostedObject::processLocationUpdate | ( | const SpaceObjectReference & | sporef, |
ProxyObjectPtr | proxy_obj, | ||
const LocUpdate & | update | ||
) | [private] |
void Sirikata::HostedObject::processLocationUpdate | ( | const SpaceID & | space, |
ProxyObjectPtr | proxy_obj, | ||
bool | predictive, | ||
TimedMotionVector3f * | loc, | ||
uint64 | loc_seqno, | ||
TimedMotionQuaternion * | orient, | ||
uint64 | orient_seqno, | ||
AggregateBoundingInfo * | bounds, | ||
uint64 | bounds_seqno, | ||
String * | mesh, | ||
uint64 | mesh_seqno, | ||
String * | phy, | ||
uint64 | phy_seqno | ||
) | [private] |
void Sirikata::HostedObject::receiveMessage | ( | const SpaceID & | space, |
const Protocol::Object::ObjectMessage * | msg | ||
) |
Receive an ObjectMessage from the space via the ObjectHost.
Translate it to our runtime ODP structure and deliver it.
References Sirikata::ODP::DelegateService::deliver(), Sirikata::Logging::detailed, HO_LOG, mDelegateODPService, SILOG, and stopped().
void Sirikata::HostedObject::registerDefaultODPHandler | ( | const ODP::Service::MessageHandler & | cb | ) | [virtual] |
void Sirikata::HostedObject::requestBoundsUpdate | ( | const SpaceID & | space, |
const ObjectReference & | oref, | ||
const BoundingSphere3f & | bounds | ||
) | [virtual] |
References updateLocUpdateRequest().
void Sirikata::HostedObject::requestLocationUpdate | ( | const SpaceID & | space, |
const ObjectReference & | oref, | ||
const TimedMotionVector3f & | loc | ||
) | [virtual] |
References updateLocUpdateRequest().
void Sirikata::HostedObject::requestMeshUpdate | ( | const SpaceID & | space, |
const ObjectReference & | oref, | ||
const String & | mesh | ||
) | [virtual] |
References updateLocUpdateRequest().
void Sirikata::HostedObject::requestOrientationUpdate | ( | const SpaceID & | space, |
const ObjectReference & | oref, | ||
const TimedMotionQuaternion & | orient | ||
) | [virtual] |
References updateLocUpdateRequest().
void Sirikata::HostedObject::requestPhysicsUpdate | ( | const SpaceID & | space, |
const ObjectReference & | oref, | ||
const String & | phy | ||
) | [virtual] |
References updateLocUpdateRequest().
String Sirikata::HostedObject::requestQuery | ( | const SpaceID & | space, |
const ObjectReference & | oref | ||
) | [virtual] |
References Sirikata::Logging::error, mPresenceData, presenceDataMutex, and SILOG.
void Sirikata::HostedObject::requestQueryRemoval | ( | const SpaceID & | space, |
const ObjectReference & | oref | ||
) | [virtual] |
References requestQueryUpdate().
void Sirikata::HostedObject::requestQueryUpdate | ( | const SpaceID & | space, |
const ObjectReference & | oref, | ||
const String & | new_query | ||
) | [virtual] |
Simulation * Sirikata::HostedObject::runSimulation | ( | const SpaceObjectReference & | sporef, |
const String & | simName, | ||
Network::IOStrandPtr | simStrand | ||
) |
References Sirikata::Logging::error, Sirikata::FactoryImpl< T, Ftype >::getConstructor(), getObjectHost(), getSharedPtr(), Sirikata::ObjectHost::getSimOptions(), Sirikata::SimulationFactory::getSingleton(), HO_LOG, Sirikata::Logging::info, mContext, mObjectHost, mPresenceData, presenceDataMutex, Sirikata::PerPresenceData::sims, Sirikata::Service::start(), and stopped().
ProxyObjectPtr Sirikata::HostedObject::self | ( | const SpaceObjectReference & | sor | ) | [virtual] |
References presence().
Referenced by handleConnected(), handleConnectedIndirect(), handleProximityUpdate(), handleStreamCreated(), and iHandleDisconnected().
void Sirikata::HostedObject::sendLocUpdateRequest | ( | const SpaceID & | space, |
const ObjectReference & | oref | ||
) | [private] |
References getProxy(), Sirikata::ObjectHost::getSpaceStream(), HO_LOG, Sirikata::PerPresenceData::LOC_FIELD_BOUNDS, Sirikata::PerPresenceData::LOC_FIELD_LOC, Sirikata::PerPresenceData::LOC_FIELD_MESH, Sirikata::PerPresenceData::LOC_FIELD_NONE, Sirikata::PerPresenceData::LOC_FIELD_ORIENTATION, Sirikata::PerPresenceData::LOC_FIELD_PHYSICS, mObjectHost, mPresenceData, OBJECT_PORT_LOCATION, presenceDataMutex, Sirikata::serializePBJMessage(), spaceTime(), and Sirikata::Logging::warn.
Referenced by updateLocUpdateRequest().
References mObjectHost, and Sirikata::ObjectHost::spaceTime().
Referenced by sendLocUpdateRequest().
void Sirikata::HostedObject::start | ( | ) | [virtual] |
Implements Sirikata::Service.
void Sirikata::HostedObject::stop | ( | ) | [virtual] |
Implements Sirikata::Service.
References Sirikata::ObjectHost::getStorage(), mObjectHost, mObjectScript, Sirikata::OH::Storage::releaseBucket(), and Sirikata::ObjectScript::stop().
Referenced by ~HostedObject().
bool Sirikata::HostedObject::stopped | ( | ) | const |
References destroyed, mContext, and Sirikata::Context::stopped().
Referenced by bindODPPort(), connect(), delegateODPPortSend(), disconnectFromSpace(), initializeScript(), killSimulation(), receiveMessage(), registerDefaultODPHandler(), requestQueryUpdate(), runSimulation(), unusedODPPort(), and updateLocUpdateRequest().
ODP::PortID Sirikata::HostedObject::unusedODPPort | ( | const SpaceID & | space, |
const ObjectReference & | objref | ||
) | [virtual] |
Get a random, unused ODP port.
Implements Sirikata::ODP::Service.
References mDelegateODPService, stopped(), and Sirikata::ODP::DelegateService::unusedODPPort().
ODP::PortID Sirikata::HostedObject::unusedODPPort | ( | const SpaceObjectReference & | sor | ) | [virtual] |
Implements Sirikata::ODP::Service.
References mDelegateODPService, stopped(), and Sirikata::ODP::DelegateService::unusedODPPort().
void Sirikata::HostedObject::updateLocUpdateRequest | ( | const SpaceID & | space, |
const ObjectReference & | oref, | ||
const TimedMotionVector3f *const | loc, | ||
const TimedMotionQuaternion *const | orient, | ||
const BoundingSphere3f *const | bounds, | ||
const String *const | mesh, | ||
const String *const | phy | ||
) | [private] |
References Sirikata::Logging::detailed, HO_LOG, Sirikata::PerPresenceData::LOC_FIELD_BOUNDS, Sirikata::PerPresenceData::LOC_FIELD_LOC, Sirikata::PerPresenceData::LOC_FIELD_MESH, Sirikata::PerPresenceData::LOC_FIELD_ORIENTATION, Sirikata::PerPresenceData::LOC_FIELD_PHYSICS, mPresenceData, presenceDataMutex, Sirikata::PerPresenceData::requestLoc, sendLocUpdateRequest(), and stopped().
Referenced by requestBoundsUpdate(), requestLocationUpdate(), requestMeshUpdate(), requestOrientationUpdate(), and requestPhysicsUpdate().
friend class ::Sirikata::SelfWeakPtr< VWObject > [friend] |
friend class PerPresenceData [friend] |
Referenced by createProxy(), and handleConnectedIndirect().
const PresenceToken Sirikata::HostedObject::DEFAULT_PRESENCE_TOKEN = -1 [static] |
bool Sirikata::HostedObject::destroyed [protected] |
ObjectHostContext* Sirikata::HostedObject::mContext [protected] |
Referenced by handleProximityUpdate(), metadataDownloaded(), runSimulation(), and stopped().
Referenced by bindODPPort(), createDelegateODPPort(), HostedObject(), receiveMessage(), registerDefaultODPHandler(), unusedODPPort(), and ~HostedObject().
bool Sirikata::HostedObject::mDestroyWhenConnected [protected] |
Referenced by destroy(), and HostedObject().
const UUID Sirikata::HostedObject::mID [protected] |
Referenced by id().
AtomicValue<int> Sirikata::HostedObject::mNumOutstandingConnections [protected] |
Referenced by destroy(), and HostedObject().
ObjectHost* Sirikata::HostedObject::mObjectHost [protected] |
ObjectScript* Sirikata::HostedObject::mObjectScript [protected] |
Referenced by destroy(), initializeScript(), and stop().
PresenceDataMap Sirikata::HostedObject::mPresenceData [protected] |
Referenced by commandPresences(), createProxy(), destroy(), disconnectFromSpace(), getProxyManager(), getSpaceObjRefs(), killSimulation(), presenceLatestEpoch(), presenceRequestedLocation(), processLocationUpdate(), requestQuery(), requestQueryUpdate(), runSimulation(), sendLocUpdateRequest(), updateLocUpdateRequest(), and ~HostedObject().
Mutex Sirikata::HostedObject::notifyMutex [protected] |
Mutex Sirikata::HostedObject::presenceDataMutex [protected] |
Referenced by commandPresences(), createProxy(), destroy(), disconnectFromSpace(), getProxyManager(), getSpaceObjRefs(), killSimulation(), presenceLatestEpoch(), presenceRequestedLocation(), processLocationUpdate(), requestQuery(), requestQueryUpdate(), runSimulation(), sendLocUpdateRequest(), updateLocUpdateRequest(), and ~HostedObject().