SCENE C++ API  2.0.22
lssensorevent.h
1 #pragma once
2 
3 #include <core_api/lsglobaldefinitions.h>
4 #include <core_api/lsevent.h>
5 #include <core_api/ref_ptr.h>
6 
7 #include <memory>
8 
9 namespace SCENE_API {
10 
11 // Forward declarations
12 class LSSensor;
13 
16 template<typename T>
17 class LSSensorEvent : public LSInterface, public LSEvent
18 {
19  LS_UNCOPYABLE(LSSensorEvent)
20 
21 public:
24  T& getData();
25 
26 protected:
27  LS_INTERFACE_TEMPLATE(LSSensorEvent, T, LSInterface)
28 };
29 
30 template<>
31 class LSSensorEvent<void> : public LSInterface, public LSEvent
32 {
33  LS_UNCOPYABLE(LSSensorEvent)
34 
35 protected:
36  LS_INTERFACE_TEMPLATE(LSSensorEvent, void, LSInterface)
37 };
38 
41 template<typename T>
42 class LSFrameEvent : public LSSensorEvent<T>
43 {
44  LS_UNCOPYABLE(LSFrameEvent)
45 
46 public:
49  int getFrameId() const;
50 
51 protected:
52  LS_INTERFACE_TEMPLATE2(LSFrameEvent, T, LSSensorEvent)
53 };
54 
55 #define SENSOR_SIGNAL(...) LSSignal<ref_ptr<LSSensorEvent<__VA_ARGS__>>>
56 #define FRAME_SIGNAL(...) LSSignal<ref_ptr<LSFrameEvent<__VA_ARGS__>>>
57 
58 }