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 * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society 00009 */ 00010 #ifndef _STREAMING_FEATURES__H__ 00011 #define _STREAMING_FEATURES__H__ 00012 00013 #include <shogun/lib/common.h> 00014 #include <shogun/features/Features.h> 00015 #include <shogun/io/StreamingFile.h> 00016 00017 namespace shogun 00018 { 00063 class CStreamingFeatures : public CFeatures 00064 { 00065 00066 public: 00067 00072 CStreamingFeatures(); 00073 00081 CStreamingFeatures(CStreamingFile* file, bool is_labelled, int32_t size); 00082 00086 virtual ~CStreamingFeatures() { } 00087 00094 void set_read_functions(); 00095 00104 virtual void set_vector_reader()=0; 00105 00115 virtual void set_vector_and_label_reader()=0; 00116 00121 virtual void start_parser()=0; 00122 00126 virtual void end_parser()=0; 00127 00135 virtual float64_t get_label()=0; 00136 00142 virtual bool get_next_example()=0; 00143 00149 virtual void release_example()=0; 00150 00156 virtual int32_t get_num_features()=0; 00157 00163 virtual bool get_has_labels(); 00164 00175 virtual bool is_seekable(); 00176 00180 virtual void reset_stream(); 00181 00182 protected: 00183 00185 bool has_labels; 00186 00188 CStreamingFile* working_file; 00189 00191 bool seekable; 00192 00193 }; 00194 } 00195 #endif // _STREAMING_FEATURES__H__