8 #ifndef META_OCEAN_INTERACTION_JS_DEVICE_H
9 #define META_OCEAN_INTERACTION_JS_DEVICE_H
This class manages the lifetime of an event subscription for sample events.
Definition: Measurement.h:154
unsigned int ObjectId
Definition of an object id.
Definition: Measurement.h:46
std::unordered_set< ObjectId > ObjectIdSet
Definition of an unordered set holding object ids.
Definition: Measurement.h:56
This class manages the lifetime of an event subscription for tracker object events.
Definition: devices/Tracker.h:141
This class implements the base class for all tracker devices.
Definition: devices/Tracker.h:39
This class is a lightweight helper class for device objects to allow event callback handling.
Definition: JSDevice.h:35
JSDevice(const Devices::DeviceRef &device)
Creates a new device helper object.
JSDevice & operator=(const JSDevice &device)=delete
Disabled copy operator.
Devices::Tracker::TrackerObjectEventSubscription trackerObjectEventSubscription_
Tracker object event subscription id.
Definition: JSDevice.h:136
std::string foundObjectEventFunctionName_
JavaScript function name for found object events.
Definition: JSDevice.h:142
Devices::DeviceRef device_
Internal device object.
Definition: JSDevice.h:130
~JSDevice()
Destructs a device helper object.
void setDevice(const Devices::DeviceRef &device)
Sets the internal device object.
std::string sampleEventFunctionName_
JavaScript function name for sample events.
Definition: JSDevice.h:139
JSDevice()
Creates a new device helper object.
void release()
Releases all event subscriptions.
void setLostObjectEventFunction(v8::Local< v8::Function > function)
Sets the JavaScript function for lost object events.
void onObjectEvent(const Devices::Tracker *tracker, const bool found, const Devices::Tracker::ObjectIdSet &objectIds, const Timestamp ×tamp)
Callback function for tracker object events.
const Devices::DeviceRef & device() const
Returns the internal device object.
Definition: JSDevice.h:151
JSDevice & operator=(JSDevice &&jsDevice)
Move operator.
JSDevice(const JSDevice &device)=delete
Disabled copy constructor.
Devices::Tracker::SampleEventSubscription sampleEventSubscription_
Sample event subscription id.
Definition: JSDevice.h:133
std::weak_ptr< JSContext > ownerContext_
The context owning this device.
Definition: JSDevice.h:148
JSDevice(JSDevice &&jsDevice)
Move constructor.
void setFoundObjectEventFunction(v8::Local< v8::Function > function)
Sets the JavaScript function for found object events.
static std::vector< v8::Handle< v8::Value > > parameter(const Devices::Tracker::ObjectId object, const Timestamp timestamp)
Creates JavaScript parameters of one given values.
std::string lostObjectEventFunctionName_
Definition: JSDevice.h:145
This class implements a timestamp.
Definition: Timestamp.h:36
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15