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
CSimpleFile< T > Class Template Reference

Detailed Description

template<class T>
class shogun::CSimpleFile< T >

Template class SimpleFile to read and write from files.

Currently only simple reading and writing of blocks is supported.

Definition at line 27 of file SimpleFile.h.

Inheritance diagram for CSimpleFile< T >:
Inheritance graph
[legend]

Public Member Functions

 CSimpleFile ()
 CSimpleFile (char *fname, FILE *f)
virtual ~CSimpleFile ()
T * load (T *target, int64_t &num)
bool save (T *target, int64_t num)
void get_buffered_line (char *line, uint64_t len)
void free_line_buffer ()
void set_line_buffer_size (int32_t bufsize)
bool is_ok ()
virtual const char * get_name () const
- Public Member Functions inherited from CSGObject
 CSGObject ()
 CSGObject (const CSGObject &orig)
virtual ~CSGObject ()
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

FILE * file
bool status
char task
char * filename
int32_t line_buffer_size
char * line_buffer

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 31 of file SimpleFile.h.

CSimpleFile ( char *  fname,
FILE *  f 
)

constructor rw is either r for read and w for write

Parameters
fnamefilename
ffile descriptor

Definition at line 46 of file SimpleFile.h.

virtual ~CSimpleFile ( )
virtual

Definition at line 54 of file SimpleFile.h.

Member Function Documentation

void free_line_buffer ( )

free the line buffer

Definition at line 184 of file SimpleFile.h.

void get_buffered_line ( char *  line,
uint64_t  len 
)

read a line (buffered; to be implemented)

Parameters
linelinebuffer to write to
lenmaximum length

Definition at line 160 of file SimpleFile.h.

virtual const char* get_name ( ) const
virtual
Returns
object name

Implements CSGObject.

Definition at line 210 of file SimpleFile.h.

bool is_ok ( )

check if status is ok

Returns
if status is ok

Definition at line 207 of file SimpleFile.h.

T* load ( T *  target,
int64_t &  num 
)

load

Parameters
targetload target
numnumber of read elements
Returns
loaded target or NULL if unsuccessful

Definition at line 66 of file SimpleFile.h.

bool save ( T *  target,
int64_t  num 
)

save

Parameters
targettarget to save to
numnumber of elements to write
Returns
if saving was successful

Definition at line 135 of file SimpleFile.h.

void set_line_buffer_size ( int32_t  bufsize)

set the size of the line buffer

Parameters
bufsizesize of the line buffer

Definition at line 194 of file SimpleFile.h.

Member Data Documentation

FILE* file
protected

file descriptor

Definition at line 214 of file SimpleFile.h.

char* filename
protected

filename

Definition at line 220 of file SimpleFile.h.

char* line_buffer
protected

line buffer

Definition at line 225 of file SimpleFile.h.

int32_t line_buffer_size
protected

size of line buffer

Definition at line 223 of file SimpleFile.h.

bool status
protected

status of file operations

Definition at line 216 of file SimpleFile.h.

char task
protected

task

Definition at line 218 of file SimpleFile.h.


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

SHOGUN Machine Learning Toolbox - Documentation