stromx  0.8.0
DataInterface.h
1 /*
2  * Copyright 2012 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_DATAINTERFACE_H
18 #define STROMX_RUNTIME_DATAINTERFACE_H
19 
20 #include "stromx/runtime/VariantHandle.h"
21 
22 namespace stromx
23 {
24  namespace runtime
25  {
26  class Data;
27  class InputProvider;
28  class OutputProvider;
29  class Version;
30 
33  {
34  public:
35  virtual ~DataInterface() {}
36 
38  virtual const Version & version() const = 0;
39 
41  virtual const std::string & type() const = 0;
42 
44  virtual const std::string & package() const = 0;
45 
47  virtual const VariantHandle & variant() const = 0;
48 
54  virtual Data* clone() const = 0;
55 
61  virtual void serialize(OutputProvider & out) const = 0;
62 
69  virtual void deserialize(InputProvider & in, const Version & version) = 0;
70 
72  bool isVariant(const VariantInterface & v) const { return variant().isVariant(v); }
73  };
74  }
75 }
76 
77 #endif // STROMX_RUNTIME_DATAINTERFACE_H
A version of an operator or data type.
Definition: Version.h:46
Abstract data object.
Definition: Data.h:53
Definition: VariantHandle.h:34
virtual const Version & version() const =0
bool isVariant(const VariantInterface &v) const
Definition: DataInterface.h:72
virtual const VariantHandle & variant() const =0
Provides functions to serialize data to strings and files.
Definition: OutputProvider.h:27
Abstract description of a data variant.
Definition: VariantInterface.h:40
Provides functions to deserialize data from strings and files.
Definition: InputProvider.h:27
virtual Data * clone() const =0
virtual void deserialize(InputProvider &in, const Version &version)=0
virtual const std::string & type() const =0
The stromx class library.
Definition: AdjustRgbChannels.cpp:29
virtual const std::string & package() const =0
Common interface of data objects or references to data objects.
Definition: DataInterface.h:32
virtual void serialize(OutputProvider &out) const =0
virtual bool isVariant(const VariantInterface &variant) const
Definition: VariantHandle.cpp:47