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
24
25namespace memoryx
26{
27
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
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 {
65 getProperty<std::string>("WorldStateObserverName").getValue());
66 worldStateObserver->registerAsUpdater(
67 getDefaultName(), WorldStateUpdaterInterfacePrx::uncheckedCast(getProxy()));
69 }
70
71
72} // namespace memoryx
constexpr T c
Property< PropertyType > getProperty(const std::string &name)
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
virtual std::string getDefaultName() const =0
Retrieve default name of component.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
bool removeProxyDependency(const std::string &name)
This function removes the dependency of this object on the in parameter name specified object.
void onInitComponent() override
Pure virtual hook for the subclass.
virtual void onConnectWorldStateUpdater()=0
void setObserver(const WorldStateObserverInterfacePrx &worldStateObserver, const Ice::Current &) override
WorldStateObserverInterfacePrx worldStateObserver
virtual void onInitWorldStateUpdater()=0
void requestUpdateOnRegisteredObserver(const Ice::Current &) override
void onConnectComponent() override
Pure virtual hook for the subclass.
void requestUpdate(const WorldStateObserverInterfacePrx &observer, const Ice::Current &c=Ice::emptyCurrent) override
VirtualRobot headers.