DemoStateManager.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 ArmarXGui::DemoStateManager
17  * @author Leonie Leven
18  * @date 2024
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 <ArmarXGui/interface/DemoStateManagerInterface.h>
29 
30 namespace armarx
31 {
32 
34  virtual public armarx::Component,
35  virtual public armarx::DemoStateManagerInterface
36  {
37  public:
38  const std::string clearMessage = "OK";
39 
40  /**
41  * @see armarx::ManagedIceObject::getDefaultName()
42  */
43  std::string
44  getDefaultName() const override
45  {
46  return "DemoStateManager";
47  }
48 
49  void setState(const std::string& state,
50  armarx::severity::SeverityEnum severity,
51  const Ice::Current& = ::Ice::Current()) override;
52  void clear(const ::Ice::Current& = ::Ice::Current()) override;
53  StateAndSeverity getStateAndSeverity(const ::Ice::Current& = ::Ice::Current()) override;
54  std::string getDefaultStates(const ::Ice::Current& = ::Ice::Current()) override;
55 
56  protected:
57  /**
58  * @see armarx::ManagedIceObject::onInitComponent()
59  */
60  void onInitComponent() override;
61 
62  /**
63  * @see armarx::ManagedIceObject::onConnectComponent()
64  */
65  void onConnectComponent() override;
66 
67  /**
68  * @see armarx::ManagedIceObject::onDisconnectComponent()
69  */
70  void onDisconnectComponent() override;
71 
72  /**
73  * @see armarx::ManagedIceObject::onExitComponent()
74  */
75  void onExitComponent() override;
76 
77  /**
78  * @see PropertyUser::createPropertyDefinitions()
79  */
81 
82  private:
83  struct Properties
84  {
85  std::string defaultStates;
86  std::string defaultStateStartUp;
87  };
88 
89  Properties properties;
90  std::string defaultStartUp;
91  std::string defaultStateValues;
92  severity::SeverityEnum currentSeverity;
93  std::string currentState;
94  };
95 } // namespace armarx
armarx::DemoStateManager::onExitComponent
void onExitComponent() override
Definition: DemoStateManager.cpp:56
armarx::DemoStateManager::onConnectComponent
void onConnectComponent() override
Definition: DemoStateManager.cpp:46
armarx::DemoStateManager::onDisconnectComponent
void onDisconnectComponent() override
Definition: DemoStateManager.cpp:51
armarx::DemoStateManager::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: DemoStateManager.cpp:61
armarx::DemoStateManager::onInitComponent
void onInitComponent() override
Definition: DemoStateManager.cpp:28
armarx::DemoStateManager::getDefaultName
std::string getDefaultName() const override
Definition: DemoStateManager.h:44
armarx::DemoStateManager::setState
void setState(const std::string &state, armarx::severity::SeverityEnum severity, const Ice::Current &=::Ice::Current()) override
Definition: DemoStateManager.cpp:71
armarx::DemoStateManager::clearMessage
const std::string clearMessage
Definition: DemoStateManager.h:38
armarx::DemoStateManager::clear
void clear(const ::Ice::Current &=::Ice::Current()) override
Definition: DemoStateManager.cpp:80
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:91
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::DemoStateManager::getStateAndSeverity
StateAndSeverity getStateAndSeverity(const ::Ice::Current &=::Ice::Current()) override
Definition: DemoStateManager.cpp:87
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::DemoStateManager::getDefaultStates
std::string getDefaultStates(const ::Ice::Current &=::Ice::Current()) override
Definition: DemoStateManager.cpp:93
armarx::DemoStateManager
Definition: DemoStateManager.h:33