Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
berryParameterizedCommand.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef BERRYPARAMETERIZEDCOMMAND_H_
14 #define BERRYPARAMETERIZEDCOMMAND_H_
15 
16 #include <berryObject.h>
17 #include <berryMacros.h>
18 
21 
22 #include <list>
23 #include <map>
24 
25 namespace berry
26 {
27 
28 struct IParameter;
29 class Command;
30 class Parameterization;
31 
41 { //implements Comparable {
42 
43 public:
44 
46 
52  static const int INDEX_PARAMETER_ID; // = 0;
53 
60  static const int INDEX_PARAMETER_NAME; // = 1;
61 
68  static const int INDEX_PARAMETER_VALUE_NAME; // = 2;
69 
75  static const int INDEX_PARAMETER_VALUE_VALUE; // = 3;
76 
89  const QList<Parameterization>& parameterizations);
90 
91  bool operator<(const Object* object) const override;
92 
93  bool operator==(const Object* object) const override;
94 
117  Object::Pointer ExecuteWithChecks(const Object::ConstPointer& trigger,
118  const Object::Pointer& applicationContext);
119 
126  SmartPointer<Command> GetCommand() const;
127 
134  QString GetId() const;
135 
145  QString GetName() const;
146 
155  QHash<QString, QString> GetParameterMap() const;
156 
157  uint HashCode() const override;
158 
215  QString Serialize();
216 
217  QString ToString() const override;
218 
240  static QList<ParameterizedCommand::Pointer>
241  GenerateCombinations(const SmartPointer<Command> command);
242 
255  static ParameterizedCommand::Pointer GenerateCommand(const SmartPointer<Command> command,
256  const QHash<QString, Object::Pointer>& parameters);
257 
258 private:
259 
264  static const uint HASH_CODE_NOT_COMPUTED; // = 0;
265 
269  static const uint HASH_FACTOR; // = 89;
270 
274  static const uint HASH_INITIAL;
275 
292  static QString Escape(const QString& rawText);
293 
307  static QList<QList<Parameterization> > ExpandParameters(unsigned int startIndex,
308  const QList<SmartPointer<IParameter> >& parameters);
309 
314  const SmartPointer<Command> command;
315 
320  mutable uint hashCode;
321 
326  QList<Parameterization> parameterizations;
327 
328  mutable QString name;
329 
330 };
331 
332 }
333 
334 #endif /* BERRYPARAMETERIZEDCOMMAND_H_ */
berry::ParameterizedCommand::INDEX_PARAMETER_VALUE_VALUE
static const int INDEX_PARAMETER_VALUE_VALUE
Definition: berryParameterizedCommand.h:75
org_blueberry_core_commands_Export.h
berry::ParameterizedCommand::INDEX_PARAMETER_VALUE_NAME
static const int INDEX_PARAMETER_VALUE_NAME
Definition: berryParameterizedCommand.h:68
berryMacros.h
mitk::modelFit::operator<
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two var lists and returns true if the first list's first item is lower than the second one's...
Definition: mitkModelFitStaticParameterMap.h:139
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
berryCommandExceptions.h
BERRY_COMMANDS
#define BERRY_COMMANDS
Definition: org_blueberry_core_commands_Export.h:26
berry::Object
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:72
berry::ParameterizedCommand::INDEX_PARAMETER_NAME
static const int INDEX_PARAMETER_NAME
Definition: berryParameterizedCommand.h:60
berry::ParameterizedCommand
Definition: berryParameterizedCommand.h:40
mitk::operator==
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
berryObjectMacro
#define berryObjectMacro(...)
Definition: berryMacros.h:33
berryObject.h
berry::ParameterizedCommand::INDEX_PARAMETER_ID
static const int INDEX_PARAMETER_ID
Definition: berryParameterizedCommand.h:52
berry
Definition: QmitkPropertyItemModel.h:24