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 WorldStateUpdaterBase::setObserver(const WorldStateObserverInterfacePrx& worldStateObserver, const Ice::Current&)
33  {
34  removeProxyDependency(getProperty<std::string>("WorldStateObserverName").getValue());
35  this->worldStateObserver = worldStateObserver;
36  }
37 
39  {
41  }
42 
43  void WorldStateUpdaterBase::requestUpdate(const WorldStateObserverInterfacePrx& observer, const Ice::Current& c)
44  {
45  observer->addObservablePredicateInstances(calcPredicates());
46  }
47 
48 
50  {
51  usingProxy(getProperty<std::string>("WorldStateObserverName").getValue());
52 
54  }
55 
57  {
58  worldStateObserver = getProxy<WorldStateObserverInterfacePrx>(getProperty<std::string>("WorldStateObserverName").getValue());
59  worldStateObserver->registerAsUpdater(getDefaultName(), WorldStateUpdaterInterfacePrx::uncheckedCast(getProxy()));
61  }
62 
63 
64 } // namespace memoryx
65 
66 
memoryx::WorldStateUpdaterBase::requestUpdate
void requestUpdate(const WorldStateObserverInterfacePrx &observer, const Ice::Current &c=Ice::emptyCurrent) override
Definition: WorldStateUpdaterBase.cpp:43
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:326
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::WorldStateUpdaterBase::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: WorldStateUpdaterBase.cpp:56
memoryx::WorldStateUpdaterBase::setObserver
void setObserver(const WorldStateObserverInterfacePrx &worldStateObserver, const Ice::Current &) override
Definition: WorldStateUpdaterBase.cpp:32
memoryx::WorldStateUpdaterBase::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: WorldStateUpdaterBase.cpp:49
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:38
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:393
memoryx::WorldStateUpdaterBase::worldStateObserver
WorldStateObserverInterfacePrx worldStateObserver
Definition: WorldStateUpdaterBase.h:58
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:151