stromx  0.8.0
Id2DataComposite.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_ID2DATACOMPOSITE_H
18 #define STROMX_RUNTIME_ID2DATACOMPOSITE_H
19 
20 #include "stromx/runtime/Config.h"
21 #include "stromx/runtime/Id2DataMapper.h"
22 
23 namespace stromx
24 {
25  namespace runtime
26  {
28  class STROMX_RUNTIME_API Id2DataComposite : public Id2DataMapper
29  {
30  public:
31  enum NodeType
32  {
33  AND,
34  OR
35  };
36 
37  STROMX_RUNTIME_API friend const Id2DataComposite operator&&(const Id2DataMapper & lhs, const Id2DataMapper & rhs);
38  STROMX_RUNTIME_API friend const Id2DataComposite operator||(const Id2DataMapper & lhs, const Id2DataMapper & rhs);
39 
40  Id2DataComposite(const Id2DataMapper& lhs, const Id2DataMapper& rhs, const NodeType type)
41  : m_lhs(lhs),
42  m_rhs(rhs),
43  m_type(type)
44  {}
45 
46  virtual bool trySet(const impl::Id2DataMap& id2DataMap) const;
47  virtual bool tryGet(const impl::Id2DataMap& id2DataMap) const;
48  virtual void get(impl::Id2DataMap& id2DataMap) const;
49  virtual void set(impl::Id2DataMap& id2DataMap) const;
50 
51  private:
53 
54  const Id2DataMapper& m_lhs;
55  const Id2DataMapper& m_rhs;
56  NodeType m_type;
57  };
58 
60  STROMX_RUNTIME_API const Id2DataComposite operator&&(const Id2DataMapper & lhs, const Id2DataMapper & rhs);
61 
63  STROMX_RUNTIME_API const Id2DataComposite operator||(const Id2DataMapper & lhs, const Id2DataMapper & rhs);
64  }
65 }
66 
67 #endif // STROMX_RUNTIME_ID2DATACOMPOSITE_H
const Id2DataComposite operator &&(const Id2DataMapper &lhs, const Id2DataMapper &rhs)
Definition: Id2DataComposite.cpp:90
The stromx class library.
Definition: AdjustRgbChannels.cpp:29
A composite expression of two ID-to-data mappers.
Definition: Id2DataComposite.h:28
const Id2DataComposite operator||(const Id2DataMapper &lhs, const Id2DataMapper &rhs)
Definition: Id2DataComposite.cpp:95
Abstract base class of ID-to-data mappers.
Definition: Id2DataMapper.h:30