ISIS Core Library 0.7.2 (api 3.0.0)

/scr/tee1/isis/lib/Core/CoreUtils/value_converter.hpp

Go to the documentation of this file.
00001 /*
00002     <one line to give the program's name and a brief idea of what it does.>
00003     Copyright (C) <year>  <name of author>
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 
00018 */
00019 
00020 #ifndef CONVERTER_HPP
00021 #define CONVERTER_HPP
00022 
00023 #include <boost/shared_ptr.hpp>
00024 #include <boost/scoped_ptr.hpp>
00025 #include <boost/numeric/conversion/converter.hpp>
00026 #include "log.hpp"
00027 #include "../config.hpp"
00028 
00030 
00031 namespace isis
00032 {
00033 namespace util
00034 {
00035 class ValueBase;
00036 namespace _internal
00037 {
00038 class ValueConverterBase
00039 {
00040 public:
00041     virtual boost::numeric::range_check_result convert( const ValueBase &src, ValueBase &dst )const = 0;
00042     virtual void create( boost::scoped_ptr<ValueBase>& dst )const = 0;
00043     virtual boost::numeric::range_check_result generate( const ValueBase &src, boost::scoped_ptr<ValueBase>& dst )const = 0;
00044     static boost::shared_ptr<const ValueConverterBase> get() {return boost::shared_ptr<const ValueConverterBase>();}
00045 public:
00046     virtual ~ValueConverterBase() {}
00047 };
00048 
00049 API_EXCLUDE_BEGIN
00050 class ValueConverterMap : public std::map< int , std::map<int, boost::shared_ptr<const ValueConverterBase> > >
00051 {
00052 public:
00053     ValueConverterMap();
00054 };
00055 
00056 }
00057 API_EXCLUDE_END
00058 }
00059 }
00061 #endif // CONVERTER_HPP