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 
26 #include <mutex>
27 
28 #include <boost/circular_buffer.hpp>
29 
31 #include <ArmarXCore/interface/observers/ObserverInterface.h>
32 
33 #include <RobotAPI/interface/core/TopicTimingTest.h>
34 
35 namespace armarx
36 {
37  /**
38  * @class TopicTimingClientPropertyDefinitions
39  * @brief
40  */
42  {
43  public:
45  };
46 
47  /**
48  * @defgroup Component-TopicTimingClient TopicTimingClient
49  * @ingroup RobotAPI-Components
50  * A description of the component TopicTimingClient.
51  *
52  * @class TopicTimingClient
53  * @ingroup Component-TopicTimingClient
54  * @brief Brief description of class TopicTimingClient.
55  *
56  * Detailed description of class TopicTimingClient.
57  */
59  virtual public armarx::Component,
60  virtual public armarx::topic_timing::Topic
61  {
62  public:
63  /// @see armarx::ManagedIceObject::getDefaultName()
64  virtual std::string getDefaultName() const override;
65 
66  // Topic interface
67  void reportSmall(const topic_timing::SmallData& data, const Ice::Current&) override;
68  void reportBig(const topic_timing::BigData& data, const Ice::Current&) override;
69 
70  protected:
71  /// @see armarx::ManagedIceObject::onInitComponent()
72  virtual void onInitComponent() override;
73 
74  /// @see armarx::ManagedIceObject::onConnectComponent()
75  virtual void onConnectComponent() override;
76 
77  /// @see armarx::ManagedIceObject::onDisconnectComponent()
78  virtual void onDisconnectComponent() override;
79 
80  /// @see armarx::ManagedIceObject::onExitComponent()
81  virtual void onExitComponent() override;
82 
83  /// @see PropertyUser::createPropertyDefinitions()
85 
86 
87  private:
89 
90  std::mutex mutex;
91  IceUtil::Time lastSmallTime = IceUtil::Time::microSeconds(0);
92 
93  boost::circular_buffer<IceUtil::Time> updateTimes;
94  int simulateWorkForMS = 20;
95  };
96 } // namespace armarx
armarx::TopicTimingClient::createPropertyDefinitions
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: TopicTimingClient.cpp:81
armarx::TopicTimingClient::reportBig
void reportBig(const topic_timing::BigData &data, const Ice::Current &) override
Definition: TopicTimingClient.cpp:125
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
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:76
armarx::TopicTimingClient::reportSmall
void reportSmall(const topic_timing::SmallData &data, const Ice::Current &) override
Definition: TopicTimingClient.cpp:89
armarx::TopicTimingClient::getDefaultName
virtual std::string getDefaultName() const override
Definition: TopicTimingClient.cpp:41
armarx::TopicTimingClient
Brief description of class TopicTimingClient.
Definition: TopicTimingClient.h:58
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:91
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:69
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:41
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::TopicTimingClientPropertyDefinitions::TopicTimingClientPropertyDefinitions
TopicTimingClientPropertyDefinitions(std::string prefix)
Definition: TopicTimingClient.cpp:29