Sirikata
Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes
Sirikata::JS::EmersonScript Class Reference

#include <EmersonScript.hpp>

Inheritance diagram for Sirikata::JS::EmersonScript:
Collaboration diagram for Sirikata::JS::EmersonScript:

List of all members.

Public Member Functions

 EmersonScript (HostedObjectPtr ho, const String &args, const String &script, JSObjectScriptManager *jMan, JSCtx *ctx)
virtual ~EmersonScript ()
virtual void start ()
virtual void stop ()
virtual void onConnected (SessionEventProviderPtr from, const SpaceObjectReference &name, HostedObject::PresenceToken token)
 Invoked upon connection.
virtual void onDisconnected (SessionEventProviderPtr from, const SpaceObjectReference &name)
 Invoked upon disconnection.
void requestDisconnect (JSPresenceStruct *jspres)
Time getHostedTime ()
virtual void notifyProximateGone (ProxyObjectPtr proximateObject, const SpaceObjectReference &querier)
virtual void notifyProximate (ProxyObjectPtr proximateObject, const SpaceObjectReference &querier)
virtual bool handleScriptCommRead (const SpaceObjectReference &src, const SpaceObjectReference &dst, const std::string &payload)
void handleScriptCommUnreliable (const ODP::Endpoint &src, const ODP::Endpoint &dst, MemoryReference payload)
 Callback for unreliable messages.
boost::any invokeInvokable (std::vector< boost::any > &params, v8::Persistent< v8::Function > function_)
void invokeCallbackInContext (Liveness::Token alive, v8::Persistent< v8::Function > cb, JSContextStruct *jscontext)
void handlePresCallback (v8::Handle< v8::Function > funcToCall, JSContextStruct *jscont, JSPresenceStruct *jspres)
v8::Handle< v8::Value > restorePresence (PresStructRestoreParams &psrp, JSContextStruct *jsctx)
void fireProxEvent (const SpaceObjectReference &localPresSporef, JSVisibleStruct *jsvis, JSContextStruct *jscont, bool isGone)
bool valid () const
 Returns true if this script is valid, i.e.
void killOtherPresences (JSPresVec &jspresVec)
 This function runs through the entire list of presences associated with this JSObjectScript, and then frees those that are not part of that vector.
v8::Handle< v8::Value > killEntity (JSContextStruct *jscont)
void sendMessageToEntityUnreliable (const SpaceObjectReference &receiver, const SpaceObjectReference &from, const std::string &msgBody)
 Sends a message over the odp port from local presence that has sporef from to some other presence in world with sporef receiver.
v8::Local< v8::Object > presToVis (JSPresenceStruct *jspres, JSContextStruct *jscont)
v8::Handle< v8::Value > create_event (v8::Persistent< v8::Function > &cb, JSContextStruct *jscont)
v8::Handle< v8::Value > create_timeout (double period, v8::Persistent< v8::Function > &cb, JSContextStruct *jscont)
 Set a timeout with a callback.
v8::Handle< v8::Value > create_timeout (double period, v8::Persistent< v8::Function > &cb, uint32 contID, double timeRemaining, bool isSuspended, bool isCleared, JSContextStruct *jscont)
void registerFixupSuspendable (JSSuspendable *jssuspendable, uint32 contID)
void create_entity (EntityCreateInfo &eci)
 create a new entity at the run time
virtual void registerContextForClear (JSContextStruct *jscont)
v8::Local< v8::Object > createVisibleWeakPersistent (const SpaceObjectReference &presID, const SpaceObjectReference &visibleObj, JSVisibleDataPtr addParams)
 Creates a JSVisibleStruct and wraps it in a persistent v8 object that is returned.
