ManagedIceObjectRegistryInterface.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 ArmarXCore::core
19  * @author Kai Welke (kai dot welke at kit dot edu)
20  * @date 2012
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 #include <Ice/Object.h>
28 
29 namespace armarx
30 {
31  // forward declaration
32  class ManagedIceObject;
34 
35  /**
36  * ManagedIceObjectRegistryInterface smart pointer type
37  */
38  class ManagedIceObjectRegistryInterface;
40 
41  /**
42  * @class ManagedIceObjectRegistryInterface
43  * @brief The registery interface is implemented by ArmarXManagers.
44  * @ingroup Core
45  *
46  * It is mainly used to provide the ArmarXDummyManager for properties parsing.
47  */
49  : virtual public Ice::Object
50  {
51  public:
52  /**
53  * Add a ManagedIceObject to the registry. Takes care of the ManagedIceObject
54  * lifcycle using and ArmarXObjectScheduler. addObject is
55  * thread-safe and can be called from any method in order to dynamically
56  * add ManagedIceObjects (as e.g. required for GUI).
57  *
58  * @param object object to add
59  * @param addWithOwnAdapter If true this object will have it's own adapter
60  * @param objectName Name that the object should have. if not empty overrides the currently set name.
61  */
62  virtual void addObject(const ManagedIceObjectPtr& object, bool addWithOwnAdapter = true, const std::string& objectName = "", bool useOwnScheduleThread = true) = 0;
63 
64  /**
65  * Removes an object from the registry.
66  *
67  * This version waits until all calls to this component are finished and
68  * the has been completely removed.
69  *
70  * @param object object to remove
71  */
72  virtual void removeObjectBlocking(const ManagedIceObjectPtr& object) = 0;
73 
74  /**
75  * Removes an object from the manageregistry.
76  *
77  * This version waits until all calls to this component are finished and
78  * the has been completely removed.
79  *
80  * @param objectName name of the object to remove
81  */
82  virtual void removeObjectBlocking(const std::string& objectName) = 0;
83 
84  /**
85  * Removes an object from the registry.
86  *
87  * This version returns immediatly and does <b>not</b> wait for all call to this
88  * to finish.
89  *
90  * @param object object to remove
91  */
92  virtual void removeObjectNonBlocking(const ManagedIceObjectPtr& object) = 0;
93 
94  /**
95  * Removes an object from the registry.
96  *
97  * This version returns immediatly and does <b>not</b> wait for all call to this
98  * to finish.
99  *
100  * @param objectName name of the object to remove
101  */
102  virtual void removeObjectNonBlocking(const std::string& objectName) = 0;
103 
104  /**
105  * Retrieve pointers to all ManagedIceObject.
106  *
107  * @return vector of pointers
108  */
109  virtual std::vector<ManagedIceObjectPtr> getManagedObjects() = 0;
110  };
111 }
112 
armarx::ManagedIceObjectRegistryInterfacePtr
IceUtil::Handle< ManagedIceObjectRegistryInterface > ManagedIceObjectRegistryInterfacePtr
Definition: Application.h:83
armarx::ManagedIceObjectRegistryInterface::getManagedObjects
virtual std::vector< ManagedIceObjectPtr > getManagedObjects()=0
Retrieve pointers to all ManagedIceObject.
IceInternal::Handle< ManagedIceObject >
armarx::ManagedIceObjectRegistryInterface::removeObjectBlocking
virtual void removeObjectBlocking(const ManagedIceObjectPtr &object)=0
Removes an object from the registry.
armarx::ManagedIceObjectRegistryInterface::removeObjectNonBlocking
virtual void removeObjectNonBlocking(const ManagedIceObjectPtr &object)=0
Removes an object from the registry.
armarx::ManagedIceObjectRegistryInterface
The registery interface is implemented by ArmarXManagers.
Definition: ManagedIceObjectRegistryInterface.h:48
armarx::ManagedIceObjectPtr
IceInternal::Handle< ManagedIceObject > ManagedIceObjectPtr
Definition: ArmarXFwd.h:42
IceUtil::Handle< ManagedIceObjectRegistryInterface >
armarx::ManagedIceObjectRegistryInterface::addObject
virtual void addObject(const ManagedIceObjectPtr &object, bool addWithOwnAdapter=true, const std::string &objectName="", bool useOwnScheduleThread=true)=0
Add a ManagedIceObject to the registry.
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28