WorldStateUpdaterBase.cpp
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 Mirko Waechter ( mirko.waechter at kit dot edu)
18 * @date 2014
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #include "WorldStateUpdaterBase.h"
24 
25 namespace memoryx
26 {
27 
29  {
30  }
31 
32  void
33  WorldStateUpdaterBase::setObserver(const WorldStateObserverInterfacePrx& worldStateObserver,
34  const Ice::Current&)
35  {
36  removeProxyDependency(getProperty<std::string>("WorldStateObserverName").getValue());
37  this->worldStateObserver = worldStateObserver;
38  }
39 
40  void
42  {
44  }
45 
46  void
47  WorldStateUpdaterBase::requestUpdate(const WorldStateObserverInterfacePrx& observer,
48  const Ice::Current& c)
49  {
50  observer->addObservablePredicateInstances(calcPredicates());
51  }
52 
53  void
55  {
56  usingProxy(getProperty<std::string>("WorldStateObserverName").getValue());
57 
59  }
60 
61  void
63  {
64  worldStateObserver = getProxy<WorldStateObserverInterfacePrx>(
65  getProperty<std::string>("WorldStateObserverName").getValue());
66  worldStateObserver->registerAsUpdater(
67  getDefaultName(), WorldStateUpdaterInterfacePrx::uncheckedCast(getProxy()));
69  }
70 
71 
72 } // namespace memoryx
memoryx::WorldStateUpdaterBase::requestUpdate
void requestUpdate(const WorldStateObserverInterfacePrx &observer, const Ice::Current &c=Ice::emptyCurrent) override
Definition: WorldStateUpdaterBase.cpp:47
armarx::ManagedIceObject::removeProxyDependency
bool removeProxyDependency(const std::string &name)
This function removes the dependency of this object on the in parameter name specified object.
Definition: ManagedIceObject.cpp:337
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
memoryx::WorldStateUpdaterBase::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: WorldStateUpdaterBase.cpp:62
memoryx::WorldStateUpdaterBase::setObserver
void setObserver(const WorldStateObserverInterfacePrx &worldStateObserver, const Ice::Current &) override
Definition: WorldStateUpdaterBase.cpp:33
memoryx::WorldStateUpdaterBase::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: WorldStateUpdaterBase.cpp:54
memoryx::WorldStateUpdaterBase::WorldStateUpdaterBase
WorldStateUpdaterBase()
Definition: WorldStateUpdaterBase.cpp:28
memoryx::WorldStateUpdaterBase::onConnectWorldStateUpdater
virtual void onConnectWorldStateUpdater()=0
WorldStateUpdaterBase.h
memoryx::WorldStateUpdaterBase::onInitWorldStateUpdater
virtual void onInitWorldStateUpdater()=0
armarx::ManagedIceObject::getDefaultName
virtual std::string getDefaultName() const =0
Retrieve default name of component.
memoryx::WorldStateUpdaterBase::requestUpdateOnRegisteredObserver
void requestUpdateOnRegisteredObserver(const Ice::Current &) override
Definition: WorldStateUpdaterBase.cpp:41
armarx::ManagedIceObject::getProxy
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
Definition: ManagedIceObject.cpp:407
memoryx::WorldStateUpdaterBase::worldStateObserver
WorldStateObserverInterfacePrx worldStateObserver
Definition: WorldStateUpdaterBase.h:62
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:154