GestureRecognitionToolkit  Version: 0.2.5
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
Gate.h
1 /*
2  GRT MIT License
3  Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
4 
5  Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6  and associated documentation files (the "Software"), to deal in the Software without restriction,
7  including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
9  subject to the following conditions:
10 
11  The above copyright notice and this permission notice shall be included in all copies or substantial
12  portions of the Software.
13 
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15  LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 #ifndef GRT_GATE_HEADER
22 #define GRT_GATE_HEADER
23 
24 #include "../Util/GRTCommon.h"
25 #include "../CoreModules/Context.h"
26 
27 GRT_BEGIN_NAMESPACE
28 
29 class GRT_API Gate : public Context{
30 public:
36  Gate(const bool gateOpen=true);
37 
45  Gate(const Gate &rhs);
46 
50  virtual ~Gate();
51 
58  Gate& operator=(const Gate &rhs);
59 
68  virtual bool deepCopyFrom(const Context *context);
69 
70  virtual bool process(VectorDouble inputVector);
71  virtual bool reset();
72 
73  bool updateContext(bool value){
74  gateOpen = value;
75  okToContinue = value;
76  return true;
77  }
78 
79  //Setters
80  void setGateStatus(bool gateOpen){ this->gateOpen = gateOpen; }
81 
82  //Getters
83  bool getGateStatus(){ return gateOpen; }
84 
90  static std::string getId();
91 
92 protected:
93  bool gateOpen;
94 
95 private:
96  static const std::string id;
97  static RegisterContextModule< Gate > registerModule;
98 };
99 
100 GRT_END_NAMESPACE
101 
102 #endif //GRT_GATE_HEADER
virtual bool reset() override
Definition: Context.h:85
std::string getId() const
Definition: GRTBase.cpp:85
Definition: Gate.h:29