stromx  0.8.0
Parameter.h
1 /*
2  * Copyright 2011 Matthias Fuchs
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef STROMX_RUNTIME_PARAMETER_H
18 #define STROMX_RUNTIME_PARAMETER_H
19 
20 #include "stromx/runtime/Description.h"
21 
22 namespace stromx
23 {
24  namespace runtime
25  {
26  class ParameterGroup;
27 
34  class STROMX_RUNTIME_API Parameter : public Description
35  {
36  public:
94  {
121  ACTIVATED_WRITE
122  };
123 
125  Parameter(const unsigned int id, const VariantHandle& variant, ParameterGroup* const group = 0);
126 
128  AccessMode accessMode() const { return m_access; }
129 
131  void setAccessMode(const AccessMode mode) { m_access = mode; }
132 
139  UpdateBehavior updateBehavior() const { return m_behavior; }
140 
142  void setUpdateBehavior(const UpdateBehavior behavior) { m_behavior = behavior; }
143 
148  virtual const Parameter* group() const { return m_group; }
149 
154  virtual const std::vector<const Parameter*> & members() const { return NO_MEMBERS; }
155 
156  virtual Type originalType() const { return PARAMETER; }
157  virtual Type currentType() const { return PARAMETER; }
158 
159  private:
160  static const std::vector<const Parameter*> NO_MEMBERS;
161 
162  AccessMode m_access;
163  UpdateBehavior m_behavior;
164  const Parameter* m_group;
165  };
166  }
167 }
168 
169 #endif // STROMX_RUNTIME_PARAMETER_H
Abstract description of an ID to variant map.
Definition: Description.h:69
virtual Type currentType() const
Definition: Parameter.h:157
Definition: VariantHandle.h:34
Definition: Parameter.h:98
Definition: Parameter.h:96
Type
Definition: Description.h:73
A group of parameters.
Definition: ParameterGroup.h:28
AccessMode accessMode() const
Definition: Parameter.h:128
void setUpdateBehavior(const UpdateBehavior behavior)
Definition: Parameter.h:142
The stromx class library.
Definition: AdjustRgbChannels.cpp:29
virtual Type originalType() const
Definition: Parameter.h:156
virtual const Parameter * group() const
Definition: Parameter.h:148
Definition: Parameter.h:103
Description of a parameter.
Definition: Parameter.h:34
UpdateBehavior updateBehavior() const
Definition: Parameter.h:139
void setAccessMode(const AccessMode mode)
Definition: Parameter.h:131
virtual const std::vector< const Parameter * > & members() const
Definition: Parameter.h:154
AccessMode
Definition: Parameter.h:93