MIRA
Module.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) by
3  * MetraLabs GmbH (MLAB), GERMANY
4  * and
5  * Neuroinformatics and Cognitive Robotics Labs (NICR) at TU Ilmenau, GERMANY
6  * All rights reserved.
7  *
8  * Redistribution and modification of this code is strictly prohibited.
9  *
10  * IN NO EVENT SHALL "MLAB" OR "NICR" BE LIABLE TO ANY PARTY FOR DIRECT,
11  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
12  * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLAB" OR
13  * "NICR" HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14  *
15  * "MLAB" AND "NICR" SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
16  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18  * ON AN "AS IS" BASIS, AND "MLAB" AND "NICR" HAVE NO OBLIGATION TO
19  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
20  */
21 
30 #ifndef _MIRA_PILOT_MODULE_H_
31 #define _MIRA_PILOT_MODULE_H_
32 
33 #include <factory/Factory.h>
34 #include <fw/Framework.h>
35 
36 namespace mira { namespace pilot {
37 
38 class Pilot;
40 
41 class Module : public Object, public Authority
42 {
43 MIRA_OBJECT(Module);
44 public:
45 
46  Module();
47  virtual ~Module();
48 
50  template<typename Reflector>
51  void reflect(Reflector& r)
52  {
53  r.member("ItemName", mItemName,
54  "An optional name that can be used to identify this item, e.g."
55  "when displayed in property editor (default=class name)",
56  this->getClass().getName());
57  }
58 
59  void pauseModule();
60  void resumeModule();
61 
62 public:
63 
64  void initialize(Pilot* pilot);
65  virtual void initialize() {}
66  virtual void pause() {}
67  virtual void resume() {}
68 
69  Pilot* getPilot() { return mPilot; }
70  const std::string& getItemName() const { return mItemName; }
71 
72 private:
73  Pilot* mPilot;
74  std::string mItemName;
75 };
76 
78 
79 } } // namespace
80 
81 #endif
const std::string & getItemName() const
Definition: Module.h:70
Definition: Pilot.h:55
virtual void resume()
Definition: Module.h:67
Pilot * getPilot()
Definition: Module.h:69
std::string getName() const
Definition: Module.h:41
virtual void pause()
Definition: Module.h:66
Class const & getClass() const
virtual void initialize()
Definition: Module.h:65
void reflect(Reflector &r)
Reflect method for serialization.
Definition: Module.h:51