Classes | Public Member Functions | Protected Member Functions | Protected Attributes

CSerializableFile Class Reference


Detailed Description

Definition at line 23 of file SerializableFile.h.

Inheritance diagram for CSerializableFile:
Inheritance graph
[legend]

List of all members.

Classes

struct  TSerializableReader

Public Member Functions

 CSerializableFile (void)
 CSerializableFile (FILE *fstream, char rw)
 CSerializableFile (const char *fname, char rw='r')
virtual ~CSerializableFile (void)
virtual void close (void)
virtual bool is_opened (void)
virtual bool write_scalar (const TSGDataType *type, const char *name, const char *prefix, const void *param)
virtual bool read_scalar (const TSGDataType *type, const char *name, const char *prefix, void *param)
virtual bool write_cont_begin (const TSGDataType *type, const char *name, const char *prefix, index_t len_real_y, index_t len_real_x)
virtual bool read_cont_begin (const TSGDataType *type, const char *name, const char *prefix, index_t *len_read_y, index_t *len_read_x)
virtual bool write_cont_end (const TSGDataType *type, const char *name, const char *prefix, index_t len_real_y, index_t len_real_x)
virtual bool read_cont_end (const TSGDataType *type, const char *name, const char *prefix, index_t len_read_y, index_t len_read_x)
virtual bool write_string_begin (const TSGDataType *type, const char *name, const char *prefix, index_t length)
virtual bool read_string_begin (const TSGDataType *type, const char *name, const char *prefix, index_t *length)
virtual bool write_string_end (const TSGDataType *type, const char *name, const char *prefix, index_t length)
virtual bool read_string_end (const TSGDataType *type, const char *name, const char *prefix, index_t length)
virtual bool write_stringentry_begin (const TSGDataType *type, const char *name, const char *prefix, index_t y)
virtual bool read_stringentry_begin (const TSGDataType *type, const char *name, const char *prefix, index_t y)
virtual bool write_stringentry_end (const TSGDataType *type, const char *name, const char *prefix, index_t y)
virtual bool read_stringentry_end (const TSGDataType *type, const char *name, const char *prefix, index_t y)
virtual bool write_sparse_begin (const TSGDataType *type, const char *name, const char *prefix, index_t vec_index, index_t length)
virtual bool read_sparse_begin (const TSGDataType *type, const char *name, const char *prefix, index_t *vec_index, index_t *length)
virtual bool write_sparse_end (const TSGDataType *type, const char *name, const char *prefix, index_t vec_index, index_t length)
virtual bool read_sparse_end (const TSGDataType *type, const char *name, const char *prefix, index_t *vec_index, index_t length)
virtual bool write_sparseentry_begin (const TSGDataType *type, const char *name, const char *prefix, const TSparseEntry< char > *first_entry, index_t feat_index, index_t y)
virtual bool read_sparseentry_begin (const TSGDataType *type, const char *name, const char *prefix, TSparseEntry< char > *first_entry, index_t *feat_index, index_t y)
virtual bool write_sparseentry_end (const TSGDataType *type, const char *name, const char *prefix, const TSparseEntry< char > *first_entry, index_t feat_index, index_t y)
virtual bool read_sparseentry_end (const TSGDataType *type, const char *name, const char *prefix, TSparseEntry< char > *first_entry, index_t *feat_index, index_t y)
virtual bool write_item_begin (const TSGDataType *type, const char *name, const char *prefix, index_t y, index_t x)
virtual bool read_item_begin (const TSGDataType *type, const char *name, const char *prefix, index_t y, index_t x)
virtual bool write_item_end (const TSGDataType *type, const char *name, const char *prefix, index_t y, index_t x)
virtual bool read_item_end (const TSGDataType *type, const char *name, const char *prefix, index_t y, index_t x)
virtual bool write_sgserializable_begin (const TSGDataType *type, const char *name, const char *prefix, const char *sgserializable_name, EPrimitiveType generic)
virtual bool read_sgserializable_begin (const TSGDataType *type, const char *name, const char *prefix, char *sgserializable_name, EPrimitiveType *generic)
virtual bool write_sgserializable_end (const TSGDataType *type, const char *name, const char *prefix, const char *sgserializable_name, EPrimitiveType generic)
virtual bool read_sgserializable_end (const TSGDataType *type, const char *name, const char *prefix, const char *sgserializable_name, EPrimitiveType generic)
virtual bool write_type_begin (const TSGDataType *type, const char *name, const char *prefix)
virtual bool read_type_begin (const TSGDataType *type, const char *name, const char *prefix)
virtual bool write_type_end (const TSGDataType *type, const char *name, const char *prefix)
virtual bool read_type_end (const TSGDataType *type, const char *name, const char *prefix)

Protected Member Functions

virtual void init (FILE *fstream, char task, const char *filename)
virtual TSerializableReadernew_reader (char *dest_version, size_t n)=0
virtual bool write_scalar_wrapped (const TSGDataType *type, const void *param)=0
virtual bool write_cont_begin_wrapped (const TSGDataType *type, index_t len_real_y, index_t len_real_x)=0
virtual bool write_cont_end_wrapped (const TSGDataType *type, index_t len_real_y, index_t len_real_x)=0
virtual bool write_string_begin_wrapped (const TSGDataType *type, index_t length)=0
virtual bool write_string_end_wrapped (const TSGDataType *type, index_t length)=0
virtual bool write_stringentry_begin_wrapped (const TSGDataType *type, index_t y)=0
virtual bool write_stringentry_end_wrapped (const TSGDataType *type, index_t y)=0
virtual bool write_sparse_begin_wrapped (const TSGDataType *type, index_t vec_index, index_t length)=0
virtual bool write_sparse_end_wrapped (const TSGDataType *type, index_t vec_index, index_t length)=0
virtual bool write_sparseentry_begin_wrapped (const TSGDataType *type, const TSparseEntry< char > *first_entry, index_t feat_index, index_t y)=0
virtual bool write_sparseentry_end_wrapped (const TSGDataType *type, const TSparseEntry< char > *first_entry, index_t feat_index, index_t y)=0
virtual bool write_item_begin_wrapped (const TSGDataType *type, index_t y, index_t x)=0
virtual bool write_item_end_wrapped (const TSGDataType *type, index_t y, index_t x)=0
virtual bool write_sgserializable_begin_wrapped (const TSGDataType *type, const char *sgserializable_name, EPrimitiveType generic)=0
virtual bool write_sgserializable_end_wrapped (const TSGDataType *type, const char *sgserializable_name, EPrimitiveType generic)=0
virtual bool write_type_begin_wrapped (const TSGDataType *type, const char *name, const char *prefix)=0
virtual bool write_type_end_wrapped (const TSGDataType *type, const char *name, const char *prefix)=0

Protected Attributes

FILE * m_fstream
char m_task
char * m_filename

Constructor & Destructor Documentation

CSerializableFile ( void   )  [explicit]

default constructor

Definition at line 16 of file SerializableFile.cpp.

CSerializableFile ( FILE *  fstream,
char  rw 
) [explicit]

constructor

Parameters:
f already opened file

Definition at line 22 of file SerializableFile.cpp.

CSerializableFile ( const char *  fname,
char  rw = 'r' 
) [explicit]

constructor

Parameters:
fname filename to open
rw mode, 'r' or 'w'

Definition at line 28 of file SerializableFile.cpp.

~CSerializableFile ( void   )  [virtual]

default destructor

Definition at line 52 of file SerializableFile.cpp.


Member Function Documentation

void close ( void   )  [virtual]

Definition at line 68 of file SerializableFile.cpp.

void init ( FILE *  fstream,
char  task,
const char *  filename 
) [protected, virtual]

Definition at line 61 of file SerializableFile.cpp.

bool is_opened ( void   )  [virtual]

Definition at line 74 of file SerializableFile.cpp.

virtual TSerializableReader* new_reader ( char *  dest_version,
size_t  n 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool read_cont_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t len_read_y,
index_t len_read_x 
) [virtual]

Definition at line 164 of file SerializableFile.cpp.

bool read_cont_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  len_read_y,
index_t  len_read_x 
) [virtual]

Definition at line 191 of file SerializableFile.cpp.

bool read_item_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  y,
index_t  x 
) [virtual]

Definition at line 432 of file SerializableFile.cpp.

bool read_item_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  y,
index_t  x 
) [virtual]

Definition at line 458 of file SerializableFile.cpp.

bool read_scalar ( const TSGDataType type,
const char *  name,
const char *  prefix,
void *  param 
) [virtual]

Definition at line 138 of file SerializableFile.cpp.

bool read_sgserializable_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
char *  sgserializable_name,
EPrimitiveType generic 
) [virtual]

Definition at line 485 of file SerializableFile.cpp.

bool read_sgserializable_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
const char *  sgserializable_name,
EPrimitiveType  generic 
) [virtual]

Definition at line 513 of file SerializableFile.cpp.

bool read_sparse_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t vec_index,
index_t length 
) [virtual]

Definition at line 321 of file SerializableFile.cpp.

bool read_sparse_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t vec_index,
index_t  length 
) [virtual]

Definition at line 347 of file SerializableFile.cpp.

bool read_sparseentry_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
TSparseEntry< char > *  first_entry,
index_t feat_index,
index_t  y 
) [virtual]

Definition at line 375 of file SerializableFile.cpp.

bool read_sparseentry_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
TSparseEntry< char > *  first_entry,
index_t feat_index,
index_t  y 
) [virtual]

Definition at line 404 of file SerializableFile.cpp.

bool read_string_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t length 
) [virtual]

Definition at line 217 of file SerializableFile.cpp.

bool read_string_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  length 
) [virtual]

Definition at line 243 of file SerializableFile.cpp.

bool read_stringentry_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  y 
) [virtual]

Definition at line 269 of file SerializableFile.cpp.

bool read_stringentry_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  y 
) [virtual]

Definition at line 295 of file SerializableFile.cpp.

