SimulatorTimeServerProxy.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2013-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 ArmarXSimulation::Simulator
19 * @author Clemens Wallrath ( uagzs at student dot kit dot edu )
20 * @date 2015
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25#pragma once
26
28#include <ArmarXCore/interface/core/TimeServerInterface.h>
29
30#include "Simulator.h"
31
32namespace armarx
33{
34
35 class Simulator;
36 using SimulatorPtr = IceInternal::Handle<Simulator>;
37
38 /**
39 * @brief The SimulatorTimeServerProxy class forwards TimeserverInterface calls to the simulator
40 * This is a hack to allow offering the proxies "Simulator" and "MasterTimeServer" at once
41 */
43 virtual public ManagedIceObject,
44 virtual public TimeServerInterface
45 {
46 public:
48
49 // inherited from TimeServerInterface
50 void stop(const Ice::Current& c = Ice::emptyCurrent) override;
51 void start(const Ice::Current& c = Ice::emptyCurrent) override;
52 void setSpeed(Ice::Float newSpeed, const Ice::Current& c = Ice::emptyCurrent) override;
53 Ice::Float getSpeed(const Ice::Current& c = Ice::emptyCurrent) override;
54 Ice::Long getTime(const Ice::Current& c = Ice::emptyCurrent) override;
55 void step(const Ice::Current& c = Ice::emptyCurrent) override;
56 Ice::Int getStepTimeMS(const Ice::Current& c = Ice::emptyCurrent) override;
57
58 // inherited from ManagedIceObject
59 std::string getDefaultName() const override;
60
61 void
62 onInitComponent() override
63 {
64 }
65
66 void
68 {
69 }
70
71 void
73 {
74 }
75
76 void
77 onExitComponent() override
78 {
79 }
80
81 protected:
83 };
84
86
87} // namespace armarx
constexpr T c
ManagedIceObject(ManagedIceObject const &other)
void onInitComponent() override
Pure virtual hook for the subclass.
Ice::Long getTime(const Ice::Current &c=Ice::emptyCurrent) override
void start(const Ice::Current &c=Ice::emptyCurrent) override
void onDisconnectComponent() override
Hook for subclass.
void step(const Ice::Current &c=Ice::emptyCurrent) override
Ice::Float getSpeed(const Ice::Current &c=Ice::emptyCurrent) override
void stop(const Ice::Current &c=Ice::emptyCurrent) override
Ice::Int getStepTimeMS(const Ice::Current &c=Ice::emptyCurrent) override
void setSpeed(Ice::Float newSpeed, const Ice::Current &c=Ice::emptyCurrent) override
void onConnectComponent() override
Pure virtual hook for the subclass.
void onExitComponent() override
Hook for subclass.
std::string getDefaultName() const override
Retrieve default name of component.
The Simulator class holds an instance of the AmrarXPhysicsWorld and communicates to ArmarX.
Definition Simulator.h:123
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< SimulatorTimeServerProxy > SimulatorTimeServerProxyPtr
Definition Simulator.h:67
IceInternal::Handle< Simulator > SimulatorPtr
Definition Simulator.h:527