TopicTimingClient.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 RobotAPI::ArmarXObjects::TopicTimingClient
17  * @author Fabian Paus ( fabian dot paus 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/interface/core/TopicTimingTest.h>
30 
31 #include <boost/circular_buffer.hpp>
32 
33 #include <mutex>
34 
35 
36 namespace armarx
37 {
38  /**
39  * @class TopicTimingClientPropertyDefinitions
40  * @brief
41  */
44  {
45  public:
47  };
48 
49 
50 
51  /**
52  * @defgroup Component-TopicTimingClient TopicTimingClient
53  * @ingroup RobotAPI-Components
54  * A description of the component TopicTimingClient.
55  *
56  * @class TopicTimingClient
57  * @ingroup Component-TopicTimingClient
58  * @brief Brief description of class TopicTimingClient.
59  *
60  * Detailed description of class TopicTimingClient.
61  */
63  : virtual public armarx::Component
64  , virtual public armarx::topic_timing::Topic
65  {
66  public:
67 
68  /// @see armarx::ManagedIceObject::getDefaultName()
69  virtual std::string getDefaultName() const override;
70 
71  // Topic interface
72  void reportSmall(const topic_timing::SmallData& data, const Ice::Current&) override;
73  void reportBig(const topic_timing::BigData& data, const Ice::Current&) override;
74 
75  protected:
76 
77  /// @see armarx::ManagedIceObject::onInitComponent()
78  virtual void onInitComponent() override;
79 
80  /// @see armarx::ManagedIceObject::onConnectComponent()
81  virtual void onConnectComponent() override;
82 
83  /// @see armarx::ManagedIceObject::onDisconnectComponent()
84  virtual void onDisconnectComponent() override;
85 
86  /// @see armarx::ManagedIceObject::onExitComponent()
87  virtual void onExitComponent() override;
88 
89  /// @see PropertyUser::createPropertyDefinitions()
91 
92 
93  private:
95 
96  std::mutex mutex;
97  IceUtil::Time lastSmallTime = IceUtil::Time::microSeconds(0);
98 
99  boost::circular_buffer<IceUtil::Time> updateTimes;
100  int simulateWorkForMS = 20;
101  };
102 }
armarx::TopicTimingClient::createPropertyDefinitions
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: TopicTimingClient.cpp:85
armarx::TopicTimingClient::reportBig
void reportBig(const topic_timing::BigData &data, const Ice::Current &) override
Definition: TopicTimingClient.cpp:128
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::TopicTimingClient::onDisconnectComponent
virtual void onDisconnectComponent() override
Definition: TopicTimingClient.cpp:71
armarx::TopicTimingClient::onConnectComponent
virtual void onConnectComponent() override
Definition: TopicTimingClient.cpp:55
armarx::TopicTimingClient::onExitComponent
virtual void onExitComponent() override
Definition: TopicTimingClient.cpp:77
armarx::TopicTimingClient::reportSmall
void reportSmall(const topic_timing::SmallData &data, const Ice::Current &) override
Definition: TopicTimingClient.cpp:93
armarx::TopicTimingClient::getDefaultName
virtual std::string getDefaultName() const override
Definition: TopicTimingClient.cpp:41
armarx::TopicTimingClient
Brief description of class TopicTimingClient.
Definition: TopicTimingClient.h:62
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::TopicTimingClient::onInitComponent
virtual void onInitComponent() override
Definition: TopicTimingClient.cpp:47
armarx::TopicTimingClientPropertyDefinitions
Definition: TopicTimingClient.h:42
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::TopicTimingClientPropertyDefinitions::TopicTimingClientPropertyDefinitions
TopicTimingClientPropertyDefinitions(std::string prefix)
Definition: TopicTimingClient.cpp:30