stromx  0.8.0
ConnectorDescription.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_CONNECTORDESCRIPTION_H
18 #define STROMX_RUNTIME_CONNECTORDESCRIPTION_H
19 
20 #include "stromx/runtime/Description.h"
21 
22 namespace stromx
23 {
24  namespace runtime
25  {
26 
32  class STROMX_RUNTIME_API ConnectorDescription : public Description
33  {
34  public:
39  virtual void setRows(const unsigned int value)
40  {
41  m_rows = value;
42  }
43 
48  virtual void setCols(const unsigned int value)
49  {
50  m_cols = value;
51  }
52 
57  unsigned int operatorThread() const
58  {
59  return m_operatorThread;
60  }
61 
82  void setOperatorThread(const unsigned int operatorThread)
83  {
84  m_operatorThread = operatorThread;
85  }
86 
94  Type defaultType() const { return m_defaultType; }
95 
102  UpdateBehavior defaultBehavior() const { return m_defaultBehavior; }
103 
110  void setDefaultType(const Type type, const UpdateBehavior behavior = PERSISTENT)
111  {
112  m_defaultType = type;
113  m_defaultBehavior = behavior;
114  }
115 
116  virtual unsigned int rows() const { return m_rows; }
117  virtual unsigned int cols() const { return m_cols; }
118 
119  protected:
121  ConnectorDescription(const unsigned int id, const VariantHandle& variant, const Type defaultType)
122  : Description(id, variant),
123  m_operatorThread(0),
124  m_defaultType(defaultType),
125  m_defaultBehavior(PERSISTENT),
126  m_rows(0),
127  m_cols(0)
128  {}
129 
130  private:
131  unsigned int m_operatorThread;
132  Type m_defaultType;
133  UpdateBehavior m_defaultBehavior;
134  unsigned int m_rows;
135  unsigned int m_cols;
136  };
137  }
138 }
139 
140 #endif // STROMX_RUNTIME_CONNECTORDESCRIPTION_H
Abstract description of an ID to variant map.
Definition: Description.h:69
Definition: VariantHandle.h:34
virtual void setRows(const unsigned int value)
Definition: ConnectorDescription.h:39
Description of a connector.
Definition: ConnectorDescription.h:32
UpdateBehavior defaultBehavior() const
Definition: ConnectorDescription.h:102
virtual unsigned int cols() const
Definition: ConnectorDescription.h:117
void setOperatorThread(const unsigned int operatorThread)
Definition: ConnectorDescription.h:82
void setDefaultType(const Type type, const UpdateBehavior behavior=PERSISTENT)
Definition: ConnectorDescription.h:110
virtual unsigned int rows() const
Definition: ConnectorDescription.h:116
Type
Definition: Description.h:73
The stromx class library.
Definition: AdjustRgbChannels.cpp:29
Type defaultType() const
Definition: ConnectorDescription.h:94
virtual void setCols(const unsigned int value)
Definition: ConnectorDescription.h:48
unsigned int operatorThread() const
Definition: ConnectorDescription.h:57
ConnectorDescription(const unsigned int id, const VariantHandle &variant, const Type defaultType)
Definition: ConnectorDescription.h:121