PingLoadTest.h
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 ArmarXCore::ArmarXObjects::PingLoadTest
17  * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
18  * @date 2019
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 
27 
28 #include <ArmarXCore/interface/observers/ObserverInterface.h>
29 //#include <RobotAPI/libraries/core/visualization/DebugDrawerTopic.h>
30 #include <ArmarXCore/interface/components/PingLoadTestInterface.h>
31 
33 
34 namespace armarx
35 {
36  /**
37  * @class PingLoadTestPropertyDefinitions
38  * @brief
39  */
42  {
43  public:
45  };
46 
47 
48 
49  /**
50  * @defgroup Component-PingLoadTest PingLoadTest
51  * @ingroup ArmarXCore-Components
52  * A description of the component PingLoadTest.
53  *
54  * @class PingLoadTest
55  * @ingroup Component-PingLoadTest
56  * @brief Brief description of class PingLoadTest.
57  *
58  * Detailed description of class PingLoadTest.
59  */
60  class PingLoadTest :
61  virtual public PingLoadTestInterface,
62  virtual public armarx::Component
63  {
64  public:
65 
66  /// @see armarx::ManagedIceObject::getDefaultName()
67  virtual std::string getDefaultName() const override;
68 
69 
70  protected:
71 
72  /// @see armarx::ManagedIceObject::onInitComponent()
73  virtual void onInitComponent() override;
74 
75  /// @see armarx::ManagedIceObject::onConnectComponent()
76  virtual void onConnectComponent() override;
77 
78  /// @see armarx::ManagedIceObject::onDisconnectComponent()
79  virtual void onDisconnectComponent() override;
80 
81  /// @see armarx::ManagedIceObject::onExitComponent()
82  virtual void onExitComponent() override;
83 
84  /// @see PropertyUser::createPropertyDefinitions()
86 
87 
88  private:
89 
90  // Private methods and member variables go here.
91 
92  /// Debug observer. Used to visualize e.g. time series.
94  /// Debug drawer. Used for 3D visualization.
95  //armarx::DebugDrawerTopic debugDrawer;
96  std::string remotePingComponentName;
97  PingLoadTestInterfacePrx remotePingPrx;
98  PingLoadTestTopicInterfacePrx pingTopicPrx;
102  int PingProxyDelayMS;
103  int PingTopicDelayMS;
104  int RemoteTopicSleepDelayMS;
105  int SleepDuringTopicPing;
106  int topicPingSeqNr = 0;
107 
108 
109  // PingLoadTestTopicInterface interface
110  void taskProxyPingRun();
111  void taskTopicPingRun();
112  void taskTopicSleepPingRun();
113  public:
114  void pingTopic(int seqNr, Ice::Long senderTime, const Ice::Current&) override;
115  void remoteTopicSleep(const std::string& targetNameFilter, Ice::Long sleepMS, const Ice::Current&) override;
116 
117  // PingLoadTestInterface interface
118  public:
119  void ping(Ice::Long senderTime, const Ice::Current&) override;
120  Ice::Long getRemoteTime(const Ice::Current&) override;
121  };
122 }
armarx::PingLoadTest::ping
void ping(Ice::Long senderTime, const Ice::Current &) override
Definition: PingLoadTest.cpp:185
armarx::PingLoadTest::onInitComponent
virtual void onInitComponent() override
Definition: PingLoadTest.cpp:54
armarx::PingLoadTest::pingTopic
void pingTopic(int seqNr, Ice::Long senderTime, const Ice::Current &) override
Definition: PingLoadTest.cpp:165
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::PingLoadTest::createPropertyDefinitions
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: PingLoadTest.cpp:157
armarx::PingLoadTest::onConnectComponent
virtual void onConnectComponent() override
Definition: PingLoadTest.cpp:84
RunningTask.h
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
armarx::PingLoadTest
Brief description of class PingLoadTest.
Definition: PingLoadTest.h:60
armarx::PingLoadTest::remoteTopicSleep
void remoteTopicSleep(const std::string &targetNameFilter, Ice::Long sleepMS, const Ice::Current &) override
Definition: PingLoadTest.cpp:176
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::PingLoadTestPropertyDefinitions
Definition: PingLoadTest.h:40
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::PingLoadTest::getDefaultName
virtual std::string getDefaultName() const override
Definition: PingLoadTest.cpp:48
armarx::PingLoadTest::getRemoteTime
Ice::Long getRemoteTime(const Ice::Current &) override
Definition: PingLoadTest.cpp:190
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::PingLoadTestPropertyDefinitions::PingLoadTestPropertyDefinitions
PingLoadTestPropertyDefinitions(std::string prefix)
Definition: PingLoadTest.cpp:30
armarx::PingLoadTest::onExitComponent
virtual void onExitComponent() override
Definition: PingLoadTest.cpp:149
armarx::PingLoadTest::onDisconnectComponent
virtual void onDisconnectComponent() override
Definition: PingLoadTest.cpp:143
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28