bool read_type_begin ( const TSGDataType type,
const char *  name,
const char *  prefix 
) [virtual]

Definition at line 539 of file SerializableFile.cpp.

bool read_type_end ( const TSGDataType type,
const char *  name,
const char *  prefix 
) [virtual]

Definition at line 563 of file SerializableFile.cpp.

bool write_cont_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  len_real_y,
index_t  len_real_x 
) [virtual]

Definition at line 151 of file SerializableFile.cpp.

virtual bool write_cont_begin_wrapped ( const TSGDataType type,
index_t  len_real_y,
index_t  len_real_x 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_cont_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  len_real_y,
index_t  len_real_x 
) [virtual]

Definition at line 178 of file SerializableFile.cpp.

virtual bool write_cont_end_wrapped ( const TSGDataType type,
index_t  len_real_y,
index_t  len_real_x 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_item_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  y,
index_t  x 
) [virtual]

Definition at line 419 of file SerializableFile.cpp.

virtual bool write_item_begin_wrapped ( const TSGDataType type,
index_t  y,
index_t  x 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_item_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  y,
index_t  x 
) [virtual]

Definition at line 445 of file SerializableFile.cpp.

virtual bool write_item_end_wrapped ( const TSGDataType type,
index_t  y,
index_t  x 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_scalar ( const TSGDataType type,
const char *  name,
const char *  prefix,
const void *  param 
) [virtual]

Definition at line 125 of file SerializableFile.cpp.

virtual bool write_scalar_wrapped ( const TSGDataType type,
const void *  param 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_sgserializable_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
const char *  sgserializable_name,
EPrimitiveType  generic 
) [virtual]

Definition at line 471 of file SerializableFile.cpp.

virtual bool write_sgserializable_begin_wrapped ( const TSGDataType type,
const char *  sgserializable_name,
EPrimitiveType  generic 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_sgserializable_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
const char *  sgserializable_name,
EPrimitiveType  generic 
) [virtual]

Definition at line 499 of file SerializableFile.cpp.

virtual bool write_sgserializable_end_wrapped ( const TSGDataType type,
const char *  sgserializable_name,
EPrimitiveType  generic 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_sparse_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  vec_index,
index_t  length 
) [virtual]

Definition at line 308 of file SerializableFile.cpp.

virtual bool write_sparse_begin_wrapped ( const TSGDataType type,
index_t  vec_index,
index_t  length 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_sparse_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  vec_index,
index_t  length 
) [virtual]

Definition at line 334 of file SerializableFile.cpp.

virtual bool write_sparse_end_wrapped ( const TSGDataType type,
index_t  vec_index,
index_t  length 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_sparseentry_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
const TSparseEntry< char > *  first_entry,
index_t  feat_index,
index_t  y 
) [virtual]

Definition at line 360 of file SerializableFile.cpp.

virtual bool write_sparseentry_begin_wrapped ( const TSGDataType type,
const TSparseEntry< char > *  first_entry,
index_t  feat_index,
index_t  y 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_sparseentry_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
const TSparseEntry< char > *  first_entry,
index_t  feat_index,
index_t  y 
) [virtual]

Definition at line 389 of file SerializableFile.cpp.

virtual bool write_sparseentry_end_wrapped ( const TSGDataType type,
const TSparseEntry< char > *  first_entry,
index_t  feat_index,
index_t  y 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_string_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  length 
) [virtual]

Definition at line 204 of file SerializableFile.cpp.

virtual bool write_string_begin_wrapped ( const TSGDataType type,
index_t  length 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_string_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  length 
) [virtual]

Definition at line 230 of file SerializableFile.cpp.

virtual bool write_string_end_wrapped ( const TSGDataType type,
index_t  length 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_stringentry_begin ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  y 
) [virtual]

Definition at line 256 of file SerializableFile.cpp.

virtual bool write_stringentry_begin_wrapped ( const TSGDataType type,
index_t  y 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_stringentry_end ( const TSGDataType type,
const char *  name,
const char *  prefix,
index_t  y 
) [virtual]

Definition at line 282 of file SerializableFile.cpp.

virtual bool write_stringentry_end_wrapped ( const TSGDataType type,
index_t  y 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_type_begin ( const TSGDataType type,
const char *  name,
const char *  prefix 
) [virtual]

Definition at line 527 of file SerializableFile.cpp.

virtual bool write_type_begin_wrapped ( const TSGDataType type,
const char *  name,
const char *  prefix 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.

bool write_type_end ( const TSGDataType type,
const char *  name,
const char *  prefix 
) [virtual]

Definition at line 551 of file SerializableFile.cpp.

virtual bool write_type_end_wrapped ( const TSGDataType type,
const char *  name,
const char *  prefix 
) [protected, pure virtual]

Implemented in CSerializableAsciiFile.


Member Data Documentation

char* m_filename [protected]

Definition at line 98 of file SerializableFile.h.

FILE* m_fstream [protected]

Definition at line 96 of file SerializableFile.h.

char m_task [protected]

Definition at line 97 of file SerializableFile.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation