CVwCacheWriter is the base class for all VW cache creating classes.
The derived class must implement a cache_example() function which writes that example into the cache file. The class is provided with the file and the environment.
Definition at line 35 of file VwCacheWriter.h.
Public Member Functions | |
CVwCacheWriter () | |
CVwCacheWriter (char *fname, CVwEnvironment *env_to_use) | |
CVwCacheWriter (int32_t f, CVwEnvironment *env_to_use) | |
virtual | ~CVwCacheWriter () |
virtual void | set_file (int32_t f) |
virtual void | set_env (CVwEnvironment *env_to_use) |
virtual CVwEnvironment * | get_env () |
virtual void | cache_example (VwExample *&ex)=0 |
Protected Attributes | |
int32_t | fd |
File descriptor. | |
CVwEnvironment * | env |
Environment. |
CVwCacheWriter | ( | ) |
Default constructor
Definition at line 20 of file VwCacheWriter.cpp.
CVwCacheWriter | ( | char * | fname, | |
CVwEnvironment * | env_to_use | |||
) |
Constructor, opens file specified by filename
fname | name of file to open | |
env_to_use | environment |
Definition at line 27 of file VwCacheWriter.cpp.
CVwCacheWriter | ( | int32_t | f, | |
CVwEnvironment * | env_to_use | |||
) |
Constructor, uses file specified by descriptor
f | descriptor of opened cache file | |
env_to_use | environment |
Definition at line 39 of file VwCacheWriter.cpp.
~CVwCacheWriter | ( | ) | [virtual] |
Destructor
Definition at line 47 of file VwCacheWriter.cpp.
virtual void cache_example | ( | VwExample *& | ex | ) | [pure virtual] |
Function to cache one example to the file
ex | example to cache |
Implemented in CVwNativeCacheWriter.
CVwEnvironment * get_env | ( | ) | [virtual] |
void set_env | ( | CVwEnvironment * | env_to_use | ) | [virtual] |
Set the environment
env_to_use | environment |
Definition at line 58 of file VwCacheWriter.cpp.
void set_file | ( | int32_t | f | ) | [virtual] |
Set the file descriptor to use
f | descriptor of cache file |
Reimplemented in CVwNativeCacheWriter.
Definition at line 53 of file VwCacheWriter.cpp.
CVwEnvironment* env [protected] |
Environment.
Definition at line 99 of file VwCacheWriter.h.
int32_t fd [protected] |
File descriptor.
Definition at line 96 of file VwCacheWriter.h.