IValueTranslator.hpp
1 #ifndef DM_VALUE_TRANSLATOR_HPP_INCLUDED
2 #define DM_VALUE_TRANSLATOR_HPP_INCLUDED
3 
4 #ifdef _MSC_VER
5  #pragma once
6 #endif
7 
8 #include "DM/config.hpp"
9 #include "DM/ObjectBase.hpp"
10 #include "DM/ColumnTypes.hpp"
11 #include "DM/AutoLink.hpp" //enable autolink
12 
13 #include <utility> //stl pair
14 
15 DM_NAMESPACE_BEGIN
16 
17 /// \brief helper class for translating/mapping attributes before inserting into the ODM
18 class DM_API IValueTranslator : public ObjectBase
19 {
20 protected:
21  virtual ~IValueTranslator() {}
22 
23 public:
24  virtual std::pair<int,bool> translate(int v) const = 0;
25  virtual std::pair<double,bool> translate(double v) const = 0;
26  virtual std::pair<float,bool> translate(float v) const = 0;
27 };
28 
29 DM_NAMESPACE_END
30 
31 #endif //DM_VALUE_TRANSLATOR_HPP_INCLUDED