lifecycle.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX 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
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package SpeechX::ArmarXObjects::gui
17  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18  * @date 2021
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "lifecycle.h"
24 
26 
27 namespace armarx::gui
28 {
30  {
31  }
32 
33  void
35  {
36  if (component)
37  {
38  onInit(*component);
39  }
40  }
41 
42  void
44  {
45  if (component)
46  {
48  }
49  }
50 
51  void
53  {
54  if (component)
55  {
57  }
58  }
59 
60  void
62  {
63  (void)component;
64  onInit();
65  }
66 
67  void
69  {
70  (void)component;
71  onConnect();
72  }
73 
74  void
76  {
77  (void)component;
78  onDisconnect();
79  }
80 
81  void
83  {
84  }
85 
86  void
88  {
89  }
90 
91  void
93  {
94  }
95 
96 } // namespace armarx::gui
97 
98 void
100 {
101  if (server && client)
102  {
103  server->connect(server,
104  &LifecycleServer::initialized,
105  [client](ManagedIceObject* o) { client->onInit(o); });
106  server->connect(server,
107  &LifecycleServer::connected,
108  [client](ManagedIceObject* o) { client->onConnect(o); });
109  server->connect(server,
110  &LifecycleServer::disconnected,
111  [client](ManagedIceObject* o) { client->onDisconnect(o); });
112  }
113 }
armarx::gui::LifecycleClient::onConnect
virtual void onConnect(ManagedIceObject *component)
Definition: lifecycle.cpp:43
armarx::gui::LifecycleServer
Definition: lifecycle.h:35
armarx::gui::LifecycleClient::onDisconnect
virtual void onDisconnect()
Definition: lifecycle.cpp:92
armarx::ProxyType::component
@ component
armarx::gui::LifecycleClient::onDisconnect
virtual void onDisconnect(ManagedIceObject *component)
Definition: lifecycle.cpp:52
armarx::gui::LifecycleClient::onInit
virtual void onInit(ManagedIceObject *component)
Definition: lifecycle.cpp:34
armarx::gui::LifecycleClient::onInit
virtual void onInit()
Definition: lifecycle.cpp:82
ManagedIceObject.h
armarx::gui::LifecycleClient
Definition: lifecycle.h:51
armarx::gui::connectLifecycle
void connectLifecycle(LifecycleServer *server, LifecycleClient *client)
Definition: lifecycle.cpp:99
armarx::gui::LifecycleClient::~LifecycleClient
virtual ~LifecycleClient()
Definition: lifecycle.cpp:29
armarx::gui::LifecycleClient::onConnect
virtual void onConnect()
Definition: lifecycle.cpp:87
armarx::ManagedIceObject
The ManagedIceObject is the base class for all ArmarX objects.
Definition: ManagedIceObject.h:162
armarx::gui::LifecycleClient::onInit
virtual void onInit(ManagedIceObject &component)
Definition: lifecycle.cpp:61
lifecycle.h
armarx::gui
Definition: gui_utils.h:12