00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2011 Shashwat Lal Das 00008 * Written (W) 2012 Heiko Strathmann 00009 * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society 00010 */ 00011 #ifndef _STREAMING_FEATURES__H__ 00012 #define _STREAMING_FEATURES__H__ 00013 00014 #include <shogun/lib/common.h> 00015 #include <shogun/features/Features.h> 00016 #include <shogun/io/streaming/StreamingFile.h> 00017 00018 namespace shogun 00019 { 00070 class CStreamingFeatures : public CFeatures 00071 { 00072 00073 public: 00074 00079 CStreamingFeatures(); 00080 00084 virtual ~CStreamingFeatures(); 00085 00092 void set_read_functions(); 00093 00102 virtual void set_vector_reader()=0; 00103 00113 virtual void set_vector_and_label_reader()=0; 00114 00119 virtual void start_parser()=0; 00120 00124 virtual void end_parser()=0; 00125 00133 virtual float64_t get_label()=0; 00134 00140 virtual bool get_next_example()=0; 00141 00147 virtual void release_example()=0; 00148 00154 virtual int32_t get_num_features()=0; 00155 00161 virtual bool get_has_labels(); 00162 00173 virtual bool is_seekable(); 00174 00178 virtual void reset_stream(); 00179 00188 virtual CFeatures* get_streamed_features(index_t num_elements) 00189 { 00190 SG_ERROR("%s::get_streamed_features() is not yet implemented!\n", 00191 get_name()); 00192 return NULL; 00193 } 00194 00195 protected: 00196 00198 bool has_labels; 00199 00201 CStreamingFile* working_file; 00202 00204 bool seekable; 00205 00206 }; 00207 } 00208 #endif // _STREAMING_FEATURES__H__