v8::Local< v8::Object > createVisibleWeakPersistent (const SpaceObjectReference &visibleObj, JSVisibleDataPtr addParams)
void setLocation (const SpaceObjectReference sporef, const TimedMotionVector3f &loc)
void setOrientation (const SpaceObjectReference sporef, const TimedMotionQuaternion &orient)
void setBounds (const SpaceObjectReference sporef, const BoundingSphere3f &bounds)
void setVisual (const SpaceObjectReference sporef, const std::string &newMeshString)
String getQuery (const SpaceObjectReference &sporef) const
void setQueryFunction (const SpaceObjectReference sporef, const String &query)
void setPhysicsFunction (const SpaceObjectReference sporef, const String &newPhysicsString)
v8::Handle< v8::Value > findVisible (const SpaceObjectReference &proximateObj)
v8::Local< v8::Object > wrapPresence (JSPresenceStruct *presToWrap, v8::Persistent< v8::Context > *ctxToWrapIn)
Sirikata::JS::JSInvokableObject::JSInvokableObjectIntrunSimulation (const SpaceObjectReference &sporef, const String &simname)
v8::Handle< v8::Value > requestReset (JSContextStruct *jscont, const std::map< SpaceObjectReference, std::vector< SpaceObjectReference > > &proxSetVis)
void deletePres (JSPresenceStruct *toDelete)
 Timers and context suspendables are killed and deleted in contexts.
void resetPresence (JSPresenceStruct *jspresStruct)
 This function adds jspresStruct to mPresences map.
JSObjectScriptManagermanager () const
JSContextStructrootContext () const
EmersonHttpPtr getEmersonHttpPtr ()
 Contexts are allowed to initiate http requests.
v8::Handle< v8::Value > sendSandbox (const String &msgToSend, uint32 senderID, uint32 receiverID)
 msgToSend contains a serialized v8 object that will be sent from sandbox with id sendingSandbox to sandbox with id receivingSandbox.
virtual void postCallbackChecks ()

Public Attributes

JSVisibleManager jsVisMan
HostedObjectPtr mParent

Private Types

typedef std::map
< SpaceObjectReference,
ODP::Port * > 
MessagingPortMap
typedef std::map
< SpaceObjectReference,
JSPresenceStruct * > 
PresenceMap
typedef PresenceMap::iterator PresenceMapIter
typedef std::vector
< JSPresenceStruct * > 
PresenceVec
typedef std::vector< std::pair
< String, SpaceObjectReference > > 
SimVec

Private Member Functions

void postDestroy (Liveness::Token alive)
void unsubscribePresenceEvents (const SpaceObjectReference &name)
void removePresenceData (const SpaceObjectReference &sporefToDelete)
v8::Local< v8::Object > createVisibleWeakPersistent (JSVisibleStruct *jsvis)
void killScript ()
void resetScript ()
bool handleScriptCommRead (const SpaceObjectReference &src, const SpaceObjectReference &dst, Sirikata::JS::Protocol::JSMessage js_msg)
HostedObject::PresenceToken incrementPresenceToken ()
void printStackFrame (std::stringstream &, v8::Local< v8::StackFrame >)
JSPresenceStructaddConnectedPresence (const SpaceObjectReference &sporef, HostedObject::PresenceToken token)
void processSandboxMessage (String msgToSend, uint32 senderID, uint32 receiverID, Liveness::Token alive)
 Tries to decode string as a v8 object.
void finishContextClear (JSContextStruct *jscont)
 Removes jscont from context map and tells it to finish its clear methods.
JSPresenceStructfindPresence (const SpaceObjectReference &sporef)
void callbackUnconnected (ProxyObjectPtr proxy, HostedObject::PresenceToken token)
void iOnDisconnected (SessionEventProviderPtr from, const SpaceObjectReference &name, Liveness::Token alive)
void eCreateEntityFinish (ObjectHost *oh, EntityCreateInfo &eci)
void iStop (Liveness::Token alive, bool letDie)
void iHandleScriptCommRead (const SpaceObjectReference &src, const SpaceObjectReference &dst, const String &payload, Liveness::Token alive)
void iHandleScriptCommUnreliable (const ODP::Endpoint &src, const ODP::Endpoint &dst, MemoryReference payload, Liveness::Token alive)
void mainStrandCompletePresConnect (Location newLoc, BoundingSphere3f bs, PresStructRestoreParams psrp, HostedObject::PresenceToken presToke, Liveness::Token alive)
void iNotifyProximateGone (ProxyObjectPtr proximateObject, const SpaceObjectReference &querier, Liveness::Token alive)
void iResetProximateHelper (JSVisibleStruct *proxVis, const SpaceObjectReference &proxTo)
void iNotifyProximate (ProxyObjectPtr proximateObject, const SpaceObjectReference &querier, Liveness::Token alive)
void iOnConnected (SessionEventProviderPtr from, const SpaceObjectReference &name, HostedObject::PresenceToken token, bool duringInit, Liveness::Token alive)
void iInvokeInvokable (std::vector< boost::any > &params, v8::Persistent< v8::Function > function_, Liveness::Token alive)

