RobotNameService.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 RobotAPI::ArmarXObjects::RobotNameService
17 * @author [Author Name] ( [Author Email] )
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <map>
26#include <mutex>
27#include <string>
28
30
31#include <RobotAPI/interface/robot_name_service/RobotNameServiceInterface.h>
33
34namespace armarx
35{
36 /**
37 * @defgroup Component-RobotNameService RobotNameService
38 * @ingroup RobotAPI-Components
39 * A description of the component RobotNameService.
40 *
41 * @class RobotNameService
42 * @ingroup Component-RobotNameService
43 * @brief Brief description of class RobotNameService.
44 *
45 * Detailed description of class RobotNameService.
46 */
48 virtual public armarx::Component,
49 virtual public armarx::robot_name_service::dti::RobotNameServiceInterface
50 {
51 public:
52 /**
53 * @see armarx::ManagedIceObject::getDefaultName()
54 */
55 std::string
56 getDefaultName() const override
57 {
58 return "RobotNameService";
59 }
60
61 protected:
62 /**
63 * @see armarx::ManagedIceObject::onInitComponent()
64 */
65 void onInitComponent() override;
66
67 /**
68 * @see armarx::ManagedIceObject::onConnectComponent()
69 */
70 void onConnectComponent() override;
71
72 /**
73 * @see armarx::ManagedIceObject::onDisconnectComponent()
74 */
75 void onDisconnectComponent() override;
76
77 /**
78 * @see armarx::ManagedIceObject::onExitComponent()
79 */
80 void onExitComponent() override;
81
82 /**
83 * @see PropertyUser::createPropertyDefinitions()
84 */
86
87
88 // RobotNameServiceInterface interface
89 public:
90 bool registerRobotInfo(const robot_name_service::dto::RobotInfo& robot,
91 const Ice::Current& current) override;
92 void unregisterRobotInfo(const std::string& name, const Ice::Current& current) override;
93 IceUtil::Optional<robot_name_service::dto::RobotInfo>
94 getRobotInfo(const std::string& name, const Ice::Current& current) override;
95
96 private:
97 mutable std::mutex robotsMutex;
98 std::map<std::string, robot_name_service::core::RobotInfo> robots;
99 };
100} // namespace armarx
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
Brief description of class RobotNameService.
bool registerRobotInfo(const robot_name_service::dto::RobotInfo &robot, const Ice::Current &current) override
void onDisconnectComponent() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
IceUtil::Optional< robot_name_service::dto::RobotInfo > getRobotInfo(const std::string &name, const Ice::Current &current) override
void unregisterRobotInfo(const std::string &name, const Ice::Current &current) override
void onConnectComponent() override
std::string getDefaultName() const override
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.