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 
26 #include <ArmarXCore/interface/statechart/StatechartIce.h>
27 
28 #include <Ice/Handle.h>
29 
30 #include <QPair>
31 #include <QString>
32 #include <QMap>
33 
34 #include <memory>
35 
36 namespace armarx
37 {
38  class Variant;
40 }
41 
43 {
44  class StateParameter;
45  using StateParameterPtr = std::shared_ptr<StateParameter>;
46  using StateParameterMap = QMap<QString, StateParameterPtr>;
47  using StateParameterProfileDefaultValueMap = QMap<QString, QPair<VariantContainerBasePtr, QString>>;
48 
50  {
51  public:
53  void setDefaultValue(const VariantContainerBasePtr& value);
54  VariantContainerBasePtr getDefaultValue();
55  void setDefaultValueJson(const QString& valueJson);
56  QString getDefaultValueJson();
57  static statechartmodel::StateParameterPtr FromIceStateParameter(armarx::StateParameterIceBasePtr param);
58  static armarx::StateParameterIceBasePtr ToIceStateParameter(statechartmodel::StateParameterPtr param);
60 
61  QString type;
62  //QString dataType;
63 
64  //default values are also part of profileDefaultValues under the name StatechartProfiles::GetRootName()
65  // VariantContainerBasePtr defaultValue;
66  // QString defaultValueJSON; //! Used to store the default value in case the JSON string could not be deserialized
67  bool optional;
68  QString description;
69  StateParameterProfileDefaultValueMap profileDefaultValues; //! Second item in value pair: store the default value in case the JSON string could not be deserialized
70  };
71 
72 }
armarx::statechartmodel::StateParameter::FromIceStateParameter
static statechartmodel::StateParameterPtr FromIceStateParameter(armarx::StateParameterIceBasePtr param)
Definition: StateParameter.cpp:61
armarx::statechartmodel::StateParameter::ToIceStateParameterMap
static armarx::StateParameterMap ToIceStateParameterMap(statechartmodel::StateParameterMap params)
Definition: StateParameter.cpp:98
armarx::statechartmodel::StateParameter::profileDefaultValues
StateParameterProfileDefaultValueMap profileDefaultValues
Definition: StateParameter.h:69
armarx::statechartmodel::StateParameter::getDefaultValue
VariantContainerBasePtr getDefaultValue()
Definition: StateParameter.cpp:45
IceInternal::Handle< Variant >
armarx::statechartmodel::StateParameter::ToIceStateParameter
static armarx::StateParameterIceBasePtr ToIceStateParameter(statechartmodel::StateParameterPtr param)
Definition: StateParameter.cpp:89
armarx::VariantPtr
IceInternal::Handle< Variant > VariantPtr
Definition: Variant.h:42
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::statechartmodel::StateParameter
Definition: StateParameter.h:49
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:67
armarx::statechartmodel::StateParameter::description
QString description
Definition: StateParameter.h:68
armarx::statechartmodel::StateParameter::StateParameter
StateParameter()
Definition: StateParameter.cpp:35
armarx::statechartmodel::StateParameter::type
QString type
Definition: StateParameter.h:61
armarx::statechartmodel::StateParameter::setDefaultValue
void setDefaultValue(const VariantContainerBasePtr &value)
Definition: StateParameter.cpp:40
Variant.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::statechartmodel::StateParameter::setDefaultValueJson
void setDefaultValueJson(const QString &valueJson)
Definition: StateParameter.cpp:50
armarx::statechartmodel::StateParameter::getDefaultValueJson
QString getDefaultValueJson()
Definition: StateParameter.cpp:55
armarx::statechartmodel::StateParameterProfileDefaultValueMap
QMap< QString, QPair< VariantContainerBasePtr, QString > > StateParameterProfileDefaultValueMap
Definition: StateParameter.h:47