UniSet  2.6.0
PassiveObject.h
1 /*
2  * Copyright (c) 2015 Pavel Vainerman.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation, version 2.1.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Lesser Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 // --------------------------------------------------------------------------
20 // -------------------------------------------------------------------------
21 #ifndef PassiveObject_H_
22 #define PassiveObject_H_
23 // -------------------------------------------------------------------------
24 
25 #include <string>
26 #include "UniSetTypes.h"
27 #include "MessageType.h"
28 #include "ProxyManager.h"
29 // -------------------------------------------------------------------------
30 namespace uniset
31 {
32 
39  {
40  public:
41  PassiveObject();
44  virtual ~PassiveObject();
45 
46  virtual void processingMessage( const uniset::VoidMessage* msg );
47 
48  void setID( uniset::ObjectId id );
49  void init(ProxyManager* mngr);
50 
51  inline uniset::ObjectId getId() const
52  {
53  return id;
54  }
55  inline std::string getName() const
56  {
57  return myname;
58  }
59 
60  protected:
61  virtual void sysCommand( const uniset::SystemMessage* sm );
62  virtual void askSensors( UniversalIO::UIOCommand cmd ) {}
63  virtual void timerInfo( const uniset::TimerMessage* tm ) {}
64  virtual void sensorInfo( const uniset::SensorMessage* sm ) {}
65 
66  std::string myname = { "" };
67  ProxyManager* mngr = { nullptr };
68 
69  private:
71  };
72  // -------------------------------------------------------------------------
73 } // end of uniset namespace
74 // -------------------------------------------------------------------------
75 #endif // PassiveObject_H_
76 // -------------------------------------------------------------------------