SHOGUN  v3.0.0
 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 
17 
18 namespace shogun
19 {
31 {
32 public:
38 
46 
54  CStreamingVwCacheFile(char* fname, char rw='r', EVwCacheType cache_type = C_NATIVE);
55 
59  virtual ~CStreamingVwCacheFile();
60 
71  virtual void get_vector(VwExample* &ex, int32_t &len);
72 
82  virtual void get_vector_and_label(VwExample* &ex, int32_t &len, float64_t &label);
83 
85  virtual const char* get_name() const
86  {
87  return "StreamingVwCacheFile";
88  }
89 
95  void set_env(CVwEnvironment* env_to_use);
96 
103  {
104  SG_REF(env);
105  return env;
106  }
107 
113  bool is_seekable() { return true; }
114 
120  void reset_stream();
121 
122 private:
128  virtual void init(EVwCacheType cache_type);
129 
130 protected:
133 
136 
139 };
140 }
141 #endif //__STREAMING_VWCACHEFILE_H__

SHOGUN Machine Learning Toolbox - Documentation