ArmarXManagerItem.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package ArmarX::Gui
19 * @author Jan Issac ( jan.issac at gmail dot com)
20 * @date 2012
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25
26#pragma once
27
28#include <mutex>
29
30#include <QObject>
31#include <QStandardItem>
32
36
38
39namespace armarx
40{
41 class ArmarXManagerItem : public QStandardItem
42 {
43 public:
44 using ObjectMap = QMap<QString, ManagedIceObjectItem>;
45
47 {
48 QString name;
49 bool online = false;
50 ArmarXManagerInterfacePrx proxy;
52 ObjectPropertyInfos appProperties;
53 Ice::ConnectionPtr connection;
54 QString endpointStr;
55 };
56
57 using ManagerDataMap = std::map<QString, ManagerData>;
58
59 public:
60 explicit ArmarXManagerItem(const QString& name);
61
63 {
64 }
65
66 QString getName() const;
67 bool isOnline() const;
68 ArmarXManagerInterfacePrx getManagerProxy() const;
69 Ice::ConnectionPtr getConnection() const;
70 QString getEndpointStr() const;
72
73 void setName(QString name);
74 void setOnline(bool online);
75 void setManagerProxy(ArmarXManagerInterfacePrx proxy);
76 void setAppProperties(const ObjectPropertyInfos& properties);
77 void setConnection(Ice::ConnectionPtr connection);
78 void setEndpointStr(const QString& endpointStr);
79 const ObjectPropertyInfos& getAppProperties() const;
80 /**
81 * Clears the item data.
82 */
83 void clear(bool clearProxy = true);
84
85 /**
86 * Returns the access mutex
87 *
88 * @return Access mutex
89 */
90 std::mutex& getMutex();
91
92 private:
93 ManagerData data;
94 std::mutex mutex;
95 };
96} // namespace armarx
void setAppProperties(const ObjectPropertyInfos &properties)
ArmarXManagerInterfacePrx getManagerProxy() const
Ice::ConnectionPtr getConnection() const
ArmarXManagerItem(const QString &name)
std::mutex & getMutex()
Returns the access mutex.
const ObjectPropertyInfos & getAppProperties() const
void clear(bool clearProxy=true)
Clears the item data.
void setEndpointStr(const QString &endpointStr)
std::map< QString, ManagerData > ManagerDataMap
void setManagerProxy(ArmarXManagerInterfacePrx proxy)
QMap< QString, ManagedIceObjectItem > ObjectMap
void setConnection(Ice::ConnectionPtr connection)
This file offers overloads of toIce() and fromIce() functions for STL container types.