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  */
48  class ManagedIceObjectRegistryInterface : virtual public Ice::Object
49  {
50  public:
51  /**
52  * Add a ManagedIceObject to the registry. Takes care of the ManagedIceObject
53  * lifcycle using and ArmarXObjectScheduler. addObject is
54  * thread-safe and can be called from any method in order to dynamically
55  * add ManagedIceObjects (as e.g. required for GUI).
56  *
57  * @param object object to add
58  * @param addWithOwnAdapter If true this object will have it's own adapter
59  * @param objectName Name that the object should have. if not empty overrides the currently set name.
60  */
61  virtual void addObject(const ManagedIceObjectPtr& object,
62  bool addWithOwnAdapter = true,
63  const std::string& objectName = "",
64  bool useOwnScheduleThread = true) = 0;
65 
66  /**
67  * Removes an object from the registry.
68  *
69  * This version waits until all calls to this component are finished and
70  * the has been completely removed.
71  *
72  * @param object object to remove
73  */
74  virtual void removeObjectBlocking(const ManagedIceObjectPtr& object) = 0;
75 
76  /**
77  * Removes an object from the manageregistry.
78  *
79  * This version waits until all calls to this component are finished and
80  * the has been completely removed.
81  *
82  * @param objectName name of the object to remove
83  */
84  virtual void removeObjectBlocking(const std::string& objectName) = 0;
85 
86  /**
87  * Removes an object from the registry.
88  *
89  * This version returns immediatly and does <b>not</b> wait for all call to this
90  * to finish.
91  *
92  * @param object object to remove
93  */
94  virtual void removeObjectNonBlocking(const ManagedIceObjectPtr& object) = 0;
95 
96  /**
97  * Removes an object from the registry.
98  *
99  * This version returns immediatly and does <b>not</b> wait for all call to this
100  * to finish.
101  *
102  * @param objectName name of the object to remove
103  */
104  virtual void removeObjectNonBlocking(const std::string& objectName) = 0;
105 
106  /**
107  * Retrieve pointers to all ManagedIceObject.
108  *
109  * @return vector of pointers
110  */
111  virtual std::vector<ManagedIceObjectPtr> getManagedObjects() = 0;
112  };
113 } // namespace armarx
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:27