Medical Imaging Interaction Toolkit  2026.06.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 
59  const QList<Parameterization>& parameterizations);
60 
61  bool operator<(const Object* object) const override;
62 
63  bool operator==(const Object* object) const override;
64 
88  const Object::Pointer& applicationContext);
89 
97 
104  QString GetId() const;
105 
115  QString GetName() const;
116 
125  QHash<QString, QString> GetParameterMap() const;
126 
127  uint HashCode() const override;
128 
185  QString Serialize();
186 
187  QString ToString() const override;
188 
210  static QList<ParameterizedCommand::Pointer>
212 
226  const QHash<QString, Object::Pointer>& parameters);
227 
228 private:
229 
234  static const uint HASH_CODE_NOT_COMPUTED; // = 0;
235 
239  static const uint HASH_FACTOR; // = 89;
240 
244  static const uint HASH_INITIAL;
245 
262  static QString Escape(const QString& rawText);
263 
277  static QList<QList<Parameterization> > ExpandParameters(unsigned int startIndex,
278  const QList<SmartPointer<IParameter> >& parameters);
279 
284  const SmartPointer<Command> command;
285 
290  mutable uint hashCode;
291 
296  QList<Parameterization> parameterizations;
297 
298  mutable QString name;
299 
300 };
301 
302 }
303 
304 #endif /* BERRYPARAMETERIZEDCOMMAND_H_ */
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:68
QHash< QString, QString > GetParameterMap() const
bool operator<(const Object *object) const override
berryObjectMacro(ParameterizedCommand)
Object::Pointer ExecuteWithChecks(const Object::ConstPointer &trigger, const Object::Pointer &applicationContext)
static QList< ParameterizedCommand::Pointer > GenerateCombinations(const SmartPointer< Command > command)
uint HashCode() const override
static ParameterizedCommand::Pointer GenerateCommand(const SmartPointer< Command > command, const QHash< QString, Object::Pointer > &parameters)
ParameterizedCommand(const SmartPointer< Command > &command, const QList< Parameterization > &parameterizations)
QString ToString() const override
SmartPointer< Command > GetCommand() const
bool operator==(const Object *object) const override
Implements transparent reference counting.