ISIS Core Library 0.7.2 (api 3.0.0)
|
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 TYPEPTR_CONVERTER_H 00021 #define TYPEPTR_CONVERTER_H 00022 00023 #include <boost/shared_ptr.hpp> 00024 #include <boost/scoped_ptr.hpp> 00025 #include <map> 00026 #include "../CoreUtils/value_base.hpp" 00027 00029 00030 namespace isis 00031 { 00032 namespace data 00033 { 00034 enum autoscaleOption {noscale, autoscale, noupscale, upscale}; 00035 typedef std::pair<util::ValueReference, util::ValueReference> scaling_pair; 00036 class ValueArrayBase; 00037 00038 API_EXCLUDE_BEGIN 00039 namespace _internal 00040 { 00041 class ValueArrayConverterBase 00042 { 00043 public: 00044 virtual void convert( const ValueArrayBase &src, ValueArrayBase &dst, const scaling_pair &scaling )const; 00045 virtual void generate( const ValueArrayBase &src, boost::scoped_ptr<ValueArrayBase>& dst, const scaling_pair &scaling )const = 0; 00047 virtual void create( boost::scoped_ptr<ValueArrayBase>& dst, size_t len )const = 0; 00048 virtual scaling_pair getScaling( const util::ValueBase &min, const util::ValueBase &max, autoscaleOption scaleopt = autoscale )const; 00049 static boost::shared_ptr<const ValueArrayConverterBase> get() {return boost::shared_ptr<const ValueArrayConverterBase>();} 00050 virtual ~ValueArrayConverterBase() {} 00051 }; 00052 00053 class ValueArrayConverterMap : public std::map< int , std::map<int, boost::shared_ptr<const ValueArrayConverterBase> > > 00054 { 00055 public: 00056 ValueArrayConverterMap(); 00057 }; 00058 00059 } 00060 API_EXCLUDE_END 00061 } 00062 } 00063 00065 #endif // TYPEPTR_CONVERTER_H