Private Attributes

bool mHandlingEvent
bool mResetting
bool mKilling
MessagingPortMap mMessagingPortMap
HostedObject::PresenceToken presenceToken
PresenceMap mPresences
std::map< SpaceObjectReference,
std::vector< JSVisibleStruct * > > 
resettingVisiblesResultSet
 When we are resetting, we want to replay all the visibles that presences had received in their prox result set.
PresenceVec mUnconnectedPresences
std::vector< JSContextStruct * > contextsToClear
EmersonHttpPtr emHttpPtr
SimVec mSimulations

Member Typedef Documentation

typedef PresenceMap::iterator Sirikata::JS::EmersonScript::PresenceMapIter [private]
typedef std::vector< std::pair<String,SpaceObjectReference> > Sirikata::JS::EmersonScript::SimVec [private]

Constructor & Destructor Documentation

Sirikata::JS::EmersonScript::EmersonScript ( HostedObjectPtr  ho,
const String &  args,
const String &  script,
JSObjectScriptManager jMan,
JSCtx ctx 
)
Sirikata::JS::EmersonScript::~EmersonScript ( ) [virtual]

Member Function Documentation

JSPresenceStruct * Sirikata::JS::EmersonScript::addConnectedPresence ( const SpaceObjectReference sporef,
HostedObject::PresenceToken  token 
) [private]
void Sirikata::JS::EmersonScript::callbackUnconnected ( ProxyObjectPtr  proxy,
HostedObject::PresenceToken  token 
) [private]
void Sirikata::JS::EmersonScript::create_entity ( EntityCreateInfo eci)
v8::Handle< v8::Value > Sirikata::JS::EmersonScript::create_event ( v8::Persistent< v8::Function > &  cb,
JSContextStruct jscont 
)

lkjs; FIXME: what happens if jscont gets deleted before invokeCallbackInContext is called; or suspended in between; probably should pass context id through invokeCallbackInContext;

References EMERSCRIPT_SERIAL_CHECK, invokeCallbackInContext(), JSLOG, Sirikata::Liveness::livenessToken(), Sirikata::JS::JSObjectScript::mCtx, mParent, Sirikata::JS::JSCtx::objStrand, and Sirikata::Logging::warn.

v8::Handle< v8::Value > Sirikata::JS::EmersonScript::create_timeout ( double  period,
v8::Persistent< v8::Function > &  cb,
JSContextStruct jscont 
)

Set a timeout with a callback.

References EMERSCRIPT_SERIAL_CHECK, and Sirikata::JS::JSContextStruct::getContextID().

v8::Handle< v8::Value > Sirikata::JS::EmersonScript::create_timeout ( double  period,
v8::Persistent< v8::Function > &  cb,
uint32  contID,
double  timeRemaining,
bool  isSuspended,
bool  isCleared,
JSContextStruct jscont 
)
v8::Local< v8::Object > Sirikata::JS::EmersonScript::createVisibleWeakPersistent ( const SpaceObjectReference presID,
const SpaceObjectReference visibleObj,
JSVisibleDataPtr  addParams 
)

Creates a JSVisibleStruct and wraps it in a persistent v8 object that is returned.

