stromx  0.8.0
VariantInterface.h
1 /*
2  * Copyright 2015 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_VARIANTINTERFACE_H
18 #define STROMX_RUNTIME_VARIANTINTERFACE_H
19 
20 #include "stromx/runtime/Config.h"
21 
22 #include <ostream>
23 
24 namespace stromx
25 {
26  namespace runtime
27  {
28  class VariantHandle;
29 
40  class STROMX_RUNTIME_API VariantInterface
41  {
42  public:
43  enum CompositeType
44  {
45  NO_COMPOSITE,
46  AND_COMPOSITE,
47  OR_COMPOSITE
48  };
49 
51  virtual unsigned int id() const = 0;
52 
54  virtual const std::string & package() const = 0;
55 
57  virtual const std::string title() const = 0;
58 
63  virtual bool isVariant(const VariantInterface& variant) const = 0;
64 
69  virtual CompositeType compositeType() const { return NO_COMPOSITE; }
70 
72  virtual const VariantHandle lhs() const;
73 
75  virtual const VariantHandle rhs() const;
76  };
77 
78  STROMX_RUNTIME_API bool operator==(const VariantInterface & lhs, const VariantInterface & rhs);
79  STROMX_RUNTIME_API std::ostream& operator<< (std::ostream& out, const VariantInterface & container);
80  }
81 }
82 
83 #endif // STROMX_RUNTIME_VARIANTINTERFACE_H
Definition: VariantHandle.h:34
virtual CompositeType compositeType() const
Definition: VariantInterface.h:69
Abstract description of a data variant.
Definition: VariantInterface.h:40
The stromx class library.
Definition: AdjustRgbChannels.cpp:29