NodeObserver.h
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 ArmarX::
17* @author Manfred Kroehnert ( manfred.kroehnert at kit dot edu)
18* @date 2013
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
25#include <IceGrid/Admin.h>
26
27class QtNodeObserver : public IceGrid::NodeObserver
28{
30
31public:
32 QtNodeObserver(armarx::IceGridViewer* viewer) : viewer(viewer)
33 {
34 }
35
36 void
37 nodeInit(const IceGrid::NodeDynamicInfoSeq& nodes,
38 const ::Ice::Current& = Ice::emptyCurrent) override
39 {
40 viewer->gridNodeListUpdate(nodes);
41 }
42
43 void
44 nodeUp(const IceGrid::NodeDynamicInfo& node, const ::Ice::Current& = Ice::emptyCurrent) override
45 {
46 viewer->gridNodeListAdd(node);
47 }
48
49 void
50 nodeDown(const std::string& name, const ::Ice::Current& = Ice::emptyCurrent) override
51 {
52 viewer->gridNodeListRemove(QString::fromStdString(name));
53 }
54
55 void
56 updateServer(const std::string& node,
57 const IceGrid::ServerDynamicInfo& updatedInfo,
58 const ::Ice::Current& = Ice::emptyCurrent) override
59 {
60 viewer->updateServerInfo(node, updatedInfo);
61 }
62
63 void
64 updateAdapter(const std::string& node,
65 const IceGrid::AdapterDynamicInfo& updatedInfo,
66 const ::Ice::Current& = Ice::emptyCurrent) override
67 {
68 viewer->updateAdapterInfo(node, updatedInfo);
69 }
70};
71
IceUtil::Handle< QtNodeObserver > QtNodeObserverPtr
void updateServer(const std::string &node, const IceGrid::ServerDynamicInfo &updatedInfo, const ::Ice::Current &=Ice::emptyCurrent) override
void nodeDown(const std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
QtNodeObserver(armarx::IceGridViewer *viewer)
void nodeInit(const IceGrid::NodeDynamicInfoSeq &nodes, const ::Ice::Current &=Ice::emptyCurrent) override
void updateAdapter(const std::string &node, const IceGrid::AdapterDynamicInfo &updatedInfo, const ::Ice::Current &=Ice::emptyCurrent) override
void nodeUp(const IceGrid::NodeDynamicInfo &node, const ::Ice::Current &=Ice::emptyCurrent) override