Parameters:
{SpaceObjectReference}visibleObj Will make a JSVisibleStruct out of this spaceobjectreference.
{JSVisibleDataPtr}addParams If don't have a proxy object in the world with sporef visibleObj, will try to fill in JSVisibleStruct data with these values (note: if NULL), fills in default values.

Referenced by createVisibleWeakPersistent(), Sirikata::JS::JSSerializer::deserializeObjectInternal(), findVisible(), fireProxEvent(), iHandleScriptCommRead(), and presToVis().

v8::Local< v8::Object > Sirikata::JS::EmersonScript::createVisibleWeakPersistent ( JSVisibleStruct jsvis) [private]
v8::Local< v8::Object > Sirikata::JS::EmersonScript::createVisibleWeakPersistent ( const SpaceObjectReference visibleObj,
JSVisibleDataPtr  addParams 
)
void Sirikata::JS::EmersonScript::deletePres ( JSPresenceStruct toDelete)

Timers and context suspendables are killed and deleted in contexts.

However, presences are also stored in EmersonScript, and EmersonScript must be told to kill them and remove them.

And JSPresences, we need to remove from our list of presences and ask hosted object to remove it.

References EMERSCRIPT_SERIAL_CHECK, Sirikata::JS::JSPresenceStruct::getIsConnected(), Sirikata::JS::JSPositionListener::getSporef(), mParent, mUnconnectedPresences, Sirikata::SpaceObjectReference::object(), removePresenceData(), and Sirikata::SpaceObjectReference::space().

Referenced by Sirikata::JS::JSContextStruct::struct_deregisterSuspendable().

void Sirikata::JS::EmersonScript::eCreateEntityFinish ( ObjectHost oh,
EntityCreateInfo eci 
) [private]
JSPresenceStruct* Sirikata::JS::EmersonScript::findPresence ( const SpaceObjectReference sporef) [private]
v8::Handle< v8::Value > Sirikata::JS::EmersonScript::findVisible ( const SpaceObjectReference proximateObj)
void Sirikata::JS::EmersonScript::finishContextClear ( JSContextStruct jscont) [private]

Removes jscont from context map and tells it to finish its clear methods.

References EMERSCRIPT_SERIAL_CHECK, Sirikata::JS::JSContextStruct::finishClear(), and Sirikata::JS::JSObjectScript::mContStructMap.

Referenced by iHandleScriptCommRead(), and registerContextForClear().

void Sirikata::JS::EmersonScript::fireProxEvent ( const SpaceObjectReference localPresSporef,
JSVisibleStruct jsvis,
JSContextStruct jscont,
bool  isGone 
)
Parameters:
{sporef}localPresSporef The space object reference for the local presence for which a visible has either moved into its prox set or out of its prox set.
{JSVisibleStruct*}jsvis The visible struct associated with the presence that moved into or out of local presence's prox set.
bool}isGone True if trying to fire a proximity removal event, false if trying to fire a proximity added event.

Enters context associated with jscontextStruct, and fires either its onProxAdded or onProxRemoved callback function.

References createVisibleWeakPersistent(), Sirikata::Logging::detailed, EMERSCRIPT_SERIAL_CHECK, Sirikata::JS::JSObjectScript::invokeCallback(), JSLOG, Sirikata::JS::JSContextStruct::mContext, Sirikata::JS::JSObjectScript::mEvalContextStack, postCallbackChecks(), Sirikata::JS::printException(), Sirikata::JS::JSContextStruct::proxAddedFunc, Sirikata::JS::JSContextStruct::proxRemovedFunc, and Sirikata::SpaceObjectReference::toString().

EmersonHttpPtr Sirikata::JS::EmersonScript::getEmersonHttpPtr ( ) [inline]

Contexts are allowed to initiate http requests.

To do so, they should get a copy of each EmersonScript's httpPtr and make requests directly from there. Similarly, in contexts' destructors, they should also notify emHttpPtr that the context was destroyed.

References emHttpPtr.

Referenced by Sirikata::JS::JSContextStruct::finishClear(), and Sirikata::JS::JSContextStruct::httpRequest().

