SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StreamingVwCacheFile.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2011 Shashwat Lal Das
8  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
9  */
10 #ifndef __STREAMING_VWCACHEFILE_H__
11 #define __STREAMING_VWCACHEFILE_H__
12 
13 #include <shogun/lib/config.h>
14 
19 
20 namespace shogun
21 {
33 {
34 public:
40 
48 
56  CStreamingVwCacheFile(char* fname, char rw='r', EVwCacheType cache_type = C_NATIVE);
57 
61  virtual ~CStreamingVwCacheFile();
62 
73  virtual void get_vector(VwExample* &ex, int32_t &len);
74 
84  virtual void get_vector_and_label(VwExample* &ex, int32_t &len, float64_t &label);
85 
87  virtual const char* get_name() const
88  {
89  return "StreamingVwCacheFile";
90  }
91 
97  void set_env(CVwEnvironment* env_to_use);
98 
105  {
106  SG_REF(env);
107  return env;
108  }
109 
115  bool is_seekable() { return true; }
116 
122  void reset_stream();
123 
124 private:
130  virtual void init(EVwCacheType cache_type);
131 
132 protected:
135 
138 
141 };
142 }
143 #endif //__STREAMING_VWCACHEFILE_H__

SHOGUN Machine Learning Toolbox - Documentation