Ocean
JSDeviceSample.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_INTERACTION_JS_DEVICE_SAMPLE_H
9 #define META_OCEAN_INTERACTION_JS_DEVICE_SAMPLE_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace Interaction
18 {
19 
20 namespace JavaScript
21 {
22 
23 /**
24  * This class implements a wrapper for a JavaScript DeviceSample object.
25  * @ingroup interactionjs
26  */
27 class OCEAN_INTERACTION_JS_EXPORT JSDeviceSample : public JSObject<JSDeviceSample, Devices::Measurement::SampleRef>
28 {
29  friend class JSObject<JSDeviceSample, Devices::Measurement::SampleRef>;
30  friend class JSLibrary;
31 
32  public:
33 
34  /**
35  * Definition of ids for individual accessors.
36  */
37  enum AccessorId : unsigned int
38  {
39  /// The accessor for the size property, a number value.
41  /// The accessor for the size property, an integer value.
42  AI_SIZE
43  };
44 
45  /**
46  * Definition of ids for individual functions.
47  */
48  enum FunctionId : unsigned int
49  {
58  FI_OBJECTS
59  };
60 
61  public:
62 
63  /**
64  * Returns the JavaScript name of this object.
65  * @return The object's JavaScript name
66  */
67  static inline const char* objectName();
68 
69  protected:
70 
71  /**
72  * Creates the function template and object template for this object.
73  */
74  static void createFunctionTemplate();
75 };
76 
77 inline const char* JSDeviceSample::objectName()
78 {
79  return "DeviceSample";
80 }
81 
82 }
83 
84 }
85 
86 }
87 
88 #endif // META_OCEAN_INTERACTION_JS_DEVICE_SAMPLE_H
This class implements a wrapper for a JavaScript DeviceSample object.
Definition: JSDeviceSample.h:28
static const char * objectName()
Returns the JavaScript name of this object.
Definition: JSDeviceSample.h:77
AccessorId
Definition of ids for individual accessors.
Definition: JSDeviceSample.h:38
@ AI_TIMESTAMP
The accessor for the size property, a number value.
Definition: JSDeviceSample.h:40
static void createFunctionTemplate()
Creates the function template and object template for this object.
FunctionId
Definition of ids for individual functions.
Definition: JSDeviceSample.h:49
@ FI_IS_DEVICE_IN_OBJECT
Definition: JSDeviceSample.h:50
@ FI_IS_OBJECT_IN_DEVICE
Definition: JSDeviceSample.h:51
@ FI_IS_VALID
Definition: JSDeviceSample.h:52
@ FI_IS_INVALID
Definition: JSDeviceSample.h:53
@ FI_HAS_OBJECT
Definition: JSDeviceSample.h:54
@ FI_ORIENTATION
Definition: JSDeviceSample.h:56
@ FI_TRANSFORMATION
Definition: JSDeviceSample.h:57
@ FI_POSITION
Definition: JSDeviceSample.h:55
This class implements the java script interaction library object.
Definition: JSLibrary.h:32
This class implements the base class for all native wrapper of JavaScript objects.
Definition: JSObject.h:31
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15