Time Sirikata::JS::EmersonScript::getHostedTime ( )
String Sirikata::JS::EmersonScript::getQuery ( const SpaceObjectReference sporef) const
void Sirikata::JS::EmersonScript::handlePresCallback ( v8::Handle< v8::Function >  funcToCall,
JSContextStruct jscont,
JSPresenceStruct jspres 
)
virtual bool Sirikata::JS::EmersonScript::handleScriptCommRead ( const SpaceObjectReference src,
const SpaceObjectReference dst,
const std::string &  payload 
) [virtual]
bool Sirikata::JS::EmersonScript::handleScriptCommRead ( const SpaceObjectReference src,
const SpaceObjectReference dst,
Sirikata::JS::Protocol::JSMessage  js_msg 
) [private]
void Sirikata::JS::EmersonScript::handleScriptCommUnreliable ( const ODP::Endpoint src,
const ODP::Endpoint dst,
MemoryReference  payload 
)

Callback for unreliable messages.

Used for unreliable messages.

Payload should be able to be parsed into JS::Proctocol::JSMessage. If it can be, and deserialization is successful, processes the scripting message. (via deserializeMsgAndDispatch.)

References iHandleScriptCommUnreliable(), Sirikata::JS::JSObjectScript::isStopped(), JSLOG, Sirikata::Liveness::livenessToken(), Sirikata::JS::JSObjectScript::mCtx, Sirikata::JS::JSCtx::objStrand, and Sirikata::Logging::warn.

Referenced by iOnConnected().

void Sirikata::JS::EmersonScript::iHandleScriptCommRead ( const SpaceObjectReference src,
const SpaceObjectReference dst,
const String &  payload,
Liveness::Token  alive 
) [private]
void Sirikata::JS::EmersonScript::iHandleScriptCommUnreliable ( const ODP::Endpoint src,
const ODP::Endpoint dst,
MemoryReference  payload,
Liveness::Token  alive 
) [private]
void Sirikata::JS::EmersonScript::iInvokeInvokable ( std::vector< boost::any > &  params,
v8::Persistent< v8::Function >  function_,
Liveness::Token  alive 
) [private]
HostedObject::PresenceToken Sirikata::JS::EmersonScript::incrementPresenceToken ( ) [private]
void Sirikata::JS::EmersonScript::iNotifyProximate ( ProxyObjectPtr  proximateObject,
const SpaceObjectReference querier,
Liveness::Token  alive 
) [private]
void Sirikata::JS::EmersonScript::iNotifyProximateGone ( ProxyObjectPtr  proximateObject,
const SpaceObjectReference querier,
Liveness::Token  alive 
) [private]
void Sirikata::JS::EmersonScript::invokeCallbackInContext ( Liveness::Token  alive,
v8::Persistent< v8::Function >  cb,
JSContextStruct jscontext 
)
boost::any Sirikata::JS::EmersonScript::invokeInvokable ( std::vector< boost::any > &  params,
v8::Persistent< v8::Function >  function_ 
)
void Sirikata::JS::EmersonScript::iOnConnected ( SessionEventProviderPtr  from,
const SpaceObjectReference name,
HostedObject::PresenceToken  token,
bool  duringInit,
Liveness::Token  alive 
) [private]
void Sirikata::JS::EmersonScript::iOnDisconnected ( SessionEventProviderPtr  from,
const SpaceObjectReference name,
Liveness::Token  alive 
) [private]
void Sirikata::JS::EmersonScript::iResetProximateHelper ( JSVisibleStruct proxVis,
const SpaceObjectReference proxTo 
) [private]
void Sirikata::JS::EmersonScript::iStop ( Liveness::Token  alive,
bool  letDie 
) [private]
v8::Handle< v8::Value > Sirikata::JS::EmersonScript::killEntity ( JSContextStruct jscont)
void Sirikata::JS::EmersonScript::killOtherPresences ( JSPresVec jspresVec)

This function runs through the entire list of presences associated with this JSObjectScript, and then frees those that are not part of that vector.

