SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
CVwCacheWriter Class Reference

Detailed Description

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.

Inheritance diagram for CVwCacheWriter:
Inheritance graph
[legend]

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 CVwEnvironmentget_env ()
virtual void cache_example (VwExample *&ex)=0
- Public Member Functions inherited from CSGObject
 CSGObject ()
 CSGObject (const CSGObject &orig)
virtual ~CSGObject ()
virtual const char * get_name () const =0
virtual bool is_generic (EPrimitiveType *generic) const
template<class T >
void set_generic ()
void unset_generic ()
virtual void print_serializable (const char *prefix="")
virtual bool save_serializable (CSerializableFile *file, const char *prefix="")
virtual bool load_serializable (CSerializableFile *file, const char *prefix="")
void set_global_io (SGIO *io)
SGIOget_global_io ()
void set_global_parallel (Parallel *parallel)
Parallelget_global_parallel ()
void set_global_version (Version *version)
Versionget_global_version ()
SGVector< char * > get_modelsel_names ()
char * get_modsel_param_descr (const char *param_name)
index_t get_modsel_param_index (const char *param_name)

Protected Attributes

int32_t fd
 File descriptor.
CVwEnvironmentenv
 Environment.

Additional Inherited Members

- Public Attributes inherited from CSGObject
SGIOio
Parallelparallel
Versionversion
Parameterm_parameters
Parameterm_model_selection_parameters
- Protected Member Functions inherited from CSGObject
virtual void load_serializable_pre () throw (ShogunException)
virtual void load_serializable_post () throw (ShogunException)
virtual void save_serializable_pre () throw (ShogunException)
virtual void save_serializable_post () throw (ShogunException)

Constructor & Destructor Documentation

Default constructor

Definition at line 20 of file VwCacheWriter.cpp.

CVwCacheWriter ( char *  fname,
CVwEnvironment env_to_use 
)

Constructor, opens file specified by filename

Parameters
fnamename of file to open
env_to_useenvironment

Definition at line 27 of file VwCacheWriter.cpp.

CVwCacheWriter ( int32_t  f,
CVwEnvironment env_to_use 
)

Constructor, uses file specified by descriptor

Parameters
fdescriptor of opened cache file
env_to_useenvironment

Definition at line 39 of file VwCacheWriter.cpp.

~CVwCacheWriter ( )
virtual

Destructor

Definition at line 47 of file VwCacheWriter.cpp.

Member Function Documentation

virtual void cache_example ( VwExample *&  ex)
pure virtual

Function to cache one example to the file

Parameters
exexample to cache

Implemented in CVwNativeCacheWriter.

CVwEnvironment * get_env ( )
virtual

Get the environment

Returns
environment

Definition at line 64 of file VwCacheWriter.cpp.

void set_env ( CVwEnvironment env_to_use)
virtual

Set the environment

Parameters
env_to_useenvironment

Definition at line 58 of file VwCacheWriter.cpp.

void set_file ( int32_t  f)
virtual

Set the file descriptor to use

Parameters
fdescriptor of cache file

Reimplemented in CVwNativeCacheWriter.

Definition at line 53 of file VwCacheWriter.cpp.

Member Data Documentation

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.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation