SHOGUN
v3.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
io
streaming
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/io/streaming/StreamingFile.h
>
14
#include <
shogun/classifier/vw/vw_common.h
>
15
#include <
shogun/classifier/vw/cache/VwCacheReader.h
>
16
#include <
shogun/classifier/vw/cache/VwNativeCacheReader.h
>
17
18
namespace
shogun
19
{
30
class
CStreamingVwCacheFile
:
public
CStreamingFile
31
{
32
public
:
37
CStreamingVwCacheFile
();
38
45
CStreamingVwCacheFile
(
EVwCacheType
cache_type);
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
102
CVwEnvironment
*
get_env
()
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
:
132
CVwCacheReader
*
cache_reader
;
133
135
CVwEnvironment
*
env
;
136
138
EVwCacheType
cache_format
;
139
};
140
}
141
#endif //__STREAMING_VWCACHEFILE_H__
SHOGUN
Machine Learning Toolbox - Documentation