UniSet  2.8.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 
42  {
43  public:
44  PassiveObject();
47  virtual ~PassiveObject();
48 
49  virtual void processingMessage( const uniset::VoidMessage* msg );
50 
51  void setID( uniset::ObjectId id );
52  void init(ProxyManager* mngr);
53 
54  inline uniset::ObjectId getId() const
55  {
56  return id;
57  }
58  inline std::string getName() const
59  {
60  return myname;
61  }
62 
63  protected:
64  virtual void sysCommand( const uniset::SystemMessage* sm );
65  virtual void askSensors( UniversalIO::UIOCommand cmd ) {}
66  virtual void timerInfo( const uniset::TimerMessage* tm ) {}
67  virtual void sensorInfo( const uniset::SensorMessage* sm ) {}
68 
69  std::string myname = { "" };
70  ProxyManager* mngr = { nullptr };
71 
72  private:
74  };
75  // -------------------------------------------------------------------------
76 } // end of uniset namespace
77 // -------------------------------------------------------------------------
78 #endif // PassiveObject_H_
79 // -------------------------------------------------------------------------
Definition: ProxyManager.h:44
Definition: PassiveObject.h:41
Definition: CommonEventLoop.h:14
Definition: MessageType.h:170
const ObjectId DefaultObjectId
Definition: UniSetTypes.h:69
Definition: MessageType.h:126
Definition: MessageType.h:90
Definition: MessageType.h:213
long ObjectId
Definition: UniSetTypes_i.idl:30