StateParameter.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 ArmarX::
17 * @author Mirko Waechter ( mirko.waechter at kit dot edu)
18 * @date 2014
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
25 #include <memory>
26 
27 #include <QMap>
28 #include <QPair>
29 #include <QString>
30 
31 #include <Ice/Handle.h>
32 
33 #include <ArmarXCore/interface/statechart/StatechartIce.h>
35 
36 namespace armarx
37 {
38  class Variant;
40 } // namespace armarx
41 
43 {
44  class StateParameter;
45  using StateParameterPtr = std::shared_ptr<StateParameter>;
46  using StateParameterMap = QMap<QString, StateParameterPtr>;
48  QMap<QString, QPair<VariantContainerBasePtr, QString>>;
49 
51  {
52  public:
54  void setDefaultValue(const VariantContainerBasePtr& value);
55  VariantContainerBasePtr getDefaultValue();
56  void setDefaultValueJson(const QString& valueJson);
57  QString getDefaultValueJson();
59  FromIceStateParameter(armarx::StateParameterIceBasePtr param);
60  static armarx::StateParameterIceBasePtr
64 
65  QString type;
66  //QString dataType;
67 
68  //default values are also part of profileDefaultValues under the name StatechartProfiles::GetRootName()
69  // VariantContainerBasePtr defaultValue;
70  // QString defaultValueJSON; //! Used to store the default value in case the JSON string could not be deserialized
71  bool optional;
72  QString description;
74  profileDefaultValues; //! Second item in value pair: store the default value in case the JSON string could not be deserialized
75  };
76 
77 } // namespace armarx::statechartmodel
armarx::statechartmodel::StateParameter::FromIceStateParameter
static statechartmodel::StateParameterPtr FromIceStateParameter(armarx::StateParameterIceBasePtr param)
Definition: StateParameter.cpp:67
armarx::statechartmodel::StateParameter::ToIceStateParameterMap
static armarx::StateParameterMap ToIceStateParameterMap(statechartmodel::StateParameterMap params)
Definition: StateParameter.cpp:108
armarx::statechartmodel::StateParameter::profileDefaultValues
StateParameterProfileDefaultValueMap profileDefaultValues
Definition: StateParameter.h:74
armarx::statechartmodel::StateParameter::getDefaultValue
VariantContainerBasePtr getDefaultValue()
Definition: StateParameter.cpp:46
IceInternal::Handle< Variant >
armarx::statechartmodel::StateParameter::ToIceStateParameter
static armarx::StateParameterIceBasePtr ToIceStateParameter(statechartmodel::StateParameterPtr param)
Definition: StateParameter.cpp:98
armarx::VariantPtr
IceInternal::Handle< Variant > VariantPtr
Definition: Variant.h:41
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
armarx::statechartmodel::StateParameter
Definition: StateParameter.h:50
armarx::statechartmodel::StateParameterMap
QMap< QString, StateParameterPtr > StateParameterMap
Definition: StateParameter.h:46
armarx::statechartmodel
Definition: XmlWriter.h:36
armarx::statechartmodel::StateParameterPtr
std::shared_ptr< StateParameter > StateParameterPtr
Definition: StateParameter.h:45
armarx::statechartmodel::StateParameter::optional
bool optional
Definition: StateParameter.h:71
armarx::statechartmodel::StateParameter::description
QString description
Definition: StateParameter.h:72
armarx::statechartmodel::StateParameter::StateParameter
StateParameter()
Definition: StateParameter.cpp:34
armarx::statechartmodel::StateParameter::type
QString type
Definition: StateParameter.h:65
armarx::statechartmodel::StateParameter::setDefaultValue
void setDefaultValue(const VariantContainerBasePtr &value)
Definition: StateParameter.cpp:39
Variant.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::statechartmodel::StateParameter::setDefaultValueJson
void setDefaultValueJson(const QString &valueJson)
Definition: StateParameter.cpp:53
armarx::statechartmodel::StateParameter::getDefaultValueJson
QString getDefaultValueJson()
Definition: StateParameter.cpp:60
armarx::statechartmodel::StateParameterProfileDefaultValueMap
QMap< QString, QPair< VariantContainerBasePtr, QString > > StateParameterProfileDefaultValueMap
Definition: StateParameter.h:48