void Sirikata::JS::EmersonScript::killScript ( ) [private]
void Sirikata::JS::EmersonScript::mainStrandCompletePresConnect ( Location  newLoc,
BoundingSphere3f  bs,
PresStructRestoreParams  psrp,
HostedObject::PresenceToken  presToke,
Liveness::Token  alive 
) [private]
JSObjectScriptManager* Sirikata::JS::EmersonScript::manager ( ) const [inline]
void Sirikata::JS::EmersonScript::notifyProximate ( ProxyObjectPtr  proximateObject,
const SpaceObjectReference querier 
) [virtual]
void Sirikata::JS::EmersonScript::notifyProximateGone ( ProxyObjectPtr  proximateObject,
const SpaceObjectReference querier 
) [virtual]
void Sirikata::JS::EmersonScript::onConnected ( SessionEventProviderPtr  from,
const SpaceObjectReference name,
HostedObject::PresenceToken  token 
) [virtual]

Invoked upon connection.

Parameters:
fromthe SessionEventProvider the event originates from
namethe name of the object in the space

Reimplemented from Sirikata::SessionEventListener.

References iOnConnected(), Sirikata::Liveness::livenessToken(), Sirikata::JS::JSObjectScript::mCtx, and Sirikata::JS::JSCtx::objStrand.

void Sirikata::JS::EmersonScript::onDisconnected ( SessionEventProviderPtr  from,
const SpaceObjectReference name 
) [virtual]

Invoked upon disconnection.

Parameters:
fromthe SessionEventProvider the event originates from
namethe name of the object in the space

Reimplemented from Sirikata::SessionEventListener.

References iOnDisconnected(), Sirikata::Liveness::livenessToken(), Sirikata::JS::JSObjectScript::mCtx, and Sirikata::JS::JSCtx::objStrand.

void Sirikata::JS::EmersonScript::postCallbackChecks ( ) [virtual]
void Sirikata::JS::EmersonScript::postDestroy ( Liveness::Token  alive) [private]

References mParent.

Referenced by killScript().

v8::Local< v8::Object > Sirikata::JS::EmersonScript::presToVis ( JSPresenceStruct jspres,
JSContextStruct jscont 
)
void Sirikata::JS::EmersonScript::printStackFrame ( std::stringstream &  ,
v8::Local< v8::StackFrame >   
) [private]

Reimplemented from Sirikata::JS::JSObjectScript.

void Sirikata::JS::EmersonScript::processSandboxMessage ( String  msgToSend,
uint32  senderID,
uint32  receiverID,
Liveness::Token  alive 
) [private]
void Sirikata::JS::EmersonScript::registerContextForClear ( JSContextStruct jscont) [virtual]
void Sirikata::JS::EmersonScript::registerFixupSuspendable ( JSSuspendable jssuspendable,
uint32  contID 
)
void Sirikata::JS::EmersonScript::removePresenceData ( const SpaceObjectReference sporefToDelete) [private]
void Sirikata::JS::EmersonScript::requestDisconnect ( JSPresenceStruct jspres)
v8::Handle< v8::Value > Sirikata::JS::EmersonScript::requestReset ( JSContextStruct jscont,
const std::map< SpaceObjectReference, std::vector< SpaceObjectReference > > &  proxSetVis 
)
Parameters:
{JSContextStruct}jscont: just checks to ensure that jscont is root sandbox before calling reset. (Otherwise, throws error.)
proxSetVis: When we reset, we want to be able to replay all the visibles in an entity's prox result set. The key of this map is the visible whose prox set is contained in the value of the map (ie in the vector).

References Sirikata::JS::JSVisibleManager::createVisStruct(), EMERSCRIPT_SERIAL_CHECK, jsVisMan, Sirikata::JS::JSObjectScript::mContext, mResetting, and resettingVisiblesResultSet.

void Sirikata::JS::EmersonScript::resetPresence ( JSPresenceStruct jspresStruct)

This function adds jspresStruct to mPresences map.

Then, calls the onPresence added function.

References EMERSCRIPT_SERIAL_CHECK, Sirikata::JS::JSPositionListener::getSporef(), and mPresences.

