stromx  0.8.0
Connector.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_CONNECTOR_H
18 #define STROMX_RUNTIME_CONNECTOR_H
19 
20 #include "stromx/runtime/Config.h"
21 
22 namespace stromx
23 {
24  namespace runtime
25  {
26  class Operator;
27 
29  class Connector
30  {
31  friend STROMX_RUNTIME_API bool operator==(const Connector & lhs, const Connector & rhs);
32 
33  public:
35  enum Type
36  {
43  };
44 
50  : m_type(UNDEFINED),
51  m_op(0),
52  m_id(0)
53  {}
54 
56  const Operator* op() const { return m_op; }
57 
59  unsigned int id() const { return m_id; }
60 
66  bool valid() const { return m_op != 0; }
67 
72  Type type() const { return m_type; }
73 
74  protected:
75  explicit Connector(const Type type, const Operator* const op, const unsigned int id)
76  : m_type(type),
77  m_op(op),
78  m_id(id)
79  {}
80 
81  private:
82  Type m_type;
83  const Operator* m_op;
84  unsigned int m_id;
85  };
86 
87  STROMX_RUNTIME_API bool operator==(const Connector & lhs, const Connector & rhs);
88  }
89 }
90 
91 #endif // STROMX_RUNTIME_CONNECTOR_H
Connector()
Definition: Connector.h:49
Identifier of a connector of an operator.
Definition: Connector.h:29
Definition: Connector.h:40
Definition: Connector.h:38
const Operator * op() const
Definition: Connector.h:56
The stromx class library.
Definition: AdjustRgbChannels.cpp:29
Abstract operator.
Definition: Operator.h:60
Definition: Connector.h:42
unsigned int id() const
Definition: Connector.h:59
bool valid() const
Definition: Connector.h:66
Type
Definition: Connector.h:35
Type type() const
Definition: Connector.h:72