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 
28 namespace armarx::gui
29 {
31  {
32  }
33 
35  {
36  if (component)
37  {
38  onInit(*component);
39  }
40  }
41 
43  {
44  if (component)
45  {
47  }
48  }
49 
51  {
52  if (component)
53  {
55  }
56  }
57 
59  {
60  (void) component;
61  onInit();
62  }
63 
65  {
66  (void) component;
67  onConnect();
68  }
69 
71  {
72  (void) component;
73  onDisconnect();
74  }
75 
77  {
78  }
79 
81  {
82  }
83 
85  {
86  }
87 
88 }
89 
91 {
92  if (server && client)
93  {
94  server->connect(server, &LifecycleServer::initialized, [client](ManagedIceObject * o)
95  {
96  client->onInit(o);
97  });
98  server->connect(server, &LifecycleServer::connected, [client](ManagedIceObject * o)
99  {
100  client->onConnect(o);
101  });
102  server->connect(server, &LifecycleServer::disconnected, [client](ManagedIceObject * o)
103  {
104  client->onDisconnect(o);
105  });
106  }
107 }
armarx::gui::LifecycleClient::onConnect
virtual void onConnect(ManagedIceObject *component)
Definition: lifecycle.cpp:42
armarx::gui::LifecycleServer
Definition: lifecycle.h:35
armarx::gui::LifecycleClient::onDisconnect
virtual void onDisconnect()
Definition: lifecycle.cpp:84
armarx::ProxyType::component
@ component
armarx::gui::LifecycleClient::onDisconnect
virtual void onDisconnect(ManagedIceObject *component)
Definition: lifecycle.cpp:50
armarx::gui::LifecycleClient::onInit
virtual void onInit(ManagedIceObject *component)
Definition: lifecycle.cpp:34
armarx::gui::LifecycleClient::onInit
virtual void onInit()
Definition: lifecycle.cpp:76
ManagedIceObject.h
armarx::gui::LifecycleClient
Definition: lifecycle.h:54
armarx::gui::connectLifecycle
void connectLifecycle(LifecycleServer *server, LifecycleClient *client)
Definition: lifecycle.cpp:90
armarx::gui::LifecycleClient::~LifecycleClient
virtual ~LifecycleClient()
Definition: lifecycle.cpp:30
armarx::gui::LifecycleClient::onConnect
virtual void onConnect()
Definition: lifecycle.cpp:80
armarx::ManagedIceObject
The ManagedIceObject is the base class for all ArmarX objects.
Definition: ManagedIceObject.h:163
lifecycle.h
armarx::gui
Definition: gui_utils.h:13