void Sirikata::JS::EmersonScript::resetScript ( ) [private]
v8::Handle< v8::Value > Sirikata::JS::EmersonScript::restorePresence ( PresStructRestoreParams psrp,
JSContextStruct jsctx 
)
JSContextStruct* Sirikata::JS::EmersonScript::rootContext ( ) const [inline]
JSInvokableObject::JSInvokableObjectInt * Sirikata::JS::EmersonScript::runSimulation ( const SpaceObjectReference sporef,
const String &  simname 
)
void Sirikata::JS::EmersonScript::sendMessageToEntityUnreliable ( const SpaceObjectReference receiver,
const SpaceObjectReference from,
const std::string &  msgBody 
)

Sends a message over the odp port from local presence that has sporef from to some other presence in world with sporef receiver.

Gets port to send over as value of mMessagingPortMap associated with key from.

References EMERSCRIPT_SERIAL_CHECK, EMERSON_UNRELIABLE_COMMUNICATION_PORT, Sirikata::Logging::error, JSLOG, mMessagingPortMap, Sirikata::SpaceObjectReference::object(), and Sirikata::SpaceObjectReference::space().

v8::Handle< v8::Value > Sirikata::JS::EmersonScript::sendSandbox ( const String &  msgToSend,
uint32  senderID,
uint32  receiverID 
)

msgToSend contains a serialized v8 object that will be sent from sandbox with id sendingSandbox to sandbox with id receivingSandbox.

Posts dow into processSandboxMessage, which actually dispatches the message in the correct context.

Returns undefined.

References EMERSCRIPT_SERIAL_CHECK, Sirikata::Liveness::livenessToken(), Sirikata::JS::JSObjectScript::mCtx, Sirikata::JS::JSCtx::objStrand, and processSandboxMessage().

void Sirikata::JS::EmersonScript::setBounds ( const SpaceObjectReference  sporef,
const BoundingSphere3f &  bounds 
)
void Sirikata::JS::EmersonScript::setLocation ( const SpaceObjectReference  sporef,
const TimedMotionVector3f loc 
)
void Sirikata::JS::EmersonScript::setOrientation ( const SpaceObjectReference  sporef,
const TimedMotionQuaternion orient 
)
void Sirikata::JS::EmersonScript::setPhysicsFunction ( const SpaceObjectReference  sporef,
const String &  newPhysicsString 
)
void Sirikata::JS::EmersonScript::setQueryFunction ( const SpaceObjectReference  sporef,
const String &  query 
)
void Sirikata::JS::EmersonScript::setVisual ( const SpaceObjectReference  sporef,
const std::string &  newMeshString 
)
void Sirikata::JS::EmersonScript::start ( ) [virtual]

Reimplemented from Sirikata::JS::JSObjectScript.

void Sirikata::JS::EmersonScript::stop ( ) [virtual]
void Sirikata::JS::EmersonScript::unsubscribePresenceEvents ( const SpaceObjectReference name) [private]
bool Sirikata::JS::EmersonScript::valid ( ) const

Returns true if this script is valid, i.e.

if it was successfully loaded and initialized.

References mParent.

Referenced by Sirikata::JS::JSObjectScriptManager::createObjectScript().

v8::Local< v8::Object > Sirikata::JS::EmersonScript::wrapPresence ( JSPresenceStruct presToWrap,
v8::Persistent< v8::Context > *  ctxToWrapIn 
)

Member Data Documentation

Referenced by getEmersonHttpPtr().

Referenced by killEntity(), and postCallbackChecks().

Referenced by iStop(), and runSimulation().

Referenced by incrementPresenceToken().

When we are resetting, we want to replay all the visibles that presences had received in their prox result set.

This map temporarily holds a list of these visibles (fills in requestReset, empties in resetScript). Index of map corresponds to presence whose prox set value is associated with.

Note: visibleManager class takes care of deleting memory allocated for JSVisibleStructs.

Referenced by requestReset(), and resetScript().


The documentation for this class was